From 6dda32572379ff2f456e865a0e49c416f21fa7ef 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/t/insert_select.test | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'mysql-test/t') 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 4d5170d20cfed71b753fcb181d009f4e1601ba2e 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/t/variables.test | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mysql-test/t') 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 249910abec372c7048403c37d5aff7b31f760b3e 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/t/lowercase_table2-master.opt | 1 + mysql-test/t/lowercase_table2.test | 80 ++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 mysql-test/t/lowercase_table2-master.opt create mode 100644 mysql-test/t/lowercase_table2.test (limited to 'mysql-test/t') 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 a62e02c387df971b340654f4fb9e4a05f094e5ec 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/t/func_like.test | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mysql-test/t') 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 3ceb912a5c0c2751c4f15ebad7c26c7be27366d5 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/t/func_like.test | 1 + 1 file changed, 1 insertion(+) (limited to 'mysql-test/t') 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 001205fd0d8c729dd410e650c33c7297db41f64e 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/t/type_year.test | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mysql-test/t') 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 3dfd2f176caf2098aae365b8daf4bf3f0acf03b2 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/t/type_blob.test | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mysql-test/t') 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 024328953d54431a0fe0dc1dee21d8b5d4dac21f 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/t/func_math.test | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'mysql-test/t') 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 770e1182ab6bc7e45d7945577af6f51a8701da21 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/t/handler.test | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'mysql-test/t') 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 e7fc052e93d49012bf8cee616e82914f38d6b4ed 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/t/range.test | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mysql-test/t') 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 53ce0cb18c1602aa6aaf489d0fa9f03eb7e5e3aa 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/t/myisam-blob-master.opt | 1 + mysql-test/t/myisam-blob.test | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 mysql-test/t/myisam-blob-master.opt create mode 100644 mysql-test/t/myisam-blob.test (limited to 'mysql-test/t') 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 28a8a9ea5f30e8d9c25ecb87475dcbe2e7275362 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/t/func_str.test | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mysql-test/t') 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 344bdd2af466299543305809a32640462343a7b9 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/t/myisam.test | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mysql-test/t') 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 4ed2ba5f8ab0bd1ec59f96a927b70c94732a0435 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/t/myisam.test | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mysql-test/t') 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 a564332609712f1588ff13266bdb731dffcc0c9d 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/t/myisam.test | 11 +++++++++++ mysql-test/t/range.test | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'mysql-test/t') 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 ef325a4704e9aabe09f773528f6496a94298396f 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/t/select.test | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'mysql-test/t') 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 a37384fb26042888c172ecd2b040b5954993c936 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/t') 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 ffed2b74789ca1ca4f56a13a6ae8d80e4bd6a6a1 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/t/bdb.test | 14 ++++++++++++++ mysql-test/t/myisam.test | 18 +++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) (limited to 'mysql-test/t') 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 ebbd056fd904e2deb06c72b132675d6768f531ba 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/t/rpl_multi_delete-slave.opt | 1 + mysql-test/t/rpl_multi_delete.test | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) 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/t') 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 e7a906466492beae3d7bf24a8b3916849a4c4ac4 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/t/rpl_heap.test | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 mysql-test/t/rpl_heap.test (limited to 'mysql-test/t') 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 3fd91ecaf74bf86acb0cca35e2fba25185b8a4a5 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/t/innodb.test | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mysql-test/t') 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 4d83e9d1382bfd351bae40aad530fe9687056bb7 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/t/type_timestamp.test | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'mysql-test/t') 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 241a65e921dac7b596bb0b1ca56695fe50c45ef2 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/t/timezone.test | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mysql-test/t') 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 afc522ec0fa7c11f84a1b7f21e1cf24c6ac9070f 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/t/innodb.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test/t') 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 66ed24b9045df3bf35c8285464b99b342867a065 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/t/rpl_insert_id.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test/t') 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 1ad277ca4d15a846e98f87680b008f625b4dcdce Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Feb 2004 15:57:57 +0100 Subject: test added --- mysql-test/t/bigint.test | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mysql-test/t') 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 dccf911f3786cbc43492d364168661a4c95ffe84 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/t/lock.test | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mysql-test/t') 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 294c2abe3f2ac6e26fe4e3954ea30f9175413cd8 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/t/ctype_tis620-master.opt | 1 + mysql-test/t/ctype_tis620.test | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 mysql-test/t/ctype_tis620-master.opt create mode 100644 mysql-test/t/ctype_tis620.test (limited to 'mysql-test/t') 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 2c11b71ca04501dfd93ff03367afe79fcd26d5fd 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/t/ctype_tis620.test | 17 +++++++++++------ mysql-test/t/range.test | 16 +++++++++++++++- 2 files changed, 26 insertions(+), 7 deletions(-) (limited to 'mysql-test/t') 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 5a5a5998ae721a1d5642f103fb46e5055cf92cc4 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/t/bigint.test | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mysql-test/t') 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 a0755543cbbf7710b4d2dd0ce821294346495867 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Feb 2004 17:42:18 +0100 Subject: beautify SHOW INDEX --- mysql-test/t/fulltext.test | 1 + 1 file changed, 1 insertion(+) (limited to 'mysql-test/t') 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 7f1e2e48fb96acadd8d8dcd2d20bb069dbfad536 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/t') 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 d4b5442272e83909820fb99dc51b7877cba3c975 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/t/raid.test | 1 + 1 file changed, 1 insertion(+) (limited to 'mysql-test/t') 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 fb6cbfe09f0c1911ae8c22e1f98f26a5c9fb4a20 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/t') 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 664a503dbf8627cd66d75d2f03cff051b13afaee 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/t/init_file-master.opt | 2 +- mysql-test/t/init_file.sql | 1 - mysql-test/t/init_file.test | 7 +++++-- 3 files changed, 6 insertions(+), 4 deletions(-) delete mode 100644 mysql-test/t/init_file.sql (limited to 'mysql-test/t') 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 726254d56490bc26e6f492d7824e9fba93c65606 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/t/alter_table.test | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'mysql-test/t') 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 736b845ae789d25aa108364b6a974a2b164bab7e 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/t/insert_select.test | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mysql-test/t') 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 50733a126ae4818d6a836c70d0f379e41f6908f7 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/t/mysqlbinlog.test | 4 ---- 1 file changed, 4 deletions(-) (limited to 'mysql-test/t') 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