diff options
author | holyfoot@mysql.com <> | 2005-11-03 19:47:08 +0400 |
---|---|---|
committer | holyfoot@mysql.com <> | 2005-11-03 19:47:08 +0400 |
commit | a8b38c1d5a5fae96c9ae37ad0c7692122aa85f23 (patch) | |
tree | 2624ee5e086ad583e1a69852120259666aa11652 /mysql-test | |
parent | bac54a77749b677d42688fc8d7284b7a6877f90f (diff) | |
parent | e92452c8ed4ac795e23a2f95d46fd50f6799be14 (diff) | |
download | mariadb-git-a8b38c1d5a5fae96c9ae37ad0c7692122aa85f23.tar.gz |
Merge bk@192.168.21.1:/usr/home/bk/mysql-5.0
into mysql.com:/home/hf/work/mysql-5.0.9551
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/sp.result | 42 | ||||
-rw-r--r-- | mysql-test/t/sp.test | 52 |
2 files changed, 94 insertions, 0 deletions
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 1f3f7dba7da..d50e6dd3751 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -3575,4 +3575,46 @@ DROP VIEW bug13095_v1 DROP PROCEDURE IF EXISTS bug13095; DROP VIEW IF EXISTS bug13095_v1; DROP TABLE IF EXISTS bug13095_t1; +drop procedure if exists bug14210| +set @@session.max_heap_table_size=16384| +select @@session.max_heap_table_size| +@@session.max_heap_table_size +16384 +create table t3 (a char(255)) engine=InnoDB| +create procedure bug14210_fill_table() +begin +declare table_size, max_table_size int default 0; +select @@session.max_heap_table_size into max_table_size; +delete from t3; +insert into t3 (a) values (repeat('a', 255)); +repeat +insert into t3 select a from t3; +select count(*)*255 from t3 into table_size; +until table_size > max_table_size*2 end repeat; +end| +call bug14210_fill_table()| +drop procedure bug14210_fill_table| +create table t4 like t3| +create procedure bug14210() +begin +declare a char(255); +declare done int default 0; +declare c cursor for select * from t3; +declare continue handler for sqlstate '02000' set done = 1; +open c; +repeat +fetch c into a; +if not done then +insert into t4 values (upper(a)); +end if; +until done end repeat; +close c; +end| +call bug14210()| +select count(*) from t4| +count(*) +256 +drop table t3, t4| +drop procedure bug14210| +set @@session.max_heap_table_size=default| drop table t1,t2; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index ab57139bb77..eaf69c0ab03 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -4488,6 +4488,58 @@ DROP TABLE IF EXISTS bug13095_t1; delimiter |; +# +# BUG#14210: "Simple query with > operator on large table gives server +# crash" +# Check that cursors work in case when HEAP tables are converted to +# MyISAM +# +--disable_warnings +drop procedure if exists bug14210| +--enable_warnings +set @@session.max_heap_table_size=16384| +select @@session.max_heap_table_size| +# To trigger the memory corruption the original table must be InnoDB. +# No harm if it's not, so don't warn if the suite is run with --skip-innodb +--disable_warnings +create table t3 (a char(255)) engine=InnoDB| +--enable_warnings +create procedure bug14210_fill_table() +begin + declare table_size, max_table_size int default 0; + select @@session.max_heap_table_size into max_table_size; + delete from t3; + insert into t3 (a) values (repeat('a', 255)); + repeat + insert into t3 select a from t3; + select count(*)*255 from t3 into table_size; + until table_size > max_table_size*2 end repeat; +end| +call bug14210_fill_table()| +drop procedure bug14210_fill_table| +create table t4 like t3| + +create procedure bug14210() +begin + declare a char(255); + declare done int default 0; + declare c cursor for select * from t3; + declare continue handler for sqlstate '02000' set done = 1; + open c; + repeat + fetch c into a; + if not done then + insert into t4 values (upper(a)); + end if; + until done end repeat; + close c; +end| +call bug14210()| +select count(*) from t4| + +drop table t3, t4| +drop procedure bug14210| +set @@session.max_heap_table_size=default| # # BUG#NNNN: New bug synopsis |