summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2009-10-30 15:15:43 +0200
committerGeorgi Kodinov <joro@sun.com>2009-10-30 15:15:43 +0200
commit9d96cd6dcb3f171cbbe93c0f7061ce132a9087a7 (patch)
tree35ed35ec715be27cf87f8f67132283e347b9643b /sql/sql_select.cc
parent851e250953e531c2c5189dff0d7202cb79acf5d6 (diff)
downloadmariadb-git-9d96cd6dcb3f171cbbe93c0f7061ce132a9087a7.tar.gz
Bug #48291 : crash with row() operator,select into @var, and
subquery returning multiple rows Error handling was missing when handling subqueires in WHERE and when assigning a SELECT result to a @variable. This caused crash(es). Fixed by adding error handling code to both the WHERE condition evaluation and to assignment to an @variable.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index c425d9a988e..d5c2b93dfb4 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -10822,6 +10822,7 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
bool not_used_in_distinct=join_tab->not_used_in_distinct;
ha_rows found_records=join->found_records;
COND *select_cond= join_tab->select_cond;
+ bool select_cond_result= TRUE;
if (error > 0 || (*report_error)) // Fatal error
return NESTED_LOOP_ERROR;
@@ -10833,7 +10834,17 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
return NESTED_LOOP_KILLED; /* purecov: inspected */
}
DBUG_PRINT("info", ("select cond 0x%lx", (ulong)select_cond));
- if (!select_cond || select_cond->val_int())
+
+ if (select_cond)
+ {
+ select_cond_result= test(select_cond->val_int());
+
+ /* check for errors evaluating the condition */
+ if (join->thd->net.report_error)
+ return NESTED_LOOP_ERROR;
+ }
+
+ if (!select_cond || select_cond_result)
{
/*
There is no select condition or the attached pushed down