summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
authorVarun Gupta <varunraiko1803@gmail.com>2016-12-13 05:07:02 +0530
committerVarun Gupta <varunraiko1803@gmail.com>2016-12-14 12:45:50 +0530
commitf41bd7e54512d4e283ba909b4c3a700382cf1147 (patch)
tree342322188fc51e7b1b01805893be754b9f03235e /sql/opt_range.cc
parent0c79de2419194f850e92de6ffa48d2e92055ee50 (diff)
downloadmariadb-git-f41bd7e54512d4e283ba909b4c3a700382cf1147.tar.gz
MDEV-11060 sql/protocol.cc:532: void Protocol::end_statement(): Assertion `0' failed
In file sql/opt_range.cc,when calculate_cond_selectivity_for_table() is called with optimizer_use_condition_selectivity=4 then - thd->no_errors is set to 1 - the original value of thd->no_error is not restored to its original value - this is causing the assertion to fail in the subsequent queries Fixed by restoring the original value of thd->no_errors
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r--sql/opt_range.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index bed57f3273f..0577ef01bb2 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -3112,6 +3112,7 @@ bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item **cond)
}
free_alloc:
+ thd->no_errors= 0;
thd->mem_root= param.old_root;
free_root(&alloc, MYF(0));