diff options
author | unknown <kent@mysql.com> | 2005-10-04 04:03:48 +0200 |
---|---|---|
committer | unknown <kent@mysql.com> | 2005-10-04 04:03:48 +0200 |
commit | 12416ec958b854731370ee13e6f1f00eb96ccdd1 (patch) | |
tree | e2fc836b25a9005ed3526e5949d5db1aafd7918d /mysql-test | |
parent | 3ebf81491f3413944101c38409ae3c1a1990bca2 (diff) | |
parent | 5672f913c248bb5e09bb7d5d622410dfe074fdf7 (diff) | |
download | mariadb-git-12416ec958b854731370ee13e6f1f00eb96ccdd1.tar.gz |
Merge kboortz@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/Users/kent/mysql/bk/mysql-5.0
sql/sql_base.cc:
Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/mysqltest.result | 2 | ||||
-rw-r--r-- | mysql-test/r/query_cache.result | 170 | ||||
-rw-r--r-- | mysql-test/r/sp-error.result | 1 | ||||
-rw-r--r-- | mysql-test/r/view.result | 10 | ||||
-rw-r--r-- | mysql-test/t/query_cache.test | 42 | ||||
-rw-r--r-- | mysql-test/t/sp-error.test | 26 | ||||
-rw-r--r-- | mysql-test/t/view.test | 2 |
7 files changed, 237 insertions, 16 deletions
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 7c01b7bdfba..0ad6db8c57e 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -134,7 +134,6 @@ select 1146 as "after_!errno_masked_error" ; after_!errno_masked_error 1146 mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno 1146 instead of 1000... -mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno 1146 instead of 1000... garbage ; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 select 1064 as "after_--enable_abort_on_error" ; @@ -143,7 +142,6 @@ after_--enable_abort_on_error select 3 from t1 ; ERROR 42S02: Table 'test.t1' doesn't exist mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno 1146 instead of 1064... -mysqltest: At line 1: query 'select 3 from t1' failed: 1146: Table 'test.t1' doesn't exist hello hello ;;;;;;;; diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 0efd5ac1566..f2c3e617144 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -1057,42 +1057,64 @@ create table t1 (s1 int)// create procedure f1 () begin select sql_cache * from t1; select sql_cache * from t1; +select sql_cache * from t1; +end;// +create procedure f2 () begin +select sql_cache * from t1 where s1=1; +select sql_cache * from t1; +end;// +create procedure f3 () begin +select sql_cache * from t1; +select sql_cache * from t1 where s1=1; +end;// +create procedure f4 () begin +select sql_cache * from t1; +select sql_cache * from t1 where s1=1; +select sql_cache * from t1; +select sql_cache * from t1 where s1=1; +select sql_cache * from t1 where s1=1; end;// call f1(); s1 +s1 +s1 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 1 +Qcache_queries_in_cache 3 show status like "Qcache_inserts"; Variable_name Value -Qcache_inserts 1 +Qcache_inserts 3 show status like "Qcache_hits"; Variable_name Value -Qcache_hits 1 +Qcache_hits 0 call f1(); s1 +s1 +s1 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 1 +Qcache_queries_in_cache 3 show status like "Qcache_inserts"; Variable_name Value -Qcache_inserts 1 +Qcache_inserts 3 show status like "Qcache_hits"; Variable_name Value Qcache_hits 3 call f1(); s1 +s1 +s1 select sql_cache * from t1; s1 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 2 +Qcache_queries_in_cache 4 show status like "Qcache_inserts"; Variable_name Value -Qcache_inserts 2 +Qcache_inserts 4 show status like "Qcache_hits"; Variable_name Value -Qcache_hits 5 +Qcache_hits 6 insert into t1 values (1); select sql_cache * from t1; s1 @@ -1102,28 +1124,150 @@ Variable_name Value Qcache_queries_in_cache 1 show status like "Qcache_inserts"; Variable_name Value -Qcache_inserts 3 +Qcache_inserts 5 show status like "Qcache_hits"; Variable_name Value -Qcache_hits 5 +Qcache_hits 6 call f1(); s1 1 +s1 +1 +s1 +1 call f1(); s1 1 +s1 +1 +s1 +1 select sql_cache * from t1; s1 1 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 2 +Qcache_queries_in_cache 4 show status like "Qcache_inserts"; Variable_name Value -Qcache_inserts 4 +Qcache_inserts 8 show status like "Qcache_hits"; Variable_name Value -Qcache_hits 9 +Qcache_hits 10 +flush query cache; +reset query cache; +flush status; +select sql_cache * from t1; +s1 +1 +select sql_cache * from t1 where s1=1; +s1 +1 +call f1(); +s1 +1 +s1 +1 +s1 +1 +call f2(); +s1 +1 +s1 +1 +call f3(); +s1 +1 +s1 +1 +call f4(); +s1 +1 +s1 +1 +s1 +1 +s1 +1 +s1 +1 +call f4(); +s1 +1 +s1 +1 +s1 +1 +s1 +1 +s1 +1 +call f3(); +s1 +1 +s1 +1 +call f2(); +s1 +1 +s1 +1 +select sql_cache * from t1 where s1=1; +s1 +1 +insert into t1 values (2); +call f1(); +s1 +1 +2 +s1 +1 +2 +s1 +1 +2 +select sql_cache * from t1 where s1=1; +s1 +1 +select sql_cache * from t1; +s1 +1 +2 +call f1(); +s1 +1 +2 +s1 +1 +2 +s1 +1 +2 +call f3(); +s1 +1 +2 +s1 +1 +call f3(); +s1 +1 +2 +s1 +1 +call f1(); +s1 +1 +2 +s1 +1 +2 +s1 +1 +2 drop procedure f1; +drop procedure f2; +drop procedure f3; +drop procedure f4; drop table t1; set GLOBAL query_cache_size=0; diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 17a2050437f..05b6a2788ea 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -692,6 +692,7 @@ END P1| call SP001(); TEMP_SUM 0 +ERROR 24000: Cursor is not open drop procedure SP001; drop table t1, t2; drop function if exists bug11394| diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 9742c029706..e52ec950c8c 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -2286,5 +2286,15 @@ SELECT v1.a FROM v1 GROUP BY v1.a HAVING v1.a > 1; a 2 3 +SELECT t_1.a FROM t1 AS t_1 GROUP BY t_1.a HAVING t_1.a IN (1,2,3); +a +1 +2 +3 +SELECT v_1.a FROM v1 AS v_1 GROUP BY v_1.a HAVING v_1.a IN (1,2,3); +a +1 +2 +3 DROP VIEW v1; DROP TABLE t1; diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index 822c27fe40d..c21d6c46b6c 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -776,6 +776,7 @@ delimiter ;// # # query in QC from normal execution and SP (BUG#6897) +# improved to also test BUG#3583 and BUG#12990 # flush query cache; reset query cache; @@ -785,6 +786,22 @@ create table t1 (s1 int)// create procedure f1 () begin select sql_cache * from t1; select sql_cache * from t1; +select sql_cache * from t1; +end;// +create procedure f2 () begin +select sql_cache * from t1 where s1=1; +select sql_cache * from t1; +end;// +create procedure f3 () begin +select sql_cache * from t1; +select sql_cache * from t1 where s1=1; +end;// +create procedure f4 () begin +select sql_cache * from t1; +select sql_cache * from t1 where s1=1; +select sql_cache * from t1; +select sql_cache * from t1 where s1=1; +select sql_cache * from t1 where s1=1; end;// delimiter ;// call f1(); @@ -811,7 +828,32 @@ select sql_cache * from t1; show status like "Qcache_queries_in_cache"; show status like "Qcache_inserts"; show status like "Qcache_hits"; +flush query cache; +reset query cache; +flush status; +select sql_cache * from t1; +select sql_cache * from t1 where s1=1; +call f1(); +call f2(); +call f3(); +call f4(); +call f4(); +call f3(); +call f2(); +select sql_cache * from t1 where s1=1; +insert into t1 values (2); +call f1(); +select sql_cache * from t1 where s1=1; +select sql_cache * from t1; +call f1(); +call f3(); +call f3(); +call f1(); + drop procedure f1; +drop procedure f2; +drop procedure f3; +drop procedure f4; drop table t1; set GLOBAL query_cache_size=0; diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index 40f59f3f124..fa74c318db3 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -991,6 +991,7 @@ P1: BEGIN SELECT 'end of proc'; END P1| delimiter ;| +--error 1326 call SP001(); drop procedure SP001; drop table t1, t2; @@ -1187,7 +1188,30 @@ delimiter ;| create trigger bug12712 before insert on t1 for each row set session autocommit = 0; - +# +# BUG#9367: Stored procedures: client hang after "show warnings" +# +--disable_parsing +--disable_warnings +drop procedure if exists bug9367; +--enable_warnings +create table t1 (s1 int); +select s1 from t1; +delimiter |; +create procedure bug9367() +begin + declare v int; + declare c cursor for select s1 from t1; + open c; + show warnings; + fetch c into v; + select v; +end| +delimiter ;| +call bug9367(); +drop procedure bug9367; +drop table t1; +--enable_parsing # # BUG#NNNN: New bug synopsis # diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 8d3593162c7..15c8cccf69c 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -2162,6 +2162,8 @@ INSERT INTO t1 VALUES (1,1),(2,2),(3,3); CREATE VIEW v1 AS SELECT a,b FROM t1; SELECT t1.a FROM t1 GROUP BY t1.a HAVING t1.a > 1; SELECT v1.a FROM v1 GROUP BY v1.a HAVING v1.a > 1; +SELECT t_1.a FROM t1 AS t_1 GROUP BY t_1.a HAVING t_1.a IN (1,2,3); +SELECT v_1.a FROM v1 AS v_1 GROUP BY v_1.a HAVING v_1.a IN (1,2,3); DROP VIEW v1; DROP TABLE t1; |