summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMithun C Y <mithun.c.y@oracle.com>2015-08-04 11:45:02 +0530
committerMithun C Y <mithun.c.y@oracle.com>2015-08-04 11:45:02 +0530
commitc28626d0af640dddfb2c4d970f0ce4f6ec1776cc (patch)
tree63142b1d0f84b18b3df70339adc11f1879da9e4b /sql
parent9372c9ebd2d63f27bec2e203a4a9bda37ac4e2df (diff)
downloadmariadb-git-c28626d0af640dddfb2c4d970f0ce4f6ec1776cc.tar.gz
Bug #21096444: MYSQL IS TRYING TO PERFORM A CONSISTENT READ BUT THE READ VIEW IS NOT ASSIGNED!
Issue: A select for update subquery in having clause resulted deadlock and its transaction was rolled back by innodb. val_XXX interfaces do not handle errors and it do not propogate errors to its caller. sub_select did not see this error when it called evaluate_join_record and later made a call to innodb. As transaction is rolled back innodb asserted. Fix: Now evaluate_join_record checks if there is any error reported and then return the same to its caller.
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_select.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 21b84cbca54..8a83b907b2e 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -11598,6 +11598,11 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
rc= (*join_tab->next_select)(join, join_tab+1, 0);
if (rc != NESTED_LOOP_OK && rc != NESTED_LOOP_NO_MORE_ROWS)
return rc;
+
+ /* check for errors evaluating the condition */
+ if (join->thd->is_error())
+ return NESTED_LOOP_ERROR;
+
if (join->return_tab < join_tab)
return NESTED_LOOP_OK;
/*