diff options
author | unknown <bell@sanja.is.com.ua> | 2003-03-06 17:37:12 +0200 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2003-03-06 17:37:12 +0200 |
commit | c4f89626eeba1222e3a7c5f5bd9c9548a55b943d (patch) | |
tree | 820962144380ec93e63bdfa87edb87c6e2cc3bf9 | |
parent | b2ded34fbce979c10d340f64841f60adebab3648 (diff) | |
download | mariadb-git-c4f89626eeba1222e3a7c5f5bd9c9548a55b943d.tar.gz |
do not allow to cache queries with INTO clause
mysql-test/r/query_cache.result:
INTO OUTFILE/DUMPFILE test
mysql-test/t/query_cache.test:
INTO OUTFILE/DUMPFILE test
-rw-r--r-- | mysql-test/r/query_cache.result | 12 | ||||
-rw-r--r-- | mysql-test/t/query_cache.test | 13 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 8 |
3 files changed, 31 insertions, 2 deletions
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 41fccc2743c..0907abcbc86 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -564,3 +564,15 @@ show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 0 drop table t1; +drop table if exists t1; +create table t1 (a int); +insert into t1 values (1),(2),(3); +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +select * from t1 into outfile "query_caceh.out.file"; +select * from t1 limit 1 into dumpfile "query_cache.dump.file"; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +drop table t1; diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index dd092866e44..f19d3bdc93a 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -406,4 +406,17 @@ select * from t1; show status like "Qcache_queries_in_cache"; load data infile '../../std_data/words.dat' into table t1; show status like "Qcache_queries_in_cache"; +drop table t1; + +# +# INTO OUTFILE/DUMPFILE test +# + +drop table if exists t1; +create table t1 (a int); +insert into t1 values (1),(2),(3); +show status like "Qcache_queries_in_cache"; +select * from t1 into outfile "query_caceh.out.file"; +select * from t1 limit 1 into dumpfile "query_cache.dump.file"; +show status like "Qcache_queries_in_cache"; drop table t1;
\ No newline at end of file diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 2f339f30eb4..7484eeb5114 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -2448,13 +2448,17 @@ procedure_item: opt_into: INTO OUTFILE TEXT_STRING { - if (!(Lex->exchange= new sql_exchange($3.str,0))) + THD *thd= current_thd; + thd->safe_to_cache_query= 0; + if (!(thd->lex.exchange= new sql_exchange($3.str,0))) YYABORT; } opt_field_term opt_line_term | INTO DUMPFILE TEXT_STRING { - if (!(Lex->exchange= new sql_exchange($3.str,1))) + THD *thd= current_thd; + thd->safe_to_cache_query= 0; + if (!(thd->lex.exchange= new sql_exchange($3.str,1))) YYABORT; }; |