From 5454f676ff4cd8a2f6ec577e35746dd18b31478f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Dec 2003 17:55:34 -0400 Subject: fixed restoring of thd->count_cuted_fields in store_val_in_field (fixed #bug 2012) mysql-test/r/insert_select.result: added test case for bug #2012 mysql-test/t/insert_select.test: added test case for bug #2012 --- mysql-test/r/insert_select.result | 12 ++++++++++++ mysql-test/t/insert_select.test | 31 +++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result index c754085ccb3..2435e28d7fe 100644 --- a/mysql-test/r/insert_select.result +++ b/mysql-test/r/insert_select.result @@ -11,3 +11,15 @@ payoutID 19 20 22 +Month Type Field Count +2003-09-01 1 1 100 +2003-09-01 1 2 100 +2003-09-01 2 1 100 +2003-09-01 2 2 100 +2003-09-01 3 1 100 +NULL Field Count +NULL 1 100 +NULL 2 100 +No Field Count +0 1 100 +0 2 100 diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test index 17ecb2d5a1f..625f4755a79 100644 --- a/mysql-test/t/insert_select.test +++ b/mysql-test/t/insert_select.test @@ -10,3 +10,34 @@ insert into t2 (payoutID) SELECT DISTINCT payoutID FROM t1; insert into t2 (payoutID) SELECT payoutID+10 FROM t1; select * from t2; drop table t1,t2; + +# +# Another problem from Bug #2012 +# + +CREATE TABLE t1( + Month date NOT NULL, + Type tinyint(3) unsigned NOT NULL auto_increment, + Field int(10) unsigned NOT NULL, + Count int(10) unsigned NOT NULL, + UNIQUE KEY Month (Month,Type,Field) +); + +insert into t1 Values +(20030901, 1, 1, 100), +(20030901, 1, 2, 100), +(20030901, 2, 1, 100), +(20030901, 2, 2, 100), +(20030901, 3, 1, 100); + +select * from t1; + +Select null, Field, Count From t1 Where Month=20030901 and Type=2; + +create table t2(No int not null, Field int not null, Count int not null); + +insert into t2 Select null, Field, Count From t1 Where Month=20030901 and Type=2; + +select * from t2; + +drop table t1, t2; -- cgit v1.2.1 From d6be93aa27becf6864b15a699cf62c394620355e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 17 Dec 2003 16:37:47 -0400 Subject: added error message for receiving variable with wrong GLOBAL|LOCAL type (bug #2086) include/mysqld_error.h: added error message for receiving variable with wrong GLOBAL|LOCAL type mysql-test/r/variables.result: added error message for receiving variable with wrong GLOBAL|LOCAL type mysql-test/t/variables.test: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/set_var.cc: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/share/czech/errmsg.txt: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/share/danish/errmsg.txt: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/share/dutch/errmsg.txt: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/share/english/errmsg.txt: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/share/estonian/errmsg.txt: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/share/french/errmsg.txt: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/share/german/errmsg.txt: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/share/greek/errmsg.txt: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/share/hungarian/errmsg.txt: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/share/italian/errmsg.txt: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/share/japanese/errmsg.txt: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/share/korean/errmsg.txt: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/share/norwegian-ny/errmsg.txt: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/share/norwegian/errmsg.txt: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/share/polish/errmsg.txt: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/share/portuguese/errmsg.txt: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/share/romanian/errmsg.txt: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/share/russian/errmsg.txt: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/share/slovak/errmsg.txt: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/share/spanish/errmsg.txt: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/share/swedish/errmsg.txt: added error message for receiving variable with wrong GLOBAL|LOCAL type sql/share/ukrainian/errmsg.txt: added error message for receiving variable with wrong GLOBAL|LOCAL type --- mysql-test/r/variables.result | 6 ++++-- mysql-test/t/variables.test | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 8afdced206b..b4a607cb174 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -231,7 +231,7 @@ Wrong argument type to variable 'convert_character_set' set global autocommit=1; Variable 'autocommit' is a LOCAL variable and can't be used with SET GLOBAL select @@global.timestamp; -Variable 'timestamp' is a LOCAL variable and can't be used with SET GLOBAL +Variable 'timestamp' is a LOCAL variable set @@version=''; Unknown system variable 'version' set @@concurrent_insert=1; @@ -239,7 +239,7 @@ Variable 'concurrent_insert' is a GLOBAL variable and should be set with SET GLO set @@global.sql_auto_is_null=1; Variable 'sql_auto_is_null' is a LOCAL variable and can't be used with SET GLOBAL select @@global.sql_auto_is_null; -Variable 'sql_auto_is_null' is a LOCAL variable and can't be used with SET GLOBAL +Variable 'sql_auto_is_null' is a LOCAL variable set myisam_max_sort_file_size=100; Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL set myisam_max_extra_sort_file_size=100; @@ -375,3 +375,5 @@ Unknown system variable 'xxxxxxxxxx' select 1; 1 1 +select @@session.key_buffer_size; +Variable 'key_buffer_size' is a GLOBAL variable diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 8e38160c60b..ec86a763023 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -139,7 +139,7 @@ set character set unknown; set character set 0; --error 1228 set global autocommit=1; ---error 1228 +--error 1238 select @@global.timestamp; --error 1193 set @@version=''; @@ -147,7 +147,7 @@ set @@version=''; set @@concurrent_insert=1; --error 1228 set @@global.sql_auto_is_null=1; ---error 1228 +--error 1238 select @@global.sql_auto_is_null; --error 1229 set myisam_max_sort_file_size=100; @@ -266,3 +266,6 @@ drop table t1,t2; --error 1193 select @@xxxxxxxxxx; select 1; + +--error 1238 +select @@session.key_buffer_size; \ No newline at end of file -- cgit v1.2.1 From 376fb08072e00c6be932b5c38ff6e23288e81e50 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Dec 2003 13:14:21 +0200 Subject: Some small portability fixes. Added support for lower_case_table_names=2, which is to be used on case insensitive file systems. This tells MySQL to preserve the used case of filenames and database names to make it esier to move files between cases sensitive can case insensitive file systems (like Windows and Linux) client/mysqltest.c: Indentation cleanup include/myisam.h: Made some pointers 'const' mysql-test/mysql-test-run.sh: Portability fix for OSX sql/filesort.cc: Safety fix (not needed for current code but needed for 5.0) sql/ha_berkeley.cc: More debugging Changed 'create' to return error number sql/ha_berkeley.h: Added HA_FILE_BASED sql/ha_innodb.cc: Added missing DBUG_RETURN sql/ha_isam.cc: Changed create to return error number sql/ha_isam.h: Added HA_FILE_BASED sql/ha_isammrg.h: Added HA_FILE_BASED sql/ha_myisam.cc: Changed create to return error number sql/ha_myisam.h: Added HA_FILE_BASED sql/ha_myisammrg.cc: Changed create to return error number sql/ha_myisammrg.h: Added HA_FILE_BASED sql/handler.cc: Ensure that table engines gets table names in lower case even if we are using lower_case_table_names Removed test for DB_TYPE_INNODB by ensuring that create method returns error number. sql/handler.h: Added HA_FILE_BASED Made some struct entries 'const' Added 'alias' for create to be able to create tables in mixed case on case insensitive file systems sql/mysql_priv.h: Support for lower_case_table_names=2 sql/mysqld.cc: Support for lower_case_table_names=2 Moved test of case insenstive file system after all mutex are created sql/set_var.cc: Support for lower_case_table_names=2 sql/sql_class.h: Indentation change sql/sql_db.cc: Support for lower_case_table_names=2 sql/sql_insert.cc: Indentation change sql/sql_parse.cc: Support for lower_case_table_names=2 sql/sql_rename.cc: Support for lower_case_table_names=2 Added missing 'unpack_filename' to RENAME which may fix a bug in RENAME TABLE on windows sql/sql_show.cc: If lower_case_table_name=2 is given, show original case in SHOW CREATE TABLE sql/sql_table.cc: Support for lower_case_table_names=2 for DROP TABLE, RENAME TABLE, ALTER TABLE and CREATE TABLE --- mysql-test/mysql-test-run.sh | 3 +- mysql-test/r/lowercase2.require | 2 + mysql-test/r/lowercase_table2.result | 108 +++++++++++++++++++++++++++++++ mysql-test/t/lowercase_table2-master.opt | 1 + mysql-test/t/lowercase_table2.test | 80 +++++++++++++++++++++++ 5 files changed, 193 insertions(+), 1 deletion(-) create mode 100644 mysql-test/r/lowercase2.require create mode 100644 mysql-test/r/lowercase_table2.result create mode 100644 mysql-test/t/lowercase_table2-master.opt create mode 100644 mysql-test/t/lowercase_table2.test (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index a298701dc7f..5b39b167d7d 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -182,7 +182,8 @@ MY_LOG_DIR="$MYSQL_TEST_DIR/var/log" # Set LD_LIBRARY_PATH if we are using shared libraries # LD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$LD_LIBRARY_PATH" -export LD_LIBRARY_PATH +DYLD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$DYLD_LIBRARY_PATH" +export LD_LIBRARY_PATH DYLD_LIBRARY_PATH MASTER_RUNNING=0 MASTER_MYPORT=9306 diff --git a/mysql-test/r/lowercase2.require b/mysql-test/r/lowercase2.require new file mode 100644 index 00000000000..522eac63e81 --- /dev/null +++ b/mysql-test/r/lowercase2.require @@ -0,0 +1,2 @@ +Variable_name Value +lower_case_table_names 2 diff --git a/mysql-test/r/lowercase_table2.result b/mysql-test/r/lowercase_table2.result new file mode 100644 index 00000000000..e582978c126 --- /dev/null +++ b/mysql-test/r/lowercase_table2.result @@ -0,0 +1,108 @@ +DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3; +DROP DATABASE IF EXISTS `TEST_$1`; +DROP DATABASE IF EXISTS `test_$1`; +CREATE TABLE T1 (a int); +INSERT INTO T1 VALUES (1); +SHOW TABLES LIKE "T1"; +Tables_in_test (T1) +T1 +SHOW TABLES LIKE "t1"; +Tables_in_test (t1) +T1 +SHOW CREATE TABLE T1; +Table Create Table +T1 CREATE TABLE `T1` ( + `a` int(11) default NULL +) TYPE=MyISAM +RENAME TABLE T1 TO T2; +SHOW TABLES LIKE "T2"; +Tables_in_test (T2) +T2 +SELECT * FROM t2; +a +1 +RENAME TABLE T2 TO t3; +SHOW TABLES LIKE "T3"; +Tables_in_test (T3) +t3 +RENAME TABLE T3 TO T1; +SHOW TABLES LIKE "T1"; +Tables_in_test (T1) +T1 +ALTER TABLE T1 add b int; +SHOW TABLES LIKE "T1"; +Tables_in_test (T1) +t1 +ALTER TABLE T1 RENAME T2; +SHOW TABLES LIKE "T2"; +Tables_in_test (T2) +T2 +LOCK TABLE T2 WRITE; +ALTER TABLE T2 drop b; +SHOW TABLES LIKE "T2"; +Tables_in_test (T2) +t2 +UNLOCK TABLES; +RENAME TABLE T2 TO T1; +SHOW TABLES LIKE "T1"; +Tables_in_test (T1) +T1 +SELECT * from T1; +a +1 +DROP TABLE T1; +CREATE DATABASE `TEST_$1`; +SHOW DATABASES LIKE "TEST%"; +Database (TEST%) +TEST_$1 +DROP DATABASE `test_$1`; +CREATE TABLE T1 (a int) engine=innodb; +INSERT INTO T1 VALUES (1); +SHOW TABLES LIKE "T1"; +Tables_in_test (T1) +T1 +SHOW TABLES LIKE "t1"; +Tables_in_test (t1) +T1 +SHOW CREATE TABLE T1; +Table Create Table +T1 CREATE TABLE `T1` ( + `a` int(11) default NULL +) TYPE=InnoDB +RENAME TABLE T1 TO T2; +SHOW TABLES LIKE "T2"; +Tables_in_test (T2) +t2 +SELECT * FROM t2; +a +1 +RENAME TABLE T2 TO t3; +SHOW TABLES LIKE "T3"; +Tables_in_test (T3) +t3 +RENAME TABLE T3 TO T1; +SHOW TABLES LIKE "T1"; +Tables_in_test (T1) +t1 +ALTER TABLE T1 add b int; +SHOW TABLES LIKE "T1"; +Tables_in_test (T1) +t1 +ALTER TABLE T1 RENAME T2; +SHOW TABLES LIKE "T2"; +Tables_in_test (T2) +t2 +LOCK TABLE T2 WRITE; +ALTER TABLE T2 drop b; +SHOW TABLES LIKE "T2"; +Tables_in_test (T2) +t2 +UNLOCK TABLES; +RENAME TABLE T2 TO T1; +SHOW TABLES LIKE "T1"; +Tables_in_test (T1) +t1 +SELECT * from T1; +a +1 +DROP TABLE T1; diff --git a/mysql-test/t/lowercase_table2-master.opt b/mysql-test/t/lowercase_table2-master.opt new file mode 100644 index 00000000000..9b27aef9bf8 --- /dev/null +++ b/mysql-test/t/lowercase_table2-master.opt @@ -0,0 +1 @@ +--lower_case_table_names=0 diff --git a/mysql-test/t/lowercase_table2.test b/mysql-test/t/lowercase_table2.test new file mode 100644 index 00000000000..86bb26f0cf9 --- /dev/null +++ b/mysql-test/t/lowercase_table2.test @@ -0,0 +1,80 @@ +# +# Test of --lower-case-table-names=2 +# (User has case insensitive file system and want's to preserve case of +# table names) +# +--source include/have_innodb.inc +--require r/lowercase2.require +disable_query_log; +show variables like "lower_case_table_names"; +enable_query_log; + +--disable_warnings +DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3; +DROP DATABASE IF EXISTS `TEST_$1`; +DROP DATABASE IF EXISTS `test_$1`; +--enable_warnings + +CREATE TABLE T1 (a int); +INSERT INTO T1 VALUES (1); +SHOW TABLES LIKE "T1"; +SHOW TABLES LIKE "t1"; +SHOW CREATE TABLE T1; +RENAME TABLE T1 TO T2; +SHOW TABLES LIKE "T2"; +SELECT * FROM t2; +RENAME TABLE T2 TO t3; +SHOW TABLES LIKE "T3"; +RENAME TABLE T3 TO T1; +SHOW TABLES LIKE "T1"; +ALTER TABLE T1 add b int; +SHOW TABLES LIKE "T1"; +ALTER TABLE T1 RENAME T2; +SHOW TABLES LIKE "T2"; + +LOCK TABLE T2 WRITE; +ALTER TABLE T2 drop b; +SHOW TABLES LIKE "T2"; +UNLOCK TABLES; +RENAME TABLE T2 TO T1; +SHOW TABLES LIKE "T1"; +SELECT * from T1; +DROP TABLE T1; + +# +# Test database level +# + +CREATE DATABASE `TEST_$1`; +SHOW DATABASES LIKE "TEST%"; +DROP DATABASE `test_$1`; + +# +# Test of innodb tables with lower_case_table_names=2 +# + +CREATE TABLE T1 (a int) engine=innodb; +INSERT INTO T1 VALUES (1); +SHOW TABLES LIKE "T1"; +SHOW TABLES LIKE "t1"; +SHOW CREATE TABLE T1; +RENAME TABLE T1 TO T2; +SHOW TABLES LIKE "T2"; +SELECT * FROM t2; +RENAME TABLE T2 TO t3; +SHOW TABLES LIKE "T3"; +RENAME TABLE T3 TO T1; +SHOW TABLES LIKE "T1"; +ALTER TABLE T1 add b int; +SHOW TABLES LIKE "T1"; +ALTER TABLE T1 RENAME T2; +SHOW TABLES LIKE "T2"; + +LOCK TABLE T2 WRITE; +ALTER TABLE T2 drop b; +SHOW TABLES LIKE "T2"; +UNLOCK TABLES; +RENAME TABLE T2 TO T1; +SHOW TABLES LIKE "T1"; +SELECT * from T1; +DROP TABLE T1; -- cgit v1.2.1 From 824111e6c4583441719bd6fa431b6aedcab8fff6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Dec 2003 19:23:38 +0400 Subject: Fix for the bug #2231: string column, INDEX+LIKE, don't take the ESCAPE character. (acctually i don't like the fix, any suggestions?) --- mysql-test/r/func_like.result | 6 ++++++ mysql-test/t/func_like.test | 9 +++++++++ 2 files changed, 15 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_like.result b/mysql-test/r/func_like.result index f923c16b2ac..0f94348a5f8 100644 --- a/mysql-test/r/func_like.result +++ b/mysql-test/r/func_like.result @@ -37,3 +37,9 @@ select * from t1 where a like "%abc\d%"; a abcd drop table t1; +create table t1 (a varchar(10), key(a)); +insert into t1 values ('a'), ('a\\b'); +select * from t1 where a like 'a\\%' escape '#'; +a +a\b +drop table t1; diff --git a/mysql-test/t/func_like.test b/mysql-test/t/func_like.test index a5d1193fd74..1e14c70a76a 100644 --- a/mysql-test/t/func_like.test +++ b/mysql-test/t/func_like.test @@ -21,3 +21,12 @@ select * from t1 where a like "%abcd%"; select * from t1 where a like "%abc\d%"; drop table t1; + +# +# Bug #2231 +# + +create table t1 (a varchar(10), key(a)); +insert into t1 values ('a'), ('a\\b'); +select * from t1 where a like 'a\\%' escape '#'; +drop table t1; -- cgit v1.2.1 From aafca9f08dcf5252fc05eabf9be4f15fe4b65ac2 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Jan 2004 12:24:36 +0400 Subject: An improvement of the fix for the bug #2231: string column, INDEX+LIKE, don't take the ESCAPE character. (ver. 2) --- mysql-test/r/func_like.result | 3 +++ mysql-test/t/func_like.test | 1 + 2 files changed, 4 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_like.result b/mysql-test/r/func_like.result index 0f94348a5f8..b196b50f53b 100644 --- a/mysql-test/r/func_like.result +++ b/mysql-test/r/func_like.result @@ -42,4 +42,7 @@ insert into t1 values ('a'), ('a\\b'); select * from t1 where a like 'a\\%' escape '#'; a a\b +select * from t1 where a like 'a\\%' escape '#' and a like 'a\\\\b'; +a +a\b drop table t1; diff --git a/mysql-test/t/func_like.test b/mysql-test/t/func_like.test index 1e14c70a76a..6d6ee8f86a3 100644 --- a/mysql-test/t/func_like.test +++ b/mysql-test/t/func_like.test @@ -29,4 +29,5 @@ drop table t1; create table t1 (a varchar(10), key(a)); insert into t1 values ('a'), ('a\\b'); select * from t1 where a like 'a\\%' escape '#'; +select * from t1 where a like 'a\\%' escape '#' and a like 'a\\\\b'; drop table t1; -- cgit v1.2.1 From 9d8bf6980ab67940e91425d5bcb6968e630ac8a2 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 11 Jan 2004 14:12:46 +0400 Subject: A fix (bug #2335: Inconsistancy with handling of Years and NOW() function). The test might fail if one runs it at 23:59:59 Dec 31 mysql-test/r/type_year.result: a fix (bug #2335: Inconsistancy with handling of Years and NOW() function) mysql-test/t/type_year.test: a fix (bug #2335: Inconsistancy with handling of Years and NOW() function) sql/field.h: a fix (bug #2335: Inconsistancy with handling of Years and NOW() function) --- mysql-test/r/type_year.result | 6 ++++++ mysql-test/t/type_year.test | 9 +++++++++ 2 files changed, 15 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/type_year.result b/mysql-test/r/type_year.result index 25ddda88f48..5ef3c1bba81 100644 --- a/mysql-test/r/type_year.result +++ b/mysql-test/r/type_year.result @@ -26,3 +26,9 @@ y y2 2001 01 2069 69 drop table t1; +create table t1 (y year); +insert into t1 values (now()); +select if(y = now(), 1, 0) from t1; +if(y = now(), 1, 0) +1 +drop table t1; diff --git a/mysql-test/t/type_year.test b/mysql-test/t/type_year.test index 8f4f23badb4..e9e34dbc29f 100644 --- a/mysql-test/t/type_year.test +++ b/mysql-test/t/type_year.test @@ -8,3 +8,12 @@ select * from t1; select * from t1 order by y; select * from t1 order by y2; drop table t1; + +# +# Bug 2335 +# + +create table t1 (y year); +insert into t1 values (now()); +select if(y = now(), 1, 0) from t1; +drop table t1; -- cgit v1.2.1 From e2ab8558e899716d653d994af1a1e86c54e90bf9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Jan 2004 16:25:13 +0200 Subject: opt_sum.cc: A fix for a bug #3189, pertaining to crashing MySQL server when a query with MIN / MAX on the BLOB column is to be optimised sql/opt_sum.cc: A fix for a bug #3189, pertaining to crashing MySQL server when a query with MIN / MAX on the BLOB column is to be optimised --- mysql-test/r/type_blob.result | 6 ++++++ mysql-test/t/type_blob.test | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index 0bb9146fafc..685301f3639 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -601,3 +601,9 @@ id txt 2 Chevy 4 Ford drop table t1; +CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL, PRIMARY KEY (i), KEY (c(1),c(1))); +INSERT t1 VALUES (1,''),(2,''),(3,'asdfh'),(4,''); +select max(i) from t1 where c = ''; +max(i) +4 +drop table t1; diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test index cf5c0d6e581..928f79a661e 100644 --- a/mysql-test/t/type_blob.test +++ b/mysql-test/t/type_blob.test @@ -312,3 +312,9 @@ select * from t1 where txt <= 'Chevy'; select * from t1 where txt > 'Chevy'; select * from t1 where txt >= 'Chevy'; drop table t1; +CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL, PRIMARY KEY (i), KEY (c(1),c(1))); +INSERT t1 VALUES (1,''),(2,''),(3,'asdfh'),(4,''); +select max(i) from t1 where c = ''; +drop table t1; + + -- cgit v1.2.1 From e1d5f62041deaf97e139e660bc57a0de784f76e6 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Jan 2004 22:47:26 -0400 Subject: Fixed Bug #2338 Trigonometric arithmetic problem by fixing optimizer bug with help of 'volatile' keyword mysql-test/r/func_math.result: added tests for BUG #2338 Trigonometric arithmetic problems mysql-test/t/func_math.test: added tests for BUG #2338 Trigonometric arithmetic problems sql/item_func.cc: added keyword volatile in Item_func_acos::val and Item_func_asin::val to calm optimizer down and to avoid it's bug --- mysql-test/r/func_math.result | 12 ++++++++++++ mysql-test/t/func_math.test | 11 +++++++++++ 2 files changed, 23 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index e2723311682..5e774fe9886 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -20,3 +20,15 @@ PI() sin(pi()/2) cos(pi()/2) abs(tan(pi())) cot(1) asin(1) acos(0) atan(1) 3.141593 1.000000 0.000000 0.000000 0.64209262 1.570796 1.570796 0.785398 degrees(pi()) radians(360) 180 6.2831853071796 +ACOS(1.0) +0.000000 +ASIN(1.0) +1.570796 +ACOS(0.2*5.0) +0.000000 +ACOS(0.5*2.0) +0.000000 +ASIN(0.8+0.2) +1.570796 +ASIN(1.2-0.2) +1.570796 diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index 5299897d0f0..42ba8c73f69 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -13,3 +13,14 @@ select pow(10,log10(10)),power(2,4); select rand(999999),rand(); select pi(),sin(pi()/2),cos(pi()/2),abs(tan(pi())),cot(1),asin(1),acos(0),atan(1); select degrees(pi()),radians(360); + +# +# Bug #2338 Trignometric arithmatic problems +# + +SELECT ACOS(1.0); +SELECT ASIN(1.0); +SELECT ACOS(0.2*5.0); +SELECT ACOS(0.5*2.0); +SELECT ASIN(0.8+0.2); +SELECT ASIN(1.2-0.2); -- cgit v1.2.1 From febc79bb5d8a7cfe1f8e5eef50595f321786c467 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 13 Jan 2004 12:31:25 +0100 Subject: BUG#2304 - HANDLER and tables in non-current db --- mysql-test/r/handler.result | 18 ++++++++++++++++++ mysql-test/t/handler.test | 16 ++++++++++++++++ 2 files changed, 34 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/handler.result b/mysql-test/r/handler.result index 5467ea6dec2..1cfc3a9de8b 100644 --- a/mysql-test/r/handler.result +++ b/mysql-test/r/handler.result @@ -173,3 +173,21 @@ Unknown column 'W' in 'field list' handler t1 read a=(a); Wrong arguments to HANDLER ... READ drop table t1; +create table t1 (a char(5)); +insert into t1 values ("Ok"); +handler t1 open as t; +handler t read first; +a +Ok +use mysql; +handler t read first; +a +Ok +handler t close; +handler test.t1 open as t; +handler t read first; +a +Ok +handler t close; +use test; +drop table t1; diff --git a/mysql-test/t/handler.test b/mysql-test/t/handler.test index 736091a52a9..936902fd9bf 100644 --- a/mysql-test/t/handler.test +++ b/mysql-test/t/handler.test @@ -107,3 +107,19 @@ handler t1 read a=(W); handler t1 read a=(a); drop table t1; +# +# BUG#2304 +# +create table t1 (a char(5)); +insert into t1 values ("Ok"); +handler t1 open as t; +handler t read first; +use mysql; +handler t read first; +handler t close; +handler test.t1 open as t; +handler t read first; +handler t close; +use test; +drop table t1; + -- cgit v1.2.1 From ae4b94598c08747fcb75480ebe7ab2681f38bde6 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Jan 2004 16:31:27 +0100 Subject: an obvious bug in _mi_key_cmp fixed (BUG#2295 - range on blobs) --- mysql-test/r/range.result | 8 ++++++++ mysql-test/t/range.test | 12 ++++++++++++ 2 files changed, 20 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index e87df9a6c24..45d20a8fced 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -300,3 +300,11 @@ SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1); COUNT(*) 6 DROP TABLE t1; +create table t1(a text not null, b text not null, c text not null, index (a(10),b(10),c(10))); +insert into t1 values('807780', '477', '165'); +insert into t1 values('807780', '477', '162'); +insert into t1 values('807780', '472', '162'); +select * from t1 where a='807780' and b='477' and c='165'; +a b c +807780 477 165 +drop table t1; diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 364ea2d4195..9d9feaa4edc 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -248,3 +248,15 @@ INSERT INTO t1 VALUES (0,1,0),(0,1,0),(0,1,0); SELECT COUNT(*) FROM t1 WHERE (c=0 and a=1) or (c=0 and b=1); SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1); DROP TABLE t1; + +# +# BUG#2295 - range on blob +# + +create table t1(a text not null, b text not null, c text not null, index (a(10),b(10),c(10))); +insert into t1 values('807780', '477', '165'); +insert into t1 values('807780', '477', '162'); +insert into t1 values('807780', '472', '162'); +select * from t1 where a='807780' and b='477' and c='165'; +drop table t1; + -- cgit v1.2.1 From 130ae28ccac7c482861f85bc3009b52283364f2a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Jan 2004 21:39:56 +0100 Subject: Fixed table crash bug when updating row > 16M (Bug #2159) myisam/mi_dynrec.c: Fixed table crash bug when updating row > 16M --- mysql-test/r/myisam-blob.result | 27 +++++++++++++++++++++++++++ mysql-test/t/myisam-blob-master.opt | 1 + mysql-test/t/myisam-blob.test | 30 ++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 mysql-test/r/myisam-blob.result create mode 100644 mysql-test/t/myisam-blob-master.opt create mode 100644 mysql-test/t/myisam-blob.test (limited to 'mysql-test') diff --git a/mysql-test/r/myisam-blob.result b/mysql-test/r/myisam-blob.result new file mode 100644 index 00000000000..743d4dac254 --- /dev/null +++ b/mysql-test/r/myisam-blob.result @@ -0,0 +1,27 @@ +drop table if exists t1; +CREATE TABLE t1 (data LONGBLOB) ENGINE=myisam; +INSERT INTO t1 (data) VALUES (NULL); +UPDATE t1 set data=repeat('a',18*1024*1024); +select length(data) from t1; +length(data) +18874368 +delete from t1 where left(data,1)='a'; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +truncate table t1; +INSERT INTO t1 (data) VALUES (repeat('a',1*1024*1024)); +INSERT INTO t1 (data) VALUES (repeat('b',16*1024*1024-1024)); +delete from t1 where left(data,1)='b'; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +UPDATE t1 set data=repeat('c',17*1024*1024); +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +delete from t1 where left(data,1)='c'; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; diff --git a/mysql-test/t/myisam-blob-master.opt b/mysql-test/t/myisam-blob-master.opt new file mode 100644 index 00000000000..1a1076c7bad --- /dev/null +++ b/mysql-test/t/myisam-blob-master.opt @@ -0,0 +1 @@ +--max-allowed-packet=24M --skip-innodb --key-buffer-size=1M diff --git a/mysql-test/t/myisam-blob.test b/mysql-test/t/myisam-blob.test new file mode 100644 index 00000000000..d58222ec8bf --- /dev/null +++ b/mysql-test/t/myisam-blob.test @@ -0,0 +1,30 @@ +# +# Test bugs in the MyISAM code with blobs +# + +--disable_warnings +drop table if exists t1; +--enable_warnings + +# Bug #2159 (Problem with update of blob to > 16M) + +CREATE TABLE t1 (data LONGBLOB) ENGINE=myisam; +INSERT INTO t1 (data) VALUES (NULL); +UPDATE t1 set data=repeat('a',18*1024*1024); +select length(data) from t1; +delete from t1 where left(data,1)='a'; +check table t1; +truncate table t1; +INSERT INTO t1 (data) VALUES (repeat('a',1*1024*1024)); +INSERT INTO t1 (data) VALUES (repeat('b',16*1024*1024-1024)); +delete from t1 where left(data,1)='b'; +check table t1; + +# now we have two blocks in the table, first is a 1M record and second is +# a 16M delete block. + +UPDATE t1 set data=repeat('c',17*1024*1024); +check table t1; +delete from t1 where left(data,1)='c'; +check table t1; +drop table t1; -- cgit v1.2.1 From 24ca1e1edb1ddbd7609c88cf648447afb67f3098 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Jan 2004 02:18:51 +0400 Subject: added test for bug #2290 "output truncated with ELT when using DISTINCT" sql/item_strfunc.cc: fixed bug #2290 "output truncated with ELT when using DISTINCT" --- mysql-test/r/func_str.result | 7 +++++++ mysql-test/t/func_str.test | 9 +++++++++ 2 files changed, 16 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 35a5ba70e86..7d2668c8cf6 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -266,3 +266,10 @@ CONCAT("",RPAD("",(55 - LENGTH(title)),".")) NULL .......................... DROP TABLE t1; +CREATE TABLE t1 (i int, j int); +INSERT INTO t1 VALUES (1,1),(2,2); +SELECT DISTINCT i, ELT(j, '345', '34') FROM t1; +i ELT(j, '345', '34') +1 345 +2 34 +DROP TABLE t1; diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 33d89b3ca37..2fecf26d7c3 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -154,3 +154,12 @@ INSERT INTO t1 VALUES ('House passes the CAREERS bill'); SELECT CONCAT("",RPAD("",(55 - LENGTH(title)),".")) from t1; DROP TABLE t1; + +# +# test for Bug #2290 "output truncated with ELT when using DISTINCT" +# + +CREATE TABLE t1 (i int, j int); +INSERT INTO t1 VALUES (1,1),(2,2); +SELECT DISTINCT i, ELT(j, '345', '34') FROM t1; +DROP TABLE t1; \ No newline at end of file -- cgit v1.2.1 From 2c3fdcf749b57d4b168710606c84f42943a4ad24 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Jan 2004 21:43:41 +0100 Subject: test case for MyISAM sort-repair bug --- mysql-test/r/myisam.result | 6 ++++++ mysql-test/t/myisam.test | 9 +++++++++ 2 files changed, 15 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index e113a48f4da..11e8ef4fcd7 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -385,3 +385,9 @@ check table t1; Table Op Msg_type Msg_text test.t1 check status OK drop table t1; +create table t1 ( a text not null, key a (a(20))); +insert into t1 values ('aaa '),('aaa'); +repair table t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +drop table t1; diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 12853cd67ca..7ad038bcad0 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -385,3 +385,12 @@ insert into t1 (b) values (repeat('z',100)); update t1 set b="test" where left(b,1) > 'n'; check table t1; drop table t1; + +# +# sort-repair bug +# +create table t1 ( a text not null, key a (a(20))); +insert into t1 values ('aaa '),('aaa'); +repair table t1; +drop table t1; + -- cgit v1.2.1 From 0ef9acc9a9932ea63ff41d4528231632f3a3d31d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Jan 2004 23:29:17 +0100 Subject: two more bugfixes for "space stripping in MyISAM indexes" --- mysql-test/r/myisam.result | 4 ++++ mysql-test/t/myisam.test | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 11e8ef4fcd7..fbb84a677cf 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -390,4 +390,8 @@ insert into t1 values ('aaa '),('aaa'); repair table t1; Table Op Msg_type Msg_text test.t1 repair status OK +select concat(a,'.') from t1 where a='aaa'; +concat(a,'.') +aaa. +aaa . drop table t1; diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 7ad038bcad0..25bb76ceaba 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -387,10 +387,11 @@ check table t1; drop table t1; # -# sort-repair bug +# two bugs in myisam-space-stripping feature # create table t1 ( a text not null, key a (a(20))); insert into t1 values ('aaa '),('aaa'); repair table t1; +select concat(a,'.') from t1 where a='aaa'; drop table t1; -- cgit v1.2.1 From cdcf112af01e0365f5600b9de442f6640569a7a0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Jan 2004 23:39:35 +0100 Subject: test moved to an appropriate file --- mysql-test/r/myisam.result | 8 ++++++++ mysql-test/r/range.result | 8 -------- mysql-test/t/myisam.test | 11 +++++++++++ mysql-test/t/range.test | 11 ----------- 4 files changed, 19 insertions(+), 19 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index fbb84a677cf..68a667f6d95 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -395,3 +395,11 @@ concat(a,'.') aaa. aaa . drop table t1; +create table t1(a text not null, b text not null, c text not null, index (a(10),b(10),c(10))); +insert into t1 values('807780', '477', '165'); +insert into t1 values('807780', '477', '162'); +insert into t1 values('807780', '472', '162'); +select * from t1 where a='807780' and b='477' and c='165'; +a b c +807780 477 165 +drop table t1; diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 45d20a8fced..e87df9a6c24 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -300,11 +300,3 @@ SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1); COUNT(*) 6 DROP TABLE t1; -create table t1(a text not null, b text not null, c text not null, index (a(10),b(10),c(10))); -insert into t1 values('807780', '477', '165'); -insert into t1 values('807780', '477', '162'); -insert into t1 values('807780', '472', '162'); -select * from t1 where a='807780' and b='477' and c='165'; -a b c -807780 477 165 -drop table t1; diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 25bb76ceaba..394261aae40 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -395,3 +395,14 @@ repair table t1; select concat(a,'.') from t1 where a='aaa'; drop table t1; +# +# Third bug in the same code (BUG#2295) +# + +create table t1(a text not null, b text not null, c text not null, index (a(10),b(10),c(10))); +insert into t1 values('807780', '477', '165'); +insert into t1 values('807780', '477', '162'); +insert into t1 values('807780', '472', '162'); +select * from t1 where a='807780' and b='477' and c='165'; +drop table t1; + diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 9d9feaa4edc..b04e614a740 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -249,14 +249,3 @@ SELECT COUNT(*) FROM t1 WHERE (c=0 and a=1) or (c=0 and b=1); SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1); DROP TABLE t1; -# -# BUG#2295 - range on blob -# - -create table t1(a text not null, b text not null, c text not null, index (a(10),b(10),c(10))); -insert into t1 values('807780', '477', '165'); -insert into t1 values('807780', '477', '162'); -insert into t1 values('807780', '472', '162'); -select * from t1 where a='807780' and b='477' and c='165'; -drop table t1; - -- cgit v1.2.1 From 79f6e16d5e8b5edeb76d97b5d9886306e000ae87 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Jan 2004 18:05:47 +0400 Subject: a proper fix for the bug #2298 Trailing whitespace inconsistently handled in WHERE clause. ramil, in MySQL/MyISAM we should only strip end space, not 'space-like' characters. This is according to SQL; When doing a comparision end space and only end space are ignored. myisam/mi_key.c: a proper fix for the bug #2298 Trailing whitespace inconsistently handled in WHERE clause. myisam/mi_search.c: a proper fix for the bug #2298 Trailing whitespace inconsistently handled in WHERE clause. mysql-test/r/select.result: test case for the bug #2298 Trailing whitespace inconsistently handled in WHERE clause. mysql-test/t/select.test: test case for the bug #2298 Trailing whitespace inconsistently handled in WHERE clause. sql/sql_string.cc: a proper fix for the bug #2298 Trailing whitespace inconsistently handled in WHERE clause. --- mysql-test/r/select.result | 20 ++++++++++++++++++++ mysql-test/t/select.test | 16 ++++++++++++++++ 2 files changed, 36 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 9cc5ad76ff0..206fa507615 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2307,3 +2307,23 @@ left join t4 on id3 = id4 where id2 = 1 or id4 = 1; id1 id2 id3 id4 id44 1 1 NULL NULL NULL drop table t1,t2,t3,t4; +create table t1(s varchar(10) not null); +create table t2(s varchar(10) not null primary key); +create table t3(s varchar(10) not null primary key); +insert into t1 values ('one\t'), ('two\t'); +insert into t2 values ('one\r'), ('two\t'); +insert into t3 values ('one '), ('two\t'); +select * from t1 where s = 'one'; +s +select * from t2 where s = 'one'; +s +select * from t3 where s = 'one'; +s +one +select * from t1,t2 where t1.s = t2.s; +s s +two two +select * from t2,t3 where t2.s = t3.s; +s s +two two +drop table t1, t2, t3; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 3e23fa1a3f2..7cb157f194e 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1858,3 +1858,19 @@ left join t4 on id3 = id4 where id2 = 1 or id4 = 1; drop table t1,t2,t3,t4; +# +# Bug #2298 +# + +create table t1(s varchar(10) not null); +create table t2(s varchar(10) not null primary key); +create table t3(s varchar(10) not null primary key); +insert into t1 values ('one\t'), ('two\t'); +insert into t2 values ('one\r'), ('two\t'); +insert into t3 values ('one '), ('two\t'); +select * from t1 where s = 'one'; +select * from t2 where s = 'one'; +select * from t3 where s = 'one'; +select * from t1,t2 where t1.s = t2.s; +select * from t2,t3 where t2.s = t3.s; +drop table t1, t2, t3; -- cgit v1.2.1 From 8b03b319f5cdd21cd47042142bee96e2163100fa Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Jan 2004 20:20:43 +0400 Subject: some ammendments (comments and code style) mysql-test/t/func_str.test: add skipped new line sql/item_strfunc.cc: rewrote some comments for Item_func_elt --- mysql-test/t/func_str.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 2fecf26d7c3..1eba49a9583 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -162,4 +162,4 @@ DROP TABLE t1; CREATE TABLE t1 (i int, j int); INSERT INTO t1 VALUES (1,1),(2,2); SELECT DISTINCT i, ELT(j, '345', '34') FROM t1; -DROP TABLE t1; \ No newline at end of file +DROP TABLE t1; -- cgit v1.2.1 From b9073593d0defc65472125b625e399e5ab22d1f6 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Jan 2004 15:16:48 +0100 Subject: Mark that strings may change on index only reads (for BDB tables). This fixed problem with index reads on character fields with BDB tables. (Bug #2509) BitKeeper/etc/ignore: added man/*.1 mysql-test/r/bdb.result: New test mysql-test/r/myisam.result: More tests mysql-test/t/bdb.test: Test for idnex only read mysql-test/t/myisam.test: More test to verify pushed bug fix sql/ha_berkeley.h: Mark that strings may change on index only reads sql/item_strfunc.cc: Cleanup sql/table.cc: Allow index only reads on binary strings --- mysql-test/r/bdb.result | 25 +++++++++++++++++++++++++ mysql-test/r/myisam.result | 30 +++++++++++++++++++++++++++++- mysql-test/t/bdb.test | 14 ++++++++++++++ mysql-test/t/myisam.test | 18 +++++++++++++++++- 4 files changed, 85 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result index 05845df9dd3..2ccb5148d58 100644 --- a/mysql-test/r/bdb.result +++ b/mysql-test/r/bdb.result @@ -1165,3 +1165,28 @@ create table t2 (c char(8) not null, b char(8) not null, a char(8) not null, pri insert into t2 select * from t1; delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b; drop table t1,t2; +create table t1 (a char(10), key(a), b int not null, key(b)) engine=bdb; +insert into t1 values ('a',1),('A',2); +explain select a from t1; +table type possible_keys key key_len ref rows Extra +t1 ALL NULL NULL NULL NULL 2 +select a from t1; +a +a +A +explain select b from t1; +table type possible_keys key key_len ref rows Extra +t1 index NULL b 4 NULL 2 Using index +select b from t1; +b +1 +2 +alter table t1 modify a char(10) binary; +explain select a from t1; +table type possible_keys key key_len ref rows Extra +t1 index NULL a 11 NULL 2 Using index +select a from t1; +a +A +a +drop table t1; diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 68a667f6d95..cc541388a5c 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -386,7 +386,10 @@ Table Op Msg_type Msg_text test.t1 check status OK drop table t1; create table t1 ( a text not null, key a (a(20))); -insert into t1 values ('aaa '),('aaa'); +insert into t1 values ('aaa '),('aaa'),('aa'); +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK repair table t1; Table Op Msg_type Msg_text test.t1 repair status OK @@ -394,6 +397,15 @@ select concat(a,'.') from t1 where a='aaa'; concat(a,'.') aaa. aaa . +select concat(a,'.') from t1 where binary a='aaa'; +concat(a,'.') +aaa. +update t1 set a='bbb' where a='aaa'; +select concat(a,'.') from t1; +concat(a,'.') +bbb. +bbb. +aa. drop table t1; create table t1(a text not null, b text not null, c text not null, index (a(10),b(10),c(10))); insert into t1 values('807780', '477', '165'); @@ -403,3 +415,19 @@ select * from t1 where a='807780' and b='477' and c='165'; a b c 807780 477 165 drop table t1; +create table t1 (a int not null auto_increment primary key, b text not null, unique b (b(20))); +insert into t1 (b) values ('a'),('a '),('a '); +select concat(b,'.') from t1; +concat(b,'.') +a. +a . +a . +update t1 set b='b ' where a=2; +update t1 set b='b ' where a > 1; +Duplicate entry 'b ' for key 2 +delete from t1 where b='b'; +select a,concat(b,'.') from t1; +a concat(b,'.') +1 a. +3 a . +drop table t1; diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test index 2dfaecba9b1..4b490052535 100644 --- a/mysql-test/t/bdb.test +++ b/mysql-test/t/bdb.test @@ -815,3 +815,17 @@ insert into t2 select * from t1; delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b; drop table t1,t2; + +# +# Test index only read (Bug #2509) +# +create table t1 (a char(10), key(a), b int not null, key(b)) engine=bdb; +insert into t1 values ('a',1),('A',2); +explain select a from t1; +select a from t1; +explain select b from t1; +select b from t1; +alter table t1 modify a char(10) binary; +explain select a from t1; +select a from t1; +drop table t1; diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 394261aae40..7302e5dfdda 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -390,9 +390,13 @@ drop table t1; # two bugs in myisam-space-stripping feature # create table t1 ( a text not null, key a (a(20))); -insert into t1 values ('aaa '),('aaa'); +insert into t1 values ('aaa '),('aaa'),('aa'); +check table t1; repair table t1; select concat(a,'.') from t1 where a='aaa'; +select concat(a,'.') from t1 where binary a='aaa'; +update t1 set a='bbb' where a='aaa'; +select concat(a,'.') from t1; drop table t1; # @@ -406,3 +410,15 @@ insert into t1 values('807780', '472', '162'); select * from t1 where a='807780' and b='477' and c='165'; drop table t1; +# +# Test text and unique +# +create table t1 (a int not null auto_increment primary key, b text not null, unique b (b(20))); +insert into t1 (b) values ('a'),('a '),('a '); +select concat(b,'.') from t1; +update t1 set b='b ' where a=2; +--error 1062 +update t1 set b='b ' where a > 1; +delete from t1 where b='b'; +select a,concat(b,'.') from t1; +drop table t1; -- cgit v1.2.1 From 8746a25554d18f03fc32ca5d338850f9308bee88 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Jan 2004 19:22:29 +0100 Subject: Fix for BUG#2527 "Multi-Table Delete - Not Replication use replicate-wild-do-table" (as long as replicate-*-table rules were defined, multi-table DELETE was never replicated by the slave). sql/sql_parse.cc: For a multi-table DELETE, there are two lists of tables: - 'tables' contains the tables in the FROM. They have 'updating==0'. - 'thd->lex.auxilliary_table_list.first' contains the tables between the DELETE and the FROM. They have 'updating==1'. So the bug was that the slave only tests 'tables' and as all its elements have updating==0, tables_ok() always returns 0. So for a multi DELETE the slave now tests the 2nd list too. I started with the other tip of the sausage: I thought of changing multi DELETE to use only one list (given that 'updating' can be used to separate it in two when needed) (with one list we wouldn't need to change the slave code), but finally hit the unicity check in add_table_to_list() which started to return ER_NONUNIQ_TABLE (logical). --- mysql-test/r/rpl_multi_delete.result | 22 ++++++++++++++++++++++ mysql-test/t/rpl_multi_delete-slave.opt | 1 + mysql-test/t/rpl_multi_delete.test | 23 +++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 mysql-test/r/rpl_multi_delete.result create mode 100644 mysql-test/t/rpl_multi_delete-slave.opt create mode 100644 mysql-test/t/rpl_multi_delete.test (limited to 'mysql-test') diff --git a/mysql-test/r/rpl_multi_delete.result b/mysql-test/r/rpl_multi_delete.result new file mode 100644 index 00000000000..fa254d76393 --- /dev/null +++ b/mysql-test/r/rpl_multi_delete.result @@ -0,0 +1,22 @@ +slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +slave start; +create table t1 (a int); +create table t2 (a int); +insert into t1 values (1); +insert into t2 values (1); +delete t1.* from t1, t2 where t1.a = t2.a; +select * from t1; +a +select * from t2; +a +1 +select * from t1; +a +select * from t2; +a +1 +drop table t1,t2; diff --git a/mysql-test/t/rpl_multi_delete-slave.opt b/mysql-test/t/rpl_multi_delete-slave.opt new file mode 100644 index 00000000000..c98fe0b0a46 --- /dev/null +++ b/mysql-test/t/rpl_multi_delete-slave.opt @@ -0,0 +1 @@ +--replicate-wild-do-table=test.% diff --git a/mysql-test/t/rpl_multi_delete.test b/mysql-test/t/rpl_multi_delete.test new file mode 100644 index 00000000000..299cb720b62 --- /dev/null +++ b/mysql-test/t/rpl_multi_delete.test @@ -0,0 +1,23 @@ +source include/master-slave.inc; +create table t1 (a int); +create table t2 (a int); + +insert into t1 values (1); +insert into t2 values (1); + +delete t1.* from t1, t2 where t1.a = t2.a; + +save_master_pos; +select * from t1; +select * from t2; + +connection slave; +sync_with_master; +select * from t1; +select * from t2; + +connection master; +drop table t1,t2; +save_master_pos; +connection slave; +sync_with_master; -- cgit v1.2.1 From bbd2adf4ba6ec2086a5e8eeaa89f56f1abee02f6 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Jan 2004 00:05:34 +0100 Subject: Fix for BUG#2477 "Slave stop with error after master reboot if use HEAP tables": when we open the HEAP table for the first time since server restart, in hp_open(), we set a flag to propagate this info to the handler level which then writes a DELETE FROM this_heap_table to the binlog. It is not a perfect solution for the bug, because between the server start and the first open of the table, the slave still had old data in his table so a SELECT on the slave may show wrong content. But if there is a --init-file to populate the HEAP table on master as startup, then this is a safe fix (I'll put a note about init-file in the HEAP section of the manual). heap/hp_info.c: new info variable implicit_emptied heap/hp_open.c: If this is the first open of the HEAP table, it means it is empty, so we mark it. include/heap.h: new variables implicit_emptied (we need one in HEAPINFO for the hp_info() call). sql/ha_heap.cc: report info to upper level sql/handler.h: new info 'implicit_emptied' in the handler level; only HEAP uses it. sql/sql_base.cc: When a HEAP table is opened for the first time, write a DELETE FROM to the binlog, for replication and mysqlbinlog|mysql. Monty: I added the entry->file->implicit_emptied= 0; --- mysql-test/r/rpl_heap.result | 29 +++++++++++++++++++++++++++ mysql-test/t/rpl_heap.test | 47 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 mysql-test/r/rpl_heap.result create mode 100644 mysql-test/t/rpl_heap.test (limited to 'mysql-test') diff --git a/mysql-test/r/rpl_heap.result b/mysql-test/r/rpl_heap.result new file mode 100644 index 00000000000..1556bcd5f25 --- /dev/null +++ b/mysql-test/r/rpl_heap.result @@ -0,0 +1,29 @@ +reset master; +drop table if exists t1; +create table t1 (a int) type=HEAP; +insert into t1 values(10); +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.001 79 Query 1 79 use `test`; create table t1 (a int) type=HEAP +master-bin.001 147 Query 1 147 use `test`; DELETE FROM `test`.`t1` +master-bin.001 205 Query 1 205 use `test`; insert into t1 values(10) +reset slave; +start slave; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) default NULL +) TYPE=HEAP +select * from t1; +a +10 +select * from t1; +a +select * from t1 limit 10; +a +show binlog events in 'master-bin.002' from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.002 79 Query 1 79 use `test`; DELETE FROM `test`.`t1` +select * from t1; +a +drop table t1; diff --git a/mysql-test/t/rpl_heap.test b/mysql-test/t/rpl_heap.test new file mode 100644 index 00000000000..15f61918034 --- /dev/null +++ b/mysql-test/t/rpl_heap.test @@ -0,0 +1,47 @@ +# You must run this test with --manager. + +require_manager; + +# Don't know why, but using TCP/IP connections makes this test fail +# with "Lost connection to MySQL server during query" when we +# issue a query after the server restart. +# Maybe this is something awkward in mysqltest or in the manager? +# So we use sockets. +connect (master,localhost,root,,test,0,master.sock); +connect (slave,localhost,root,,test,0,slave.sock); + +connection master; +reset master; +drop table if exists t1; +create table t1 (a int) type=HEAP; +insert into t1 values(10); +save_master_pos; +show binlog events from 79; +connection slave; +reset slave; +start slave; +sync_with_master; +show create table t1; +select * from t1; # should be one row + +server_stop master; +server_start master; + +connection master; +select * from t1; +# to check that DELETE is not written twice +# (the LIMIT is to not use the query cache) +select * from t1 limit 10; +save_master_pos; +show binlog events in 'master-bin.002' from 79; + +connection slave; +sync_with_master; +select * from t1; # should be empty + +# clean up +connection master; +drop table t1; +save_master_pos; +connection slave; +sync_with_master; -- cgit v1.2.1 From f120273dd284ff4df9649191e8cc37b2d84dd033 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Jan 2004 10:46:30 +0100 Subject: Fixed parsing of column names and foreign key constraints in Innobase to handle quoted identifiers and identifiers with space. (Bug #1725) Fix optimizer tuning bug when first used key part was a constant. (Bug #1679) innobase/dict/dict0dict.c: Fixed parsing of column names and foreign key constraints to handle quoted identifiers and identifiers with space. (Bug #1725) mysql-test/r/innodb.result: Test of innodb internal parsing mysql-test/t/innodb.test: Test of innodb internal parsing sql/sql_class.cc: Safety fix for select into outfile and select into dumpfile. Before calling send_error() could cause end_io_cache() to be called several times. sql/sql_class.h: Add path to dumpfile so that we can delete the generated file if something goes wrong. sql/sql_select.cc: Fix optimizer tuning bug when first used key part was a constant. Previously all keys that had this key part first was regarded as equal, even if the query used more key parts for some of the keys. Now we use the range optimizer results to just limit the number of estimated rows if not all key parts where constants. (Bug #1679) --- mysql-test/r/innodb.result | 3 +++ mysql-test/t/innodb.test | 9 +++++++++ 2 files changed, 12 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index ce5491a718f..ca4a49fea4e 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1243,3 +1243,6 @@ a 3 4 drop table t1; +CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) TYPE=INNODB; +CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) TYPE=INNODB; +drop table t1,t2; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 7cc509caf74..51fadccdc1c 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -869,3 +869,12 @@ truncate table t1; insert into t1 (a) values (NULL),(NULL); SELECT * from t1; drop table t1; + +# +# Test dictionary handling with spaceand quoting +# + +CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) TYPE=INNODB; +CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) TYPE=INNODB; +#show create table t2; +drop table t1,t2; -- cgit v1.2.1 From a96ffb29258a80f8dfaa11f336d0edaa23ad6cf6 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Jan 2004 15:13:19 +0300 Subject: Fix for bugs #1885, #2464, #2539. Proper handling of default values for TIMESTAMP columns. The solution is not perfect since we just silently ignoring default value for first TIMESTAMP column and properly reflecting this fact in SHOW CREATE TABLE. We can't give a warning or simply support standard syntax (niladic functions as legal value for default) for first field since it is 4.0 tree. mysql-test/r/type_timestamp.result: Added test for bugs #1885, #2464, #2539 (proper support of default values for TIMESTAMP columns) mysql-test/t/type_timestamp.test: Added test for bugs #1885, #2464, #2539 (proper support of default values for TIMESTAMP columns) sql/field.cc: Enabled copying of defaults for TIMESTAMP fields when we are creating table with CREATE TABLE x (SELECT ...) sql/field.h: Set proper DEFAULT value for non-first TIMESTAMP column. sql/sql_parse.cc: Allowed default values for TIMESTAMP column. sql/sql_show.cc: Enabled printing of default values in SHOW CREATE TABLE and SHOW COLUMNS for all TIMESTAMP columns except first one. --- mysql-test/r/type_timestamp.result | 47 ++++++++++++++++++++++++++++++++++++-- mysql-test/t/type_timestamp.test | 33 +++++++++++++++++++++++--- 2 files changed, 75 insertions(+), 5 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index b513f958787..cd45bcf911d 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -122,5 +122,48 @@ t2 t4 t6 t8 t10 t12 t14 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 drop table t1; -create table t1 (a timestamp default 1); -Invalid default value for 'a' +create table t1 (t1 timestamp default '2003-01-01 00:00:00', +t2 timestamp default '2003-01-01 00:00:00'); +set TIMESTAMP=1000000000; +insert into t1 values(); +select * from t1; +t1 t2 +2001-09-09 04:46:40 2003-01-01 00:00:00 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `t1` timestamp(14) NOT NULL, + `t2` timestamp(14) NOT NULL default '2003-01-01 00:00:00' +) TYPE=MyISAM +show columns from t1; +Field Type Null Key Default Extra +t1 timestamp(14) YES NULL +t2 timestamp(14) YES 2003-01-01 00:00:00 +show columns from t1 like 't2'; +Field Type Null Key Default Extra +t2 timestamp(14) YES 2003-01-01 00:00:00 +create table t2 (select * from t1); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `t1` timestamp(14) NOT NULL, + `t2` timestamp(14) NOT NULL default '2003-01-01 00:00:00' +) TYPE=MyISAM +alter table t1 add column t0 timestamp first; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `t0` timestamp(14) NOT NULL, + `t1` timestamp(14) NOT NULL default '2003-01-01 00:00:00', + `t2` timestamp(14) NOT NULL default '2003-01-01 00:00:00' +) TYPE=MyISAM +drop table t1,t2; +create table t1 (ts1 timestamp, ts2 timestamp); +set TIMESTAMP=1000000000; +insert into t1 values (); +insert into t1 values (DEFAULT, DEFAULT); +select * from t1; +ts1 ts2 +2001-09-09 04:46:40 0000-00-00 00:00:00 +2001-09-09 04:46:40 0000-00-00 00:00:00 +drop table t1; diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test index 17f7b7c487f..3483227376e 100644 --- a/mysql-test/t/type_timestamp.test +++ b/mysql-test/t/type_timestamp.test @@ -73,8 +73,35 @@ select * from t1; drop table t1; # -# Bug #1885 +# Bug #1885, bug #2539. +# Not perfect but still sensible attitude towards defaults for TIMESTAMP +# We will ignore default value for first TIMESTAMP column. # +create table t1 (t1 timestamp default '2003-01-01 00:00:00', + t2 timestamp default '2003-01-01 00:00:00'); +set TIMESTAMP=1000000000; +insert into t1 values(); +select * from t1; +show create table t1; +show columns from t1; +show columns from t1 like 't2'; +create table t2 (select * from t1); +show create table t2; + +# Ugly, but we can't do anything about this in 4.0 +alter table t1 add column t0 timestamp first; +show create table t1; ---error 1067 -create table t1 (a timestamp default 1); +drop table t1,t2; + +# +# Test for bug 2464, DEFAULT keyword in INSERT statement should return +# default value for column. +# + +create table t1 (ts1 timestamp, ts2 timestamp); +set TIMESTAMP=1000000000; +insert into t1 values (); +insert into t1 values (DEFAULT, DEFAULT); +select * from t1; +drop table t1; -- cgit v1.2.1 From ef55f2dcdbc79c78aa37e6646ac2aef62c23e7d3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Jan 2004 19:15:11 +0300 Subject: Fix for bug #2523 '"func_time" test fails on QNX'. Moved all range checks for TIMESTAMP value to my_gmt_sec(). Also fixed check of upper boundary of TIMESTAMP range (which also now will catch datetime values which are too small for TIMESTAMP in case if time_t is unsigned). mysql-test/r/timezone.result: Added test which checks if TIMESTAMP range is checked correctly (current time zone is honoured and both upper and lower bounds of TIMESTAMP range are checked). mysql-test/t/timezone.test: Added test which checks if TIMESTAMP range is checked correctly (current time zone is honoured and both upper and lower bounds of TIMESTAMP range are checked). sql/field.cc: Check if datetime value is in TIMESTAMP range has moved to my_gmt_sec() function. sql/mysql_priv.h: Added more constants for checking if datetime is in allowed range for TIMESTAMP. sql/time.cc: Check if datetime value is in TIMESTAMP range has moved to my_gmt_sec() function. Fixed check of its return value to catch overflows in both directions and also overflows in case of unsigned time_t. --- mysql-test/r/timezone.result | 6 ++++++ mysql-test/t/timezone.test | 7 +++++++ 2 files changed, 13 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/timezone.result b/mysql-test/r/timezone.result index 20706408075..15f0d4121c7 100644 --- a/mysql-test/r/timezone.result +++ b/mysql-test/r/timezone.result @@ -32,3 +32,9 @@ ts from_unixtime(ts) 1048989599 2003-03-30 03:59:59 1048989601 2003-03-30 04:00:01 DROP TABLE t1; +select unix_timestamp('1970-01-01 01:00:00'), +unix_timestamp('1970-01-01 01:00:01'), +unix_timestamp('2038-01-01 00:59:59'), +unix_timestamp('2038-01-01 01:00:00'); +unix_timestamp('1970-01-01 01:00:00') unix_timestamp('1970-01-01 01:00:01') unix_timestamp('2038-01-01 00:59:59') unix_timestamp('2038-01-01 01:00:00') +0 1 2145916799 0 diff --git a/mysql-test/t/timezone.test b/mysql-test/t/timezone.test index ab732c11a34..ba65eb72fe6 100644 --- a/mysql-test/t/timezone.test +++ b/mysql-test/t/timezone.test @@ -38,3 +38,10 @@ INSERT INTO t1 (ts) VALUES (Unix_timestamp('2003-03-30 04:00:01')); SELECT ts,from_unixtime(ts) FROM t1; DROP TABLE t1; +# +# Test for fix for Bug#2523 +# +select unix_timestamp('1970-01-01 01:00:00'), + unix_timestamp('1970-01-01 01:00:01'), + unix_timestamp('2038-01-01 00:59:59'), + unix_timestamp('2038-01-01 01:00:00'); -- cgit v1.2.1 From 2b9e17449932eed3458e098b23d8686538e21fa3 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Feb 2004 01:30:59 +0200 Subject: innodb.result, innodb.test: Change tests so that tables are dropped in an order respecting the FOREIGN KEY constraints mysql-test/t/innodb.test: Change tests so that tables are dropped in an order respecting the FOREIGN KEY constraints mysql-test/r/innodb.result: Change tests so that tables are dropped in an order respecting the FOREIGN KEY constraints --- mysql-test/r/innodb.result | 4 ++-- mysql-test/t/innodb.test | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index ca4a49fea4e..416c583a8d7 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1004,7 +1004,7 @@ select * from t1; id select * from t2; id t1_id -drop table t1,t2; +drop table t2,t1; DROP TABLE IF EXISTS t1,t2; CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB; CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) TYPE=INNODB; @@ -1245,4 +1245,4 @@ a drop table t1; CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) TYPE=INNODB; CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) TYPE=INNODB; -drop table t1,t2; +drop table t2,t1; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 51fadccdc1c..ec9aa83ae16 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -692,7 +692,7 @@ insert into t2 set id=1, t1_id=1; delete t1,t2 from t1,t2 where t1.id=t2.t1_id; select * from t1; select * from t2; -drop table t1,t2; +drop table t2,t1; DROP TABLE IF EXISTS t1,t2; CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB; CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) TYPE=INNODB; @@ -877,4 +877,4 @@ drop table t1; CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) TYPE=INNODB; CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) TYPE=INNODB; #show create table t2; -drop table t1,t2; +drop table t2,t1; -- cgit v1.2.1 From 0ba7ef007eb04fbe8e508878d02fb4a987f05250 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Feb 2004 01:41:35 +0200 Subject: rpl_insert_id.test, rpl_insert_id.result: Change tests so that tables are dropped in an order respecting the FOREIGN KEY constraints mysql-test/r/rpl_insert_id.result: Change tests so that tables are dropped in an order respecting the FOREIGN KEY constraints mysql-test/t/rpl_insert_id.test: Change tests so that tables are dropped in an order respecting the FOREIGN KEY constraints --- mysql-test/r/rpl_insert_id.result | 2 +- mysql-test/t/rpl_insert_id.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/rpl_insert_id.result b/mysql-test/r/rpl_insert_id.result index 889e7891770..d2dfbb05675 100644 --- a/mysql-test/r/rpl_insert_id.result +++ b/mysql-test/r/rpl_insert_id.result @@ -39,8 +39,8 @@ select * from t2; b c 5 0 6 11 -drop table t1; drop table t2; +drop table t1; create table t1(a int auto_increment, key(a)); create table t2(b int auto_increment, c int, key(b)); insert into t1 values (10); diff --git a/mysql-test/t/rpl_insert_id.test b/mysql-test/t/rpl_insert_id.test index 49fefae72b8..a6da44de456 100644 --- a/mysql-test/t/rpl_insert_id.test +++ b/mysql-test/t/rpl_insert_id.test @@ -42,8 +42,8 @@ connection master; # check if INSERT SELECT in auto_increment is well replicated (bug #490) -drop table t1; drop table t2; +drop table t1; create table t1(a int auto_increment, key(a)); create table t2(b int auto_increment, c int, key(b)); insert into t1 values (10); -- cgit v1.2.1 From 883f11b68c402b106dbff2542435782a8af3b55d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Feb 2004 15:57:57 +0100 Subject: test added --- mysql-test/r/bigint.result | 3 +++ mysql-test/t/bigint.test | 2 ++ 2 files changed, 5 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result index 308adc881f2..f96da579bce 100644 --- a/mysql-test/r/bigint.result +++ b/mysql-test/r/bigint.result @@ -81,3 +81,6 @@ quantity 10000000000000000000 10000000000000000000 drop table t1; +SELECT '0x8000000000000001'+0; +'0x8000000000000001'+0 +0 diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test index f21f821e45c..0092317dc5e 100644 --- a/mysql-test/t/bigint.test +++ b/mysql-test/t/bigint.test @@ -60,3 +60,5 @@ insert into t1 values ('10000000000000000000'); select * from t1; drop table t1; +SELECT '0x8000000000000001'+0; + -- cgit v1.2.1 From 619eaee654d213c68f86981bf33dcccf15b52f02 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Feb 2004 09:46:48 +0100 Subject: Give error if locked table is used twice in query. This fixes strange error message when doing LOCK TABLES t1 WRITE; INSERT TABLE t1 SELECT * from t1 (Bug #2296) client/mysqldump.c: Better help for flush-logs mysql-test/r/lock.result: Test for LOCK TABLES ; INSERT ... SELECT mysql-test/t/lock.test: Test for LOCK TABLES ; INSERT ... SELECT --- mysql-test/r/lock.result | 4 ++++ mysql-test/t/lock.test | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/lock.result b/mysql-test/r/lock.result index ad5251b9110..31a18fe6cec 100644 --- a/mysql-test/r/lock.result +++ b/mysql-test/r/lock.result @@ -41,5 +41,9 @@ lock tables t1 write; check table t2; Table Op Msg_type Msg_text test.t2 check error Table 't2' was not locked with LOCK TABLES +insert into t1 select nr from t1; +Table 't1' was not locked with LOCK TABLES unlock tables; +lock tables t1 write, t1 as t1_alias read; +insert into t1 select index1,nr from t1 as t1_alias; drop table t1,t2; diff --git a/mysql-test/t/lock.test b/mysql-test/t/lock.test index 385713174d2..9015ce12fde 100644 --- a/mysql-test/t/lock.test +++ b/mysql-test/t/lock.test @@ -51,5 +51,9 @@ check table t1; # Check error message lock tables t1 write; check table t2; +--error 1100 +insert into t1 select nr from t1; unlock tables; +lock tables t1 write, t1 as t1_alias read; +insert into t1 select index1,nr from t1 as t1_alias; drop table t1,t2; -- cgit v1.2.1 From 92bcbf9a43e2d74ee323f5e768923bfc289e83ce Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Feb 2004 14:03:01 +0400 Subject: Thai tis620 crash problem in text comparison routines was fixed. --- mysql-test/r/ctype_tis620.result | 17 +++++++++++++++++ mysql-test/t/ctype_tis620-master.opt | 1 + mysql-test/t/ctype_tis620.test | 18 ++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 mysql-test/r/ctype_tis620.result create mode 100644 mysql-test/t/ctype_tis620-master.opt create mode 100644 mysql-test/t/ctype_tis620.test (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_tis620.result b/mysql-test/r/ctype_tis620.result new file mode 100644 index 00000000000..d939fd12e60 --- /dev/null +++ b/mysql-test/r/ctype_tis620.result @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS t620; +CREATE TABLE t620 ( +recid int(11) NOT NULL auto_increment, +dyninfo text, +PRIMARY KEY (recid) +) TYPE=MyISAM; +INSERT INTO t620 VALUES (1,'color=\"STB,NPG\"\r\nengine=\"J30A13\"\r\nframe=\"MRHCG1640YP4\"\r\ngrade=\"V6\"\r\nmodel=\"ACCORD\"\r\nmodelcode=\"CG164YEN\"\r\ntype=\"VT6\"\r\n'); +INSERT INTO t620 VALUES (2,'color=\"HTM,NPG,DEG,RGS\"\r\nengine=\"F23A5YP1\"\r\nframe=\"MRHCF8640YP3\"\r\ngrade=\"EXi AT\"\r\nmodel=\"ACCORD\"\r\nmodelcode=\"CF864YE\"\r\ntype=\"EXA\"\r\n'); +SELECT DISTINCT +(IF( LOCATE( 'year=\"', dyninfo ) = 1, +SUBSTRING( dyninfo, 6+1, LOCATE('\"\r',dyninfo) - 6 -1), +IF( LOCATE( '\nyear=\"', dyninfo ), +SUBSTRING( dyninfo, LOCATE( '\nyear=\"', dyninfo ) + 7, +LOCATE( '\"\r', SUBSTRING( dyninfo, LOCATE( '\nyear=\"', dyninfo ) +7 )) - 1), '' ))) AS year +FROM t620 +HAVING year != '' ORDER BY year; +year diff --git a/mysql-test/t/ctype_tis620-master.opt b/mysql-test/t/ctype_tis620-master.opt new file mode 100644 index 00000000000..69d47c06e42 --- /dev/null +++ b/mysql-test/t/ctype_tis620-master.opt @@ -0,0 +1 @@ +--default-character-set=tis620 diff --git a/mysql-test/t/ctype_tis620.test b/mysql-test/t/ctype_tis620.test new file mode 100644 index 00000000000..7a0555515e1 --- /dev/null +++ b/mysql-test/t/ctype_tis620.test @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS t620; +CREATE TABLE t620 ( + recid int(11) NOT NULL auto_increment, + dyninfo text, + PRIMARY KEY (recid) +) TYPE=MyISAM; + +INSERT INTO t620 VALUES (1,'color=\"STB,NPG\"\r\nengine=\"J30A13\"\r\nframe=\"MRHCG1640YP4\"\r\ngrade=\"V6\"\r\nmodel=\"ACCORD\"\r\nmodelcode=\"CG164YEN\"\r\ntype=\"VT6\"\r\n'); +INSERT INTO t620 VALUES (2,'color=\"HTM,NPG,DEG,RGS\"\r\nengine=\"F23A5YP1\"\r\nframe=\"MRHCF8640YP3\"\r\ngrade=\"EXi AT\"\r\nmodel=\"ACCORD\"\r\nmodelcode=\"CF864YE\"\r\ntype=\"EXA\"\r\n'); + +SELECT DISTINCT + (IF( LOCATE( 'year=\"', dyninfo ) = 1, + SUBSTRING( dyninfo, 6+1, LOCATE('\"\r',dyninfo) - 6 -1), + IF( LOCATE( '\nyear=\"', dyninfo ), + SUBSTRING( dyninfo, LOCATE( '\nyear=\"', dyninfo ) + 7, + LOCATE( '\"\r', SUBSTRING( dyninfo, LOCATE( '\nyear=\"', dyninfo ) +7 )) - 1), '' ))) AS year +FROM t620 +HAVING year != '' ORDER BY year; -- cgit v1.2.1 From 4b44b849ba7ba7e8c5e7de5de40726888f21f847 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Feb 2004 09:51:13 +0100 Subject: Fixed problem with range optimization over overlapping ranges (#2448) mysql-test/r/ctype_tis620.result: Cleanup test mysql-test/r/range.result: Test problem with range optimization over overlapping ranges (#2448) mysql-test/t/ctype_tis620.test: Cleanup test mysql-test/t/range.test: Test problem with range optimization over overlapping ranges (#2448) sql/mysqld.cc: Remove debug statement strings/ctype-tis620.c: est problem with range optimization over overlapping ranges (#2448) --- mysql-test/r/ctype_tis620.result | 13 +++++++------ mysql-test/r/range.result | 13 +++++++++++++ mysql-test/t/ctype_tis620.test | 17 +++++++++++------ mysql-test/t/range.test | 16 +++++++++++++++- 4 files changed, 46 insertions(+), 13 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_tis620.result b/mysql-test/r/ctype_tis620.result index d939fd12e60..811609d4ba9 100644 --- a/mysql-test/r/ctype_tis620.result +++ b/mysql-test/r/ctype_tis620.result @@ -1,17 +1,18 @@ -DROP TABLE IF EXISTS t620; -CREATE TABLE t620 ( +drop table if exists t1; +CREATE TABLE t1 ( recid int(11) NOT NULL auto_increment, dyninfo text, PRIMARY KEY (recid) -) TYPE=MyISAM; -INSERT INTO t620 VALUES (1,'color=\"STB,NPG\"\r\nengine=\"J30A13\"\r\nframe=\"MRHCG1640YP4\"\r\ngrade=\"V6\"\r\nmodel=\"ACCORD\"\r\nmodelcode=\"CG164YEN\"\r\ntype=\"VT6\"\r\n'); -INSERT INTO t620 VALUES (2,'color=\"HTM,NPG,DEG,RGS\"\r\nengine=\"F23A5YP1\"\r\nframe=\"MRHCF8640YP3\"\r\ngrade=\"EXi AT\"\r\nmodel=\"ACCORD\"\r\nmodelcode=\"CF864YE\"\r\ntype=\"EXA\"\r\n'); +) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,'color=\"STB,NPG\"\r\nengine=\"J30A13\"\r\nframe=\"MRHCG1640YP4\"\r\ngrade=\"V6\"\r\nmodel=\"ACCORD\"\r\nmodelcode=\"CG164YEN\"\r\ntype=\"VT6\"\r\n'); +INSERT INTO t1 VALUES (2,'color=\"HTM,NPG,DEG,RGS\"\r\nengine=\"F23A5YP1\"\r\nframe=\"MRHCF8640YP3\"\r\ngrade=\"EXi AT\"\r\nmodel=\"ACCORD\"\r\nmodelcode=\"CF864YE\"\r\ntype=\"EXA\"\r\n'); SELECT DISTINCT (IF( LOCATE( 'year=\"', dyninfo ) = 1, SUBSTRING( dyninfo, 6+1, LOCATE('\"\r',dyninfo) - 6 -1), IF( LOCATE( '\nyear=\"', dyninfo ), SUBSTRING( dyninfo, LOCATE( '\nyear=\"', dyninfo ) + 7, LOCATE( '\"\r', SUBSTRING( dyninfo, LOCATE( '\nyear=\"', dyninfo ) +7 )) - 1), '' ))) AS year -FROM t620 +FROM t1 HAVING year != '' ORDER BY year; year +DROP TABLE t1; diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index e87df9a6c24..ccfdbd62a42 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -300,3 +300,16 @@ SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1); COUNT(*) 6 DROP TABLE t1; +CREATE TABLE t1 ( a int not null, b int not null, INDEX ab(a,b) ); +INSERT INTO t1 VALUES (47,1), (70,1), (15,1), (15, 4); +SELECT * FROM t1 +WHERE +( +( b =1 AND a BETWEEN 14 AND 21 ) OR +( b =2 AND a BETWEEN 16 AND 18 ) OR +( b =3 AND a BETWEEN 15 AND 19 ) OR +(a BETWEEN 19 AND 47) +); +a b +15 1 +47 1 diff --git a/mysql-test/t/ctype_tis620.test b/mysql-test/t/ctype_tis620.test index 7a0555515e1..7314b52e301 100644 --- a/mysql-test/t/ctype_tis620.test +++ b/mysql-test/t/ctype_tis620.test @@ -1,12 +1,15 @@ -DROP TABLE IF EXISTS t620; -CREATE TABLE t620 ( +--disable_warnings +drop table if exists t1; +--enable_warnings + +CREATE TABLE t1 ( recid int(11) NOT NULL auto_increment, dyninfo text, PRIMARY KEY (recid) -) TYPE=MyISAM; +) ENGINE=MyISAM; -INSERT INTO t620 VALUES (1,'color=\"STB,NPG\"\r\nengine=\"J30A13\"\r\nframe=\"MRHCG1640YP4\"\r\ngrade=\"V6\"\r\nmodel=\"ACCORD\"\r\nmodelcode=\"CG164YEN\"\r\ntype=\"VT6\"\r\n'); -INSERT INTO t620 VALUES (2,'color=\"HTM,NPG,DEG,RGS\"\r\nengine=\"F23A5YP1\"\r\nframe=\"MRHCF8640YP3\"\r\ngrade=\"EXi AT\"\r\nmodel=\"ACCORD\"\r\nmodelcode=\"CF864YE\"\r\ntype=\"EXA\"\r\n'); +INSERT INTO t1 VALUES (1,'color=\"STB,NPG\"\r\nengine=\"J30A13\"\r\nframe=\"MRHCG1640YP4\"\r\ngrade=\"V6\"\r\nmodel=\"ACCORD\"\r\nmodelcode=\"CG164YEN\"\r\ntype=\"VT6\"\r\n'); +INSERT INTO t1 VALUES (2,'color=\"HTM,NPG,DEG,RGS\"\r\nengine=\"F23A5YP1\"\r\nframe=\"MRHCF8640YP3\"\r\ngrade=\"EXi AT\"\r\nmodel=\"ACCORD\"\r\nmodelcode=\"CF864YE\"\r\ntype=\"EXA\"\r\n'); SELECT DISTINCT (IF( LOCATE( 'year=\"', dyninfo ) = 1, @@ -14,5 +17,7 @@ SELECT DISTINCT IF( LOCATE( '\nyear=\"', dyninfo ), SUBSTRING( dyninfo, LOCATE( '\nyear=\"', dyninfo ) + 7, LOCATE( '\"\r', SUBSTRING( dyninfo, LOCATE( '\nyear=\"', dyninfo ) +7 )) - 1), '' ))) AS year -FROM t620 +FROM t1 HAVING year != '' ORDER BY year; + +DROP TABLE t1; diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index b04e614a740..2899c7c99a4 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -238,7 +238,7 @@ SELECT * FROM t1 WHERE a IN(1,2) AND b=5; DROP TABLE t1; # -# Test error with +# Test problem with range optimzer and sub ranges # CREATE TABLE t1 (a int, b int, c int, INDEX (c,a,b)); @@ -249,3 +249,17 @@ SELECT COUNT(*) FROM t1 WHERE (c=0 and a=1) or (c=0 and b=1); SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1); DROP TABLE t1; +# +# Test problem with range optimization over overlapping ranges (#2448) +# + +CREATE TABLE t1 ( a int not null, b int not null, INDEX ab(a,b) ); +INSERT INTO t1 VALUES (47,1), (70,1), (15,1), (15, 4); +SELECT * FROM t1 +WHERE +( + ( b =1 AND a BETWEEN 14 AND 21 ) OR + ( b =2 AND a BETWEEN 16 AND 18 ) OR + ( b =3 AND a BETWEEN 15 AND 19 ) OR + (a BETWEEN 19 AND 47) +); -- cgit v1.2.1 From 180fa5c2047e9162fd82993488257bb138f9d692 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Feb 2004 09:59:18 +0100 Subject: disabled atof() test as non-portable --- mysql-test/r/bigint.result | 3 --- mysql-test/t/bigint.test | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result index f96da579bce..308adc881f2 100644 --- a/mysql-test/r/bigint.result +++ b/mysql-test/r/bigint.result @@ -81,6 +81,3 @@ quantity 10000000000000000000 10000000000000000000 drop table t1; -SELECT '0x8000000000000001'+0; -'0x8000000000000001'+0 -0 diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test index 0092317dc5e..353e9fd44b1 100644 --- a/mysql-test/t/bigint.test +++ b/mysql-test/t/bigint.test @@ -60,5 +60,6 @@ insert into t1 values ('10000000000000000000'); select * from t1; drop table t1; -SELECT '0x8000000000000001'+0; +# atof() behaviour is different of different systems. to be fixed in 4.1 +#SELECT '0x8000000000000001'+0; -- cgit v1.2.1 From c8ff8ec18d96e0482b16a7b40182cfc34fea59db Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Feb 2004 17:42:18 +0100 Subject: beautify SHOW INDEX --- mysql-test/r/fulltext.result | 6 +++++- mysql-test/t/fulltext.test | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index e8ae9d3063f..651baad266e 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -5,6 +5,10 @@ INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'), ('Only MyISAM tables','support collections'), ('Function MATCH ... AGAINST()','is used to do a search'), ('Full-text search in MySQL', 'implements vector space model'); +SHOW INDEX FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 a 1 a A NULL NULL NULL YES FULLTEXT +t1 1 a 2 b A NULL NULL NULL YES FULLTEXT select * from t1 where MATCH(a,b) AGAINST ("collections"); a b Only MyISAM tables support collections @@ -183,7 +187,7 @@ id show keys from t2; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t2 1 tig 1 ticket A NULL NULL NULL YES BTREE -t2 1 tix 1 inhalt A NULL 1 NULL YES FULLTEXT +t2 1 tix 1 inhalt A NULL NULL NULL YES FULLTEXT show create table t2; Table Create Table t2 CREATE TABLE `t2` ( diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index e8f5d497692..02657ba3775 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -10,6 +10,7 @@ INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'), ('Only MyISAM tables','support collections'), ('Function MATCH ... AGAINST()','is used to do a search'), ('Full-text search in MySQL', 'implements vector space model'); +SHOW INDEX FROM t1; # nl search -- cgit v1.2.1 From 22b2067aa5cce55ea4652cb915f5ba99d9caa4a6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Feb 2004 21:35:20 +0400 Subject: added checking for bootstrap in select_send::send_data (fixed bug #2526 "--init-file crashes MySQL if contains large select") Such checking usually works in send_ok, send_eof, but in this case large result causes interim flushing. sql/sql_class.cc: added checking for bootstrap in select_send::send_data --- mysql-test/t/init_file-master.opt | 1 + mysql-test/t/init_file.sql | 1 + mysql-test/t/init_file.test | 12 ++++++++++++ 3 files changed, 14 insertions(+) create mode 100644 mysql-test/t/init_file-master.opt create mode 100644 mysql-test/t/init_file.sql create mode 100644 mysql-test/t/init_file.test (limited to 'mysql-test') diff --git a/mysql-test/t/init_file-master.opt b/mysql-test/t/init_file-master.opt new file mode 100644 index 00000000000..1542f1f034e --- /dev/null +++ b/mysql-test/t/init_file-master.opt @@ -0,0 +1 @@ +--init-file=$MYSQL_TEST_DIR/t/init_file.sql \ No newline at end of file diff --git a/mysql-test/t/init_file.sql b/mysql-test/t/init_file.sql new file mode 100644 index 00000000000..4236ada1142 --- /dev/null +++ b/mysql-test/t/init_file.sql @@ -0,0 +1 @@ +select * from mysql.user as t1, mysql.user as t2, mysql.user as t3, mysql.user as t4, mysql.user as t5, mysql.user as t6, mysql.user as t7, mysql.user as t8; \ No newline at end of file diff --git a/mysql-test/t/init_file.test b/mysql-test/t/init_file.test new file mode 100644 index 00000000000..8cfb8c490e2 --- /dev/null +++ b/mysql-test/t/init_file.test @@ -0,0 +1,12 @@ +# +# This test is first part of test init_file_part2.test (bug #2526) +# + +#DROP TABLE IF EXISTS t1; + +#CREATE TABLE t1 +#( +# i int(11) default NULL +#) TYPE=MyISAM; + +#INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); \ No newline at end of file -- cgit v1.2.1 From d295f07c4281a45fc45aff95a151aeee117b2d8a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Feb 2004 09:12:23 +0100 Subject: Added testing of pthread_key_delete (to fix compile problem on SCO) (Bug #2461) DROP DATABASE now assumes RAID directories are in hex. (Bug #2627) Don't increment 'select_full_range' and similar statistics for EXPLAIN queries. (Bug #2506) Test in configure if pthread_key_delete() exists (to fix compile problem on SCO) (Bug #2461) BUILD/compile-pentium-max: Added --with-raid configure.in: Added testing of pthread_key_delete (to fix compile problem on SCO) (Bug #2461) include/my_pthread.h: Added testing of pthread_key_delete (to fix compile problem on SCO) (Bug #2461) innobase/include/data0data.ic: Added missing newline mysql-test/r/raid.result: Test of DROP DATABASE with RAID directories in hex mysql-test/t/raid.test: Test of DROP DATABASE with RAID directories in hex sql/sql_db.cc: DROP DATABASE could not drop databases with RAID tables that had more than 9 RAID_CHUNKS because DROP DATABASE assumed raid tables where in decimal while the RAID CREATE code assumed directories was in hex.(Bug #2627) sql/sql_select.cc: Don't increment 'select_full_range' and similar statistics for EXPLAIN queries. (Bug #2506) sql/sql_udf.cc: mysqld crashed if mysql.func table didn't exists (Bug #2577) --- mysql-test/r/raid.result | 1 + mysql-test/t/raid.test | 1 + 2 files changed, 2 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/raid.result b/mysql-test/r/raid.result index fd47a9451f6..3d27a599cf3 100644 --- a/mysql-test/r/raid.result +++ b/mysql-test/r/raid.result @@ -1,5 +1,6 @@ create database test_raid; create table test_raid.r1 (i int) raid_type=1; +create table test_raid.r2 (i int) raid_type=1 raid_chunks=32; drop database test_raid; DROP TABLE IF EXISTS t1,t2; CREATE TABLE t1 ( diff --git a/mysql-test/t/raid.test b/mysql-test/t/raid.test index 4032993f2da..43ad58ab368 100644 --- a/mysql-test/t/raid.test +++ b/mysql-test/t/raid.test @@ -9,6 +9,7 @@ enable_query_log; create database test_raid; create table test_raid.r1 (i int) raid_type=1; +create table test_raid.r2 (i int) raid_type=1 raid_chunks=32; drop database test_raid; DROP TABLE IF EXISTS t1,t2; CREATE TABLE t1 ( -- cgit v1.2.1 From b911f9b0c0783e07f6bc9f091c9b5855730d88ba Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Feb 2004 17:52:41 +0400 Subject: code cleanup --- mysql-test/t/init_file.test | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/t/init_file.test b/mysql-test/t/init_file.test index 8cfb8c490e2..eb4c24871db 100644 --- a/mysql-test/t/init_file.test +++ b/mysql-test/t/init_file.test @@ -1,12 +1,4 @@ # -# This test is first part of test init_file_part2.test (bug #2526) +# This test is for bug #2526 "--init-file crashes MySQL if contains large select" +# Have a look at code in init_file.sql # - -#DROP TABLE IF EXISTS t1; - -#CREATE TABLE t1 -#( -# i int(11) default NULL -#) TYPE=MyISAM; - -#INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); \ No newline at end of file -- cgit v1.2.1 From 62a4ae0761bc76326e3afc3d4fb7d598e593c3e8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Feb 2004 23:36:54 +0100 Subject: - renamed mysql-test/t/init_file.sql to mysql-test/std_data/init_file.dat so it gets picked up by "make dist" and updated init_file test accordingly. mysql-test/std_data/init_file.dat: Rename: mysql-test/t/init_file.sql -> mysql-test/std_data/init_file.dat mysql-test/t/init_file-master.opt: - moved init file to std_data mysql-test/t/init_file.test: - updated info --- mysql-test/std_data/init_file.dat | 1 + mysql-test/t/init_file-master.opt | 2 +- mysql-test/t/init_file.sql | 1 - mysql-test/t/init_file.test | 7 +++++-- 4 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 mysql-test/std_data/init_file.dat delete mode 100644 mysql-test/t/init_file.sql (limited to 'mysql-test') diff --git a/mysql-test/std_data/init_file.dat b/mysql-test/std_data/init_file.dat new file mode 100644 index 00000000000..4236ada1142 --- /dev/null +++ b/mysql-test/std_data/init_file.dat @@ -0,0 +1 @@ +select * from mysql.user as t1, mysql.user as t2, mysql.user as t3, mysql.user as t4, mysql.user as t5, mysql.user as t6, mysql.user as t7, mysql.user as t8; \ No newline at end of file diff --git a/mysql-test/t/init_file-master.opt b/mysql-test/t/init_file-master.opt index 1542f1f034e..825311dabf2 100644 --- a/mysql-test/t/init_file-master.opt +++ b/mysql-test/t/init_file-master.opt @@ -1 +1 @@ ---init-file=$MYSQL_TEST_DIR/t/init_file.sql \ No newline at end of file +--init-file=$MYSQL_TEST_DIR/std_data/init_file.dat diff --git a/mysql-test/t/init_file.sql b/mysql-test/t/init_file.sql deleted file mode 100644 index 4236ada1142..00000000000 --- a/mysql-test/t/init_file.sql +++ /dev/null @@ -1 +0,0 @@ -select * from mysql.user as t1, mysql.user as t2, mysql.user as t3, mysql.user as t4, mysql.user as t5, mysql.user as t6, mysql.user as t7, mysql.user as t8; \ No newline at end of file diff --git a/mysql-test/t/init_file.test b/mysql-test/t/init_file.test index eb4c24871db..604d0a01794 100644 --- a/mysql-test/t/init_file.test +++ b/mysql-test/t/init_file.test @@ -1,4 +1,7 @@ # -# This test is for bug #2526 "--init-file crashes MySQL if contains large select" -# Have a look at code in init_file.sql +# This is a regression test for bug #2526 "--init-file crashes MySQL if it +# contains a large select" +# +# See mysql-test/std_data/init_file.dat and +# mysql-test/t/init_file-master.opt for the actual test # -- cgit v1.2.1 From b5819094a70fa1c4f9c231424af6792da0b7b801 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 Feb 2004 14:28:57 +0300 Subject: Fix for bug #2628 "ALTER TABLE destroys table and reports success" BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted mysql-test/r/alter_table.result: Fix for bug #2628: test result fixed mysql-test/t/alter_table.test: Fix for bug #2628: test case added sql/sql_table.cc: Fix for bug #2628: We need to take into account database name when checking if source and destination table names are equal. Note, that after merge to 4.0 we also need to check for lower_case_table_names. --- mysql-test/r/alter_table.result | 8 ++++++++ mysql-test/t/alter_table.test | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index dbdbb7f57a9..8b104225b9c 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -32,3 +32,11 @@ i 2 3 4 +name +current +name +mysqltest +name +current +name +mysqltest diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index dbfbd4267d8..cfb4f958372 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -82,3 +82,20 @@ alter table t1 drop i,add i int unsigned not null auto_increment, drop primary k select * from t1; drop table t1; +# +# Bug #2628: 'alter table t1 rename mysqltest.t1' silently drops mysqltest.t1 +# if it exists +# +create table t1 (name char(15)); +insert into t1 (name) values ("current"); +create database mysqltest; +create table mysqltest.t1 (name char(15)); +insert into mysqltest.t1 (name) values ("mysqltest"); +select * from t1; +select * from mysqltest.t1; +--error 1050 +alter table t1 rename mysqltest.t1; +select * from t1; +select * from mysqltest.t1; +drop table t1; +drop database mysqltest; -- cgit v1.2.1 From 854076da62146f6cb4861e5c5f49fe245d3efe08 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 Feb 2004 16:40:44 +0300 Subject: 3.23 -> 4.0 merge: after merge fixes --- mysql-test/r/alter_table.result | 13 +++++++++++++ mysql-test/r/func_math.result | 6 ++++++ mysql-test/r/insert_select.result | 19 +++++++++++++++++++ mysql-test/t/insert_select.test | 2 ++ 4 files changed, 40 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index b32e100df55..037d3420f76 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -350,11 +350,24 @@ t1 0 PRIMARY 1 Host A NULL NULL NULL BTREE t1 0 PRIMARY 2 User A 0 NULL NULL BTREE t1 1 Host 1 Host A NULL NULL NULL BTREE disabled DROP TABLE t1; +create table t1 (name char(15)); +insert into t1 (name) values ("current"); +create database mysqltest; +create table mysqltest.t1 (name char(15)); +insert into mysqltest.t1 (name) values ("mysqltest"); +select * from t1; name current +select * from mysqltest.t1; name mysqltest +alter table t1 rename mysqltest.t1; +Table 't1' already exists +select * from t1; name current +select * from mysqltest.t1; name mysqltest +drop table t1; +drop database mysqltest; diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index e37862d0176..46ad7a14e25 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -41,15 +41,21 @@ pi() sin(pi()/2) cos(pi()/2) abs(tan(pi())) cot(1) asin(1) acos(0) atan(1) select degrees(pi()),radians(360); degrees(pi()) radians(360) 180 6.2831853071796 +SELECT ACOS(1.0); ACOS(1.0) 0.000000 +SELECT ASIN(1.0); ASIN(1.0) 1.570796 +SELECT ACOS(0.2*5.0); ACOS(0.2*5.0) 0.000000 +SELECT ACOS(0.5*2.0); ACOS(0.5*2.0) 0.000000 +SELECT ASIN(0.8+0.2); ASIN(0.8+0.2) 1.570796 +SELECT ASIN(1.2-0.2); ASIN(1.2-0.2) 1.570796 diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result index c5b98976fd6..a10e7fc02bb 100644 --- a/mysql-test/r/insert_select.result +++ b/mysql-test/r/insert_select.result @@ -592,15 +592,34 @@ CREATE TABLE t2 ( USID INTEGER UNSIGNED AUTO_INCREMENT, ServerID TINYINT UNSIGNE INSERT INTO t1 VALUES (39,42,'Access-Granted','46','491721000045',2130706433,17690,NULL,NULL,'Localnet','491721000045','49172200000',754974766,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2003-07-18 00:11:21',NULL,NULL,20030718001121); INSERT INTO t2 SELECT USID, ServerID, State, SessionID, User, NASAddr, NASPort, NASPortType, ConnectSpeed, CarrierType, CallingStationID, CalledStationID, AssignedAddr, SessionTime, PacketsIn, OctetsIn, PacketsOut, OctetsOut, TerminateCause, UnauthTime, AccessRequestTime, AcctStartTime, AcctLastTime, LastModification from t1 LIMIT 1; drop table t1,t2; +CREATE TABLE t1( +Month date NOT NULL, +Type tinyint(3) unsigned NOT NULL auto_increment, +Field int(10) unsigned NOT NULL, +Count int(10) unsigned NOT NULL, +UNIQUE KEY Month (Month,Type,Field) +); +insert into t1 Values +(20030901, 1, 1, 100), +(20030901, 1, 2, 100), +(20030901, 2, 1, 100), +(20030901, 2, 2, 100), +(20030901, 3, 1, 100); +select * from t1; Month Type Field Count 2003-09-01 1 1 100 2003-09-01 1 2 100 2003-09-01 2 1 100 2003-09-01 2 2 100 2003-09-01 3 1 100 +Select null, Field, Count From t1 Where Month=20030901 and Type=2; NULL Field Count NULL 1 100 NULL 2 100 +create table t2(No int not null, Field int not null, Count int not null); +insert into t2 Select null, Field, Count From t1 Where Month=20030901 and Type=2; +select * from t2; No Field Count 0 1 100 0 2 100 +drop table t1, t2; diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test index 3a8118f7fff..d9a8cfaf1be 100644 --- a/mysql-test/t/insert_select.test +++ b/mysql-test/t/insert_select.test @@ -132,6 +132,8 @@ CREATE TABLE t2 ( USID INTEGER UNSIGNED AUTO_INCREMENT, ServerID TINYINT UNSIGNE INSERT INTO t1 VALUES (39,42,'Access-Granted','46','491721000045',2130706433,17690,NULL,NULL,'Localnet','491721000045','49172200000',754974766,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2003-07-18 00:11:21',NULL,NULL,20030718001121); INSERT INTO t2 SELECT USID, ServerID, State, SessionID, User, NASAddr, NASPort, NASPortType, ConnectSpeed, CarrierType, CallingStationID, CalledStationID, AssignedAddr, SessionTime, PacketsIn, OctetsIn, PacketsOut, OctetsOut, TerminateCause, UnauthTime, AccessRequestTime, AcctStartTime, AcctLastTime, LastModification from t1 LIMIT 1; drop table t1,t2; + +# # Another problem from Bug #2012 # -- cgit v1.2.1 From 7db76e5a16796f4cf55bc95418807644d2dd6d17 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 Feb 2004 20:57:11 +0400 Subject: fixed bug #1378 "mysqlbinlog for remote host is broken" client/mysqlbinlog.cc: fixed bug #1378 "mysqlbinlog for remote host is broken" by using shared part of code for local and remote variant (function process_event) mysql-test/r/mysqlbinlog.result: fixed results for remote variant (they are the same as for local now) mysql-test/t/mysqlbinlog.test: discarded note 'V. Vagin should ...' because V.Vagin done sql/log_event.cc: added special local_fname flag to Load_log_event for using in Load_log_event::check_fname_outside_temp_buf instead of ugly condition sql/log_event.h: added special local_fname flag to Load_log_event for using in Load_log_event::check_fname_outside_temp_buf instead of ugly condition --- mysql-test/r/mysqlbinlog.result | 17 ++++++----------- mysql-test/t/mysqlbinlog.test | 4 ---- 2 files changed, 6 insertions(+), 15 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index eeac31ba40b..f604aa0589e 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -54,6 +54,12 @@ insert into t1 values ("abirvalg"); SET INSERT_ID=1; SET TIMESTAMP=1000000000; insert into t2 values (); +LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-1-1' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word); +LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-2-1' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word); +LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-3-1' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word); +LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-4-1' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word); +LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-5-1' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word); +LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-6-1' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word); SET TIMESTAMP=1000000000; insert into t1 values ("Alas"); @@ -63,18 +69,7 @@ SET TIMESTAMP=1000000000; insert into t1 values ("Alas"); --- --database -- -use test; -SET TIMESTAMP=1000000000; -create table t1 (word varchar(20)); -SET TIMESTAMP=1000000000; -create table t2 (id int auto_increment not null primary key); -SET TIMESTAMP=1000000000; -insert into t1 values ("abirvalg"); SET INSERT_ID=1; -SET TIMESTAMP=1000000000; -insert into t2 values (); -SET TIMESTAMP=1000000000; -insert into t1 values ("Alas"); --- --position -- use test; diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index e22a37fabfd..228233923fe 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -64,10 +64,6 @@ select "--- --position --" as ""; # These are tests for remote binlog. # They should return the same as previous test. -# But now they are not. V. Vagin should fix this. -# We test all the same options second time since code for remote case is -# essentially different. If code for both cases will be unified we'll be -# able to throw out most of this. --disable_query_log select "--- Remote --" as ""; -- cgit v1.2.1