From 9d85b0a61673eea742c0fa84c9bafb5cc620e4fd Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 Dec 2006 19:05:35 +0400 Subject: BUG#21310 - Trees in SQL causing a "crashed" table with MyISAM storage engine An update that used a join of a table to itself and modified the table on one side of the join reported the table as crashed or updated wrong rows. Fixed by creating temporary table for self-joined multi update statement. mysql-test/r/myisam.result: A test case for BUG#21310. mysql-test/t/myisam.test: A test case for BUG#21310. sql/lock.cc: Exclude 'table' param from check. sql/sql_update.cc: Disabling record cache for self-joined multi update statement is wrong. The join must only see the table as it was at the beginning of the statement. safe_update_on_fly check if it is safe to update first table on the fly, that is not creating temporary table. It is possible in case a row from this table is never read more than once. safe_update_on_fly now detect self-joined table and refuse to update this table on the fly. --- mysql-test/t/myisam.test | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'mysql-test/t/myisam.test') diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 745e3a2e377..7868e7bad4e 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -890,4 +890,23 @@ connection default; select * from t1; drop table t1; +# +# BUG#21310 - Trees in SQL causing a "crashed" table with MyISAM storage +# engine +# + +# A simplified test case that reflect crashed table issue. +CREATE TABLE t1(a VARCHAR(16)); +INSERT INTO t1 VALUES('aaaaaaaa'),(NULL); +UPDATE t1 AS ta1, t1 AS ta2 SET ta1.a='aaaaaaaaaaaaaaaa'; +SELECT * FROM t1; +DROP TABLE t1; + +# A test case that reflect wrong result set. +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES(1),(2); +UPDATE t1,t1 AS t2 SET t1.a=t1.a+2 WHERE t1.a=t2.a-1; +SELECT * FROM t1 ORDER BY a; +DROP TABLE t1; + # End of 4.1 tests -- cgit v1.2.1 From 422d6b357f90d404f58bdd4444c048a760f0d9f8 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Jan 2007 10:26:51 +0100 Subject: Bug#24607 - MyISAM pointer size determined incorrectly The function mi_get_pointer_length() computed too small pointer size for very large tables. Inserted missing 'else' between the branches for very large tables. myisam/mi_create.c: Bug#24607 - MyISAM pointer size determined incorrectly Inserted missing 'else' between the branches for very large tables. Harmonized literals "(longlong) 1" and "1L" to "ULL(1)" where they are used for "ulonglong file_length". mysql-test/r/myisam.result: Bug#24607 - MyISAM pointer size determined incorrectly Added the test result. mysql-test/t/myisam.test: Bug#24607 - MyISAM pointer size determined incorrectly Added the test. --- mysql-test/t/myisam.test | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mysql-test/t/myisam.test') diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 7868e7bad4e..d065d2e3ebf 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -909,4 +909,12 @@ UPDATE t1,t1 AS t2 SET t1.a=t1.a+2 WHERE t1.a=t2.a-1; SELECT * FROM t1 ORDER BY a; DROP TABLE t1; +# +# Bug#24607 - MyISAM pointer size determined incorrectly +# +CREATE TABLE t1 (c1 TEXT) AVG_ROW_LENGTH=70100 MAX_ROWS=5100100100; +--replace_column 5 X 6 X 7 X 9 X 10 X 11 X 12 X 13 X 14 X 16 X +SHOW TABLE STATUS LIKE 't1'; +DROP TABLE t1; + # End of 4.1 tests -- cgit v1.2.1 From 1ce535c6abe4681a9161de073acae340667f38f3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 17 Jan 2007 11:27:33 +0100 Subject: Cset exclude: msvensson@neptunus.(none)|ChangeSet|20060825084614|09755 mysql-test/r/myisam.result: Exclude mysql-test/t/myisam.test: Exclude --- mysql-test/t/myisam.test | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'mysql-test/t/myisam.test') diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 7868e7bad4e..22f5bf18c0d 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -861,20 +861,14 @@ connect (session2,localhost,root,,); connection session1; disable_query_log; -eval create temporary table t1 (a int) engine=myisam data directory="$MYSQL_TEST_DIR/var/log" select 9 a; +eval create temporary table t1 (a int) engine=myisam data directory="$MYSQL_TEST_DIR/var/tmp" select 9 a; enable_query_log; -# If running test suite with a non standard tmp dir, the "show create table" -# will print "DATA_DIRECTORY=". Use replace_result to mask it out ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR show create table t1; connection session2; disable_query_log; -eval create temporary table t1 (a int) engine=myisam data directory="$MYSQL_TEST_DIR/var/log" select 99 a; +eval create temporary table t1 (a int) engine=myisam data directory="$MYSQL_TEST_DIR/var/tmp" select 99 a; enable_query_log; -# If running test suite with a non standard tmp dir, the "show create table" -# will print "DATA_DIRECTORY=". Use replace_result to mask it out ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR show create table t1; connection default; -- cgit v1.2.1 From eb179ebefc74dae6af544b109e085ad00f5f61fe Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 17 Jan 2007 12:12:24 +0100 Subject: Cset exclude: msvensson@pilot.mysql.com|ChangeSet|20070117102733|42618 mysql-test/r/myisam.result: Exclude mysql-test/t/myisam.test: Exclude --- mysql-test/t/myisam.test | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'mysql-test/t/myisam.test') diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 22f5bf18c0d..7868e7bad4e 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -861,14 +861,20 @@ connect (session2,localhost,root,,); connection session1; disable_query_log; -eval create temporary table t1 (a int) engine=myisam data directory="$MYSQL_TEST_DIR/var/tmp" select 9 a; +eval create temporary table t1 (a int) engine=myisam data directory="$MYSQL_TEST_DIR/var/log" select 9 a; enable_query_log; +# If running test suite with a non standard tmp dir, the "show create table" +# will print "DATA_DIRECTORY=". Use replace_result to mask it out +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR show create table t1; connection session2; disable_query_log; -eval create temporary table t1 (a int) engine=myisam data directory="$MYSQL_TEST_DIR/var/tmp" select 99 a; +eval create temporary table t1 (a int) engine=myisam data directory="$MYSQL_TEST_DIR/var/log" select 99 a; enable_query_log; +# If running test suite with a non standard tmp dir, the "show create table" +# will print "DATA_DIRECTORY=". Use replace_result to mask it out +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR show create table t1; connection default; -- cgit v1.2.1 From f509e774bc5e593418f84b70d315b9d4a798eb12 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 17 Jan 2007 12:22:00 +0100 Subject: Bug#21122 SHOW CREATE TABLE: directory output only sometimes Bug #25000 myisam.test fails on 'pb-valgrind-*' Valgrind - Move tests that need symlink to symlink.test mysql-test/r/myisam.result: - Move tests that need symlink to symlink.test mysql-test/r/symlink.result: - Move tests that need symlink to symlink.test mysql-test/t/myisam.test: - Move tests that need symlink to symlink.test mysql-test/t/symlink.test: - Move tests that need symlink to symlink.test --- mysql-test/t/myisam.test | 35 ----------------------------------- 1 file changed, 35 deletions(-) (limited to 'mysql-test/t/myisam.test') diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 7868e7bad4e..01e7a08ae53 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -854,41 +854,6 @@ DROP TABLE t1; # SET @@myisam_repair_threads=1; SHOW VARIABLES LIKE 'myisam_repair%'; -# Bug#8706 - temporary table with data directory option fails -# -connect (session1,localhost,root,,); -connect (session2,localhost,root,,); - -connection session1; -disable_query_log; -eval create temporary table t1 (a int) engine=myisam data directory="$MYSQL_TEST_DIR/var/log" select 9 a; -enable_query_log; -# If running test suite with a non standard tmp dir, the "show create table" -# will print "DATA_DIRECTORY=". Use replace_result to mask it out ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR -show create table t1; - -connection session2; -disable_query_log; -eval create temporary table t1 (a int) engine=myisam data directory="$MYSQL_TEST_DIR/var/log" select 99 a; -enable_query_log; -# If running test suite with a non standard tmp dir, the "show create table" -# will print "DATA_DIRECTORY=". Use replace_result to mask it out ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR -show create table t1; - -connection default; -create table t1 (a int) engine=myisam select 42 a; - -connection session1; -select * from t1; -disconnect session1; -connection session2; -select * from t1; -disconnect session2; -connection default; -select * from t1; -drop table t1; # # BUG#21310 - Trees in SQL causing a "crashed" table with MyISAM storage -- cgit v1.2.1 From 5e0fd916f1fa72cd2cc4126669ad1772a77e055d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Jan 2007 11:53:09 +0400 Subject: After merge fix. --- mysql-test/t/myisam.test | 34 ---------------------------------- 1 file changed, 34 deletions(-) (limited to 'mysql-test/t/myisam.test') diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 040ab3fce09..3189a59333b 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -969,40 +969,6 @@ create table t3 (c1 int) engine=myisam pack_keys=default; --error 1064 create table t4 (c1 int) engine=myisam pack_keys=2; drop table t1, t2, t3; -# -# Bug#8706 - temporary table with data directory option fails -# -connect (session1,localhost,root,,); -connect (session2,localhost,root,,); - -connection session1; -disable_query_log; -eval create temporary table t1 (a int) engine=myisam data directory="$MYSQLTEST_VARDIR/tmp" select 9 a; -enable_query_log; -disable_result_log; -show create table t1; -enable_result_log; - -connection session2; -disable_query_log; -eval create temporary table t1 (a int) engine=myisam data directory="$MYSQLTEST_VARDIR/tmp" select 99 a; -enable_query_log; -disable_result_log; -show create table t1; -enable_result_log; - -connection default; -create table t1 (a int) engine=myisam select 42 a; - -connection session1; -select * from t1; -disconnect session1; -connection session2; -select * from t1; -disconnect session2; -connection default; -select * from t1; -drop table t1; # # BUG#21310 - Trees in SQL causing a "crashed" table with MyISAM storage -- cgit v1.2.1 From 112ef50f287026d41fc509aabdc87fc65d40d7a4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Jan 2007 13:17:01 +0100 Subject: Bug#24607 - MyISAM pointer size determined incorrectly Fixed test. On 32-bit machines which compile without -DBIG_TABLES, MAX_ROWS is truncated to a 32-bit value. Using a value below 4G is portable. mysql-test/r/myisam.result: Bug#24607 - MyISAM pointer size determined incorrectly Fixed test results. --- mysql-test/t/myisam.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test/t/myisam.test') diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 0aeb49b0e99..0abe0a25f44 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -877,7 +877,7 @@ DROP TABLE t1; # # Bug#24607 - MyISAM pointer size determined incorrectly # -CREATE TABLE t1 (c1 TEXT) AVG_ROW_LENGTH=70100 MAX_ROWS=5100100100; +CREATE TABLE t1 (c1 TEXT) AVG_ROW_LENGTH=70100 MAX_ROWS=4100100100; --replace_column 5 X 6 X 7 X 9 X 10 X 11 X 12 X 13 X 14 X 16 X SHOW TABLE STATUS LIKE 't1'; DROP TABLE t1; -- cgit v1.2.1