summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorKristofer Pettersson <kristofer.pettersson@sun.com>2010-03-24 17:37:41 +0100
committerKristofer Pettersson <kristofer.pettersson@sun.com>2010-03-24 17:37:41 +0100
commitea7d830ad2c5715597d2d7e55215263f0fd8ba7c (patch)
tree8605726f862697897b4e58175b7e044c455b9461 /sql/sql_parse.cc
parentd6678deab8ec0628aa57522705adccaedea5f8cd (diff)
downloadmariadb-git-ea7d830ad2c5715597d2d7e55215263f0fd8ba7c.tar.gz
Bug#46615 Assertion in Query_cache::invalidate in INSERT in a VIEW of a MERGE table
If the listed columns in the view definition of the table used in a 'INSERT .. SELECT ..' statement mismatched, a debug assertion would trigger in the cache invalidation code following the failing statement. Although the find_field_in_view() function correctly generated ER_BAD_FIELD_ERROR during setup_fields(), the error failed to propagate further than handle_select(). This patch fixes the issue by adding a check for the return value. mysql-test/r/query_cache_with_views.result: * added test for bug 46615 mysql-test/t/query_cache_with_views.test: * added test for bug 46615 sql/sql_parse.cc: * added check for handle_select() return code before attempting to invalidate the cache.
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 168b16c61bf..5228a37f490 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -3241,7 +3241,7 @@ end_with_restore_list:
TODO: this is workaround. right way will be move invalidating in
the unlock procedure.
*/
- if (first_table->lock_type == TL_WRITE_CONCURRENT_INSERT &&
+ if (!res && first_table->lock_type == TL_WRITE_CONCURRENT_INSERT &&
thd->lock)
{
/* INSERT ... SELECT should invalidate only the very first table */