diff options
author | unknown <guilhem@gbichot3.local> | 2007-06-23 19:16:51 +0200 |
---|---|---|
committer | unknown <guilhem@gbichot3.local> | 2007-06-23 19:16:51 +0200 |
commit | ba7e22dbe4acab510c78e163f1993fbf569b6f2d (patch) | |
tree | dca6090aa42c27d3be5534439665653675c5ebb4 /sql/sql_prepare.cc | |
parent | a50a88e29c53cc09a3c17d437609a7e9183cae45 (diff) | |
download | mariadb-git-ba7e22dbe4acab510c78e163f1993fbf569b6f2d.tar.gz |
Fix for BUG#29318 "Statements prepared with PREPARE and with one
parameter don't use query cache"
Thanks to the fix of BUG#26842, statements prepared with SQL PREPARE
and having parameters can now use the query cache.
mysql-test/include/query_cache_sql_prepare.inc:
now, statements prepared with SQL PREPARE use the query cache even
when they have parameters.
mysql-test/r/query_cache_ps_no_prot.result:
updated result: we see caching happened.
mysql-test/r/query_cache_ps_ps_prot.result:
updated result: we see caching happened
sql/sql_prepare.cc:
query expansion does not insert user variables' references anymore,
it now inserts parameters' values (BUG#26842's fix did this);
so we can use the query cache.
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r-- | sql/sql_prepare.cc | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index d1d70089584..6994ff99422 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2922,18 +2922,6 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len) thd->restore_backup_statement(this, &stmt_backup); thd->stmt_arena= old_stmt_arena; - if ((protocol->type() == Protocol::PROTOCOL_TEXT) && (param_count > 0)) - { - /* - This is a mysql_sql_stmt_prepare(); query expansion will insert user - variable references, and user variables are uncacheable, thus we have to - mark this statement as uncacheable. - This has to be done before setup_set_params(), as it may make expansion - unneeded. - */ - lex->safe_to_cache_query= FALSE; - } - if (error == 0) { setup_set_params(); |