diff options
author | unknown <igor@olga.mysql.com> | 2007-01-26 09:33:19 -0800 |
---|---|---|
committer | unknown <igor@olga.mysql.com> | 2007-01-26 09:33:19 -0800 |
commit | 4f118f1d76948b7f84f4497297d6f3b1f91b8fd2 (patch) | |
tree | e508795e92b023da8f2e22d69620cb3ddd54d9e0 /sql | |
parent | 92a7c1ed9c6dec1fee17a830fdabe9272d6692bd (diff) | |
parent | 917adbaec4abe14b67150656ee2002be335f43f9 (diff) | |
download | mariadb-git-4f118f1d76948b7f84f4497297d6f3b1f91b8fd2.tar.gz |
Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug24653
sql/item.h:
Auto merged
Diffstat (limited to 'sql')
-rw-r--r-- | sql/filesort.cc | 6 | ||||
-rw-r--r-- | sql/item_subselect.cc | 4 | ||||
-rw-r--r-- | sql/sql_select.cc | 21 |
3 files changed, 30 insertions, 1 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc index 81600ce8a93..73f480aad02 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -428,7 +428,8 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select, byte *ref_pos,*next_pos,ref_buff[MAX_REFLENGTH]; my_off_t record; TABLE *sort_form; - volatile THD::killed_state *killed= ¤t_thd->killed; + THD *thd= current_thd; + volatile THD::killed_state *killed= &thd->killed; handler *file; DBUG_ENTER("find_all_keys"); DBUG_PRINT("info",("using: %s",(select?select->quick?"ranges":"where":"every row"))); @@ -525,6 +526,9 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select, } else file->unlock_row(); + /* It does not make sense to read more keys in case of a fatal error */ + if (thd->net.report_error) + DBUG_RETURN(HA_POS_ERROR); } if (quick_select) { diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index e19815960a6..d61bb25e9b7 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -195,6 +195,10 @@ bool Item_subselect::exec() { int res; + if (thd->net.report_error) + /* Do not execute subselect in case of a fatal error */ + return 1; + res= engine->exec(); if (engine_changed) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index dbfdb783c9a..c445c6f5312 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -855,6 +855,13 @@ JOIN::optimize() { ORDER *org_order= order; order=remove_const(this, order,conds,1, &simple_order); + if (thd->net.report_error) + { + error= 1; + DBUG_PRINT("error",("Error from remove_const")); + DBUG_RETURN(1); + } + /* If we are using ORDER BY NULL or ORDER BY const_expression, return result in any order (even if we are using a GROUP BY) @@ -962,6 +969,12 @@ JOIN::optimize() group_list= remove_const(this, (old_group_list= group_list), conds, rollup.state == ROLLUP::STATE_NONE, &simple_group); + if (thd->net.report_error) + { + error= 1; + DBUG_PRINT("error",("Error from remove_const")); + DBUG_RETURN(1); + } if (old_group_list && !group_list) select_distinct= 0; } @@ -978,6 +991,12 @@ JOIN::optimize() { group_list= procedure->group= remove_const(this, procedure->group, conds, 1, &simple_group); + if (thd->net.report_error) + { + error= 1; + DBUG_PRINT("error",("Error from remove_const")); + DBUG_RETURN(1); + } calc_group_buffer(this, group_list); } @@ -6415,6 +6434,8 @@ remove_const(JOIN *join,ORDER *first_order, COND *cond, *simple_order=0; // Must do a temp table to sort else if (!(order_tables & not_const_tables)) { + if (order->item[0]->with_subselect) + order->item[0]->val_str(&order->item[0]->str_value); DBUG_PRINT("info",("removing: %s", order->item[0]->full_name())); continue; // skip const item } |