diff options
author | unknown <bell@sanja.is.com.ua> | 2002-06-19 17:55:51 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2002-06-19 17:55:51 +0300 |
commit | 6e04a0c8856eaf1410d23fa69c627348f2bda7e5 (patch) | |
tree | 4aa9ff0e1918a33230a83361912293362fe46b40 /sql/sql_class.cc | |
parent | 2ec3617476e7731c5f6b704b0321d6be60822b2d (diff) | |
parent | c6a2ae17a01d1f93257ea1ce5af0513d870585b0 (diff) | |
download | mariadb-git-6e04a0c8856eaf1410d23fa69c627348f2bda7e5.tar.gz |
merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r-- | sql/sql_class.cc | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index f91c508e8af..7a1ac4728da 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -766,7 +766,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)); @@ -785,10 +784,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); } @@ -803,18 +803,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); +} + |