summaryrefslogtreecommitdiff
path: root/sql/sql_cursor.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2012-08-21 08:46:32 +0300
committerMichael Widenius <monty@askmonty.org>2012-08-21 08:46:32 +0300
commita45c451e4002875187a40ec17e872d3b69a3452a (patch)
tree3b77baea158d3e2c0cc92b0f5b01bb3f7eb9ae37 /sql/sql_cursor.cc
parent75e8ce6d7316900e3b9431e9d50889fe00d2928c (diff)
downloadmariadb-git-a45c451e4002875187a40ec17e872d3b69a3452a.tar.gz
Fix for bug lp:1039277 "Crash in sql_cache.cc".
The crash happend when combining query cache, prepared statements and using a read only cursor. sql/sql_cache.cc: Fixed unlikely error when one adjust query cache size in middle of operation sql/sql_cursor.cc: Disable query cache when using cursors. This fixed lp:1039277 tests/mysql_client_test.c: Test case for lp:1039277
Diffstat (limited to 'sql/sql_cursor.cc')
-rw-r--r--sql/sql_cursor.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc
index c50cded7470..b8b979a282b 100644
--- a/sql/sql_cursor.cc
+++ b/sql/sql_cursor.cc
@@ -115,6 +115,8 @@ int mysql_open_cursor(THD *thd, select_result *result,
&thd->security_ctx->priv_user[0],
(char *) thd->security_ctx->host_or_ip,
2);
+ /* Mark that we can't use query cache with cursors */
+ thd->query_cache_is_applicable= 0;
rc= mysql_execute_command(thd);
MYSQL_QUERY_EXEC_DONE(rc);