mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge abotchkov@work.mysql.com:/home/bk/mysql-4.1
into bisonxp.(none):/home/hf/work/mysql-4.1
This commit is contained in:
@ -81,7 +81,7 @@ static void free_var(user_var_entry *entry)
|
||||
|
||||
THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0),
|
||||
insert_id_used(0), in_lock_tables(0),
|
||||
global_read_lock(0), bootstrap(0), having_fix_field(0)
|
||||
global_read_lock(0), bootstrap(0)
|
||||
{
|
||||
host=user=priv_user=db=query=ip=0;
|
||||
host_or_ip="unknown ip";
|
||||
@ -103,6 +103,7 @@ THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0),
|
||||
file_id = 0;
|
||||
cond_count=0;
|
||||
convert_set=0;
|
||||
db_charset=default_charset_info;
|
||||
mysys_var=0;
|
||||
#ifndef DBUG_OFF
|
||||
dbug_sentry=THD_SENTRY_MAGIC;
|
||||
@ -769,7 +770,6 @@ void select_dump::send_error(uint errcode,const char *err)
|
||||
file= -1;
|
||||
}
|
||||
|
||||
|
||||
bool select_dump::send_eof()
|
||||
{
|
||||
int error=test(end_io_cache(&cache));
|
||||
@ -788,10 +788,11 @@ select_subselect::select_subselect(Item_subselect *item)
|
||||
this->item=item;
|
||||
}
|
||||
|
||||
bool select_subselect::send_data(List<Item> &items)
|
||||
bool select_singleval_subselect::send_data(List<Item> &items)
|
||||
{
|
||||
DBUG_ENTER("select_subselect::send_data");
|
||||
if (item->assigned){
|
||||
DBUG_ENTER("select_singleval_subselect::send_data");
|
||||
Item_singleval_subselect *it= (Item_singleval_subselect *)item;
|
||||
if (it->assigned){
|
||||
my_printf_error(ER_SUBSELECT_NO_1_ROW, ER(ER_SUBSELECT_NO_1_ROW), MYF(0));
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
@ -806,18 +807,33 @@ bool select_subselect::send_data(List<Item> &items)
|
||||
Following val() call have to be first, because function AVG() & STD()
|
||||
calculate value on it & determinate "is it NULL?".
|
||||
*/
|
||||
item->real_value= val_item->val();
|
||||
if ((item->null_value= val_item->is_null()))
|
||||
it->real_value= val_item->val();
|
||||
if ((it->null_value= val_item->is_null()))
|
||||
{
|
||||
item->assign_null();
|
||||
it->assign_null();
|
||||
} else {
|
||||
item->max_length= val_item->max_length;
|
||||
item->decimals= val_item->decimals;
|
||||
item->binary= val_item->binary;
|
||||
val_item->val_str(&item->str_value);
|
||||
item->int_value= val_item->val_int();
|
||||
item->res_type= val_item->result_type();
|
||||
it->max_length= val_item->max_length;
|
||||
it->decimals= val_item->decimals;
|
||||
it->binary= val_item->binary;
|
||||
val_item->val_str(&it->str_value);
|
||||
it->int_value= val_item->val_int();
|
||||
it->res_type= val_item->result_type();
|
||||
}
|
||||
item->assigned= 1;
|
||||
it->assigned= 1;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
bool select_exists_subselect::send_data(List<Item> &items)
|
||||
{
|
||||
DBUG_ENTER("select_exists_subselect::send_data");
|
||||
Item_exists_subselect *it= (Item_exists_subselect *)item;
|
||||
if (unit->offset_limit_cnt)
|
||||
{ // Using limit offset,count
|
||||
unit->offset_limit_cnt--;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
it->value= 1;
|
||||
it->assigned= 1;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user