From 0741a4d1b0fa15865fd7bd1a3e8a785d388dd69b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Oct 2007 15:32:07 +0300 Subject: Removed extra spaces Added extra debug client/mysql_upgrade.c: Removed extra space client/mysqlcheck.c: Removed extra space client/mysqldump.c: Removed extra space client/mysqlimport.c: Removed extra space client/mysqlshow.c: Removed extra space client/mysqlslap.c: Removed extra space client/mysqltest.c: Removed extra space sql/handler.cc: Added extra debug --- mysql-test/t/bdb_notembedded.test | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 mysql-test/t/bdb_notembedded.test (limited to 'mysql-test/t') diff --git a/mysql-test/t/bdb_notembedded.test b/mysql-test/t/bdb_notembedded.test new file mode 100644 index 00000000000..24e64ebbfb2 --- /dev/null +++ b/mysql-test/t/bdb_notembedded.test @@ -0,0 +1,38 @@ +-- source include/not_embedded.inc +-- source include/have_bdb.inc + +# +# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode +# +set autocommit=1; + +let $VERSION=`select version()`; + +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +set autocommit=0; + + +--echo End of 5.0 tests -- cgit v1.2.1 From 272bb6b5856a7f033e6826ba5a96b1ca52aabb12 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Oct 2007 12:46:38 +0500 Subject: Bug#27580 SPACE() function collation bug? Problem: when character_set_connection=utf8, mixing SPACE() with a non-Unicode column (e.g. for concat) produced "illegal mix of collations" error. Fix: Item_string() corresponding to space character is now created using "ASCII" repertoire. Previously it was incorrectly created using "UNICODE" repertoure, which didn't allow to convert results of SPACE() to a non-Unicode character set. mysql-test/include/ctype_common.inc: - Adding test for bug#27580 - Restoring previous values of character_set_client and character_set_results, because ctype_common.inc now changes them when doing "set names utf8" in the test for bug#27580 mysql-test/r/ctype_big5.result: Adding test mysql-test/r/ctype_cp1250_ch.result: Adding test mysql-test/r/ctype_euckr.result: Adding test mysql-test/r/ctype_gb2312.result: Adding test mysql-test/r/ctype_gbk.result: Adding test mysql-test/r/ctype_uca.result: Adding test mysql-test/r/ctype_ucs.result: Adding test mysql-test/t/ctype_cp1250_ch.test: Adding test mysql-test/t/ctype_ucs.test: Adding test sql/item_create.cc: Item for SQL function SPACE() is now created with ASCII repertoire, to allow automatic conversion from UTF8 to column's character set e.g. for CONCAT(). --- mysql-test/t/ctype_cp1250_ch.test | 10 ++++++++++ mysql-test/t/ctype_ucs.test | 4 ++++ 2 files changed, 14 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/ctype_cp1250_ch.test b/mysql-test/t/ctype_cp1250_ch.test index 86eb8c31d99..b3daa8a02a2 100644 --- a/mysql-test/t/ctype_cp1250_ch.test +++ b/mysql-test/t/ctype_cp1250_ch.test @@ -6,6 +6,16 @@ DROP TABLE IF EXISTS t1; SHOW COLLATION LIKE 'cp1250_czech_cs'; +SET @test_character_set= 'cp1250'; +SET @test_collation= 'cp1250_general_ci'; +-- source include/ctype_common.inc + +SET @test_character_set= 'cp1250'; +SET @test_collation= 'cp1250_czech_cs'; +-- source include/ctype_common.inc + + + # # Bugs: #8840: Empty string comparison and character set 'cp1250' # diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index bca3a9c3a96..17d9f71e316 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -4,6 +4,10 @@ DROP TABLE IF EXISTS t1; --enable_warnings +SET @test_character_set= 'ucs2'; +SET @test_collation= 'ucs2_general_ci'; +-- source include/ctype_common.inc + SET NAMES latin1; SET character_set_connection=ucs2; -- source include/endspace.inc -- cgit v1.2.1 From 510bda4bed61e3fc96249e693532874e21b1f274 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Dec 2007 17:40:42 +0400 Subject: BUG#25677 - With --skip-symbolic-links option on, DATA DIRECTORY clause is silently ignored When symbolic links are disabled by command line option or NO_DIR_IN_CREATE sql mode, CREATE TABLE silently ignores DATA/INDEX DIRECTORY options. With this fix a warning is issued when symbolic links are disabled. mysql-test/r/symlink.result: A test case for BUG#25677. mysql-test/t/symlink.test: A test case for BUG#25677. sql/sql_parse.cc: Moved handling of situation when mysqld is compiled without HAVE_READLINK to mysql_create_table_no_lock(). sql/sql_table.cc: Issue a warning in case DATA/INDEX DIRECTORY is specified and: - server is compiled without HAVE_READLINK; - using symbolic links is disabled by command line option; - using symbolic links is disabled by NO_DIR_IN_CREATE sql mode. --- mysql-test/t/bdb_notembedded.test | 38 ++++++++++++++++++++++++++++++++++++++ mysql-test/t/symlink.test | 12 ++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 mysql-test/t/bdb_notembedded.test (limited to 'mysql-test/t') diff --git a/mysql-test/t/bdb_notembedded.test b/mysql-test/t/bdb_notembedded.test new file mode 100644 index 00000000000..24e64ebbfb2 --- /dev/null +++ b/mysql-test/t/bdb_notembedded.test @@ -0,0 +1,38 @@ +-- source include/not_embedded.inc +-- source include/have_bdb.inc + +# +# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode +# +set autocommit=1; + +let $VERSION=`select version()`; + +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +set autocommit=0; + + +--echo End of 5.0 tests diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test index f339b29c83a..eaad45d7d5d 100644 --- a/mysql-test/t/symlink.test +++ b/mysql-test/t/symlink.test @@ -226,3 +226,15 @@ USE test; --echo End of 5.0 tests + +# +# BUG#25677 - With --skip-symbolic-links option on, DATA DIRECTORY clause is +# silently ignored +# +SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE='NO_DIR_IN_CREATE'; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval CREATE TABLE t1(a INT) DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY='$MYSQLTEST_VARDIR/tmp'; +DROP TABLE t1; +SET @@SQL_MODE=@OLD_SQL_MODE; + +--echo End of 5.1 tests -- cgit v1.2.1 From 53f762abfd26e432477016f00cd984e2c6c9e2d1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Dec 2007 12:29:50 +0100 Subject: Bug#32705 - myisam corruption: Key in wrong position at page 1024 with ucs2_bin Inserting strings with a common prefix into a table with characterset UCS2 corrupted the table. An efficient search method was used, which compares end space with ASCII blank. This doesn't work for character sets like UCS2, which do not encode blank like ASCII does. Use the less efficient search method _mi_seq_search() for charsets with mbminlen > 1. myisam/mi_open.c: Bug#32705 - myisam corruption: Key in wrong position at page 1024 with ucs2_bin Use _mi_seq_search() for charsets with mbminlen > 1. mysql-test/r/myisam.result: Bug#32705 - myisam corruption: Key in wrong position at page 1024 with ucs2_bin Added test result. mysql-test/t/myisam.test: Bug#32705 - myisam corruption: Key in wrong position at page 1024 with ucs2_bin Added test. --- mysql-test/t/myisam.test | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 80c7a92c12f..b182c35514c 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1193,4 +1193,17 @@ SET @@myisam_repair_threads=1; CHECK TABLE t1 EXTENDED; DROP TABLE t1; +# +# Bug#32705 - myisam corruption: Key in wrong position +# at page 1024 with ucs2_bin +# +CREATE TABLE t1 ( + c1 CHAR(255) CHARACTER SET UCS2 COLLATE UCS2_BIN NOT NULL, + KEY(c1) + ) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('marshall\'s'); +INSERT INTO t1 VALUES ('marsh'); +CHECK TABLE t1 EXTENDED; +DROP TABLE t1; + --echo End of 5.0 tests -- cgit v1.2.1 From fa01e8845b6b75c0d5f1f564ff5705a2c3735468 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 4 Jan 2008 12:06:20 +0100 Subject: Bug#30459 Partitioning across disks failing on Windows Problem was that there are no support for symlinked files on Windows for mysqld. So we fail when trying to create them. Solution: Ignore the DATA/INDEX DIRECTORY clause for partitions and push a warning. (Just like a MyISAM table) mysql-test/r/partition.result: Bug#30459 Partitioning across disks failing on Windows Moved symlink specific tests to partition_symlink result file mysql-test/r/partition_symlink.result: Bug#30459 Partitioning across disks failing on Windows Moved symlink specific tests from partition.test result file mysql-test/r/partition_windows.result: Bug#30459 Partitioning across disks failing on Windows result file mysql-test/t/partition.test: Bug#30459 Partitioning across disks failing on Windows Moved symlink specific tests to partition_symlink test file mysql-test/t/partition_symlink.test: Bug#30459 Partitioning across disks failing on Windows Moved symlink specific tests from partition.test test file mysql-test/t/partition_windows.test: Bug#30459 Partitioning across disks failing on Windows test file --- mysql-test/t/partition.test | 47 ---------------------------------- mysql-test/t/partition_symlink.test | 50 ++++++++++++++++++++++++++++++++++++- mysql-test/t/partition_windows.test | 37 +++++++++++++++++---------- 3 files changed, 73 insertions(+), 61 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 23d6c5f8865..183b348d473 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -78,24 +78,6 @@ create table t1 (a int) partition by key(a) partitions 1e+300; -# -# Bug 21350: Data Directory problems -# --- error ER_WRONG_TABLE_NAME -create table t1 (a int) -partition by key (a) -(partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data'); - -# -# Insert a test that manages to create the first partition and fails with -# the second, ensure that we clean up afterwards in a proper manner. -# ---error ER_WRONG_TABLE_NAME -create table t1 (a int) -partition by key (a) -(partition p0, - partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data'); - # # Bug 19309 Partitions: Crash if double procedural alter # @@ -1398,35 +1380,6 @@ SELECT t2.id FROM t2 WHERE t2.id IN (SELECT id FROM t1 WHERE status = 'Verified' drop table t1, t2; -# -# Bug #24633 SQL MODE "NO_DIR_IN_CREATE" does not work with partitioned tables -# - -disable_query_log; -eval create table t2 (i int ) -partition by range (i) -( - partition p01 values less than (1000) - data directory="$MYSQLTEST_VARDIR/master-data/test/" - index directory="$MYSQLTEST_VARDIR/master-data/test/" -); -enable_query_log; - -set @org_mode=@@sql_mode; -set @@sql_mode='NO_DIR_IN_CREATE'; -select @@sql_mode; -create table t1 (i int ) -partition by range (i) -( - partition p01 values less than (1000) - data directory='/not/existing' - index directory='/not/existing' -); - -show create table t2; -DROP TABLE t1, t2; -set @@sql_mode=@org_mode; - # # Bug #27123 partition + on duplicate key update + varchar = Can't find record in # diff --git a/mysql-test/t/partition_symlink.test b/mysql-test/t/partition_symlink.test index ab779ec2b68..ec809a34090 100644 --- a/mysql-test/t/partition_symlink.test +++ b/mysql-test/t/partition_symlink.test @@ -2,7 +2,9 @@ # (DATA/INDEX DIR requires symlinks) -- source include/have_partition.inc -- source include/have_symlink.inc -# remove the not_windows line after fixing bug#30459 +# remove the not_windows line after fixing bug#33687 +# symlinks must also work for files, not only directories +# as in --skip-symbolic-links -- source include/not_windows.inc -- disable_warnings DROP TABLE IF EXISTS t1; @@ -118,4 +120,50 @@ connection default; DROP USER mysqltest_1@localhost; disconnect con1; +# +# Bug #24633 SQL MODE "NO_DIR_IN_CREATE" does not work with partitioned tables +# + +disable_query_log; +eval create table t2 (i int ) +partition by range (i) +( + partition p01 values less than (1000) + data directory="$MYSQLTEST_VARDIR/master-data/test/" + index directory="$MYSQLTEST_VARDIR/master-data/test/" +); +enable_query_log; + +set @org_mode=@@sql_mode; +set @@sql_mode='NO_DIR_IN_CREATE'; +select @@sql_mode; +create table t1 (i int ) +partition by range (i) +( + partition p01 values less than (1000) + data directory='/not/existing' + index directory='/not/existing' +); + +show create table t2; +DROP TABLE t1, t2; +set @@sql_mode=@org_mode; + +# +# Bug 21350: Data Directory problems +# +-- error ER_WRONG_TABLE_NAME +create table t1 (a int) +partition by key (a) +(partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data'); + +# +# Insert a test that manages to create the first partition and fails with +# the second, ensure that we clean up afterwards in a proper manner. +# +--error ER_WRONG_TABLE_NAME +create table t1 (a int) +partition by key (a) +(partition p0, + partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data'); diff --git a/mysql-test/t/partition_windows.test b/mysql-test/t/partition_windows.test index a0723feac44..d42a7383c99 100644 --- a/mysql-test/t/partition_windows.test +++ b/mysql-test/t/partition_windows.test @@ -7,23 +7,34 @@ # # Bug 25141: Crash Server on Partitioning command # +# Bug#30459: Partitioning across disks failing on Windows +# updated this test, since symlinked files are not supported on Windows +# (not the same as symlinked directories that have a special hack +# on windows). This test is not dependent on have_symlink. --disable_warnings -DROP TABLE IF EXISTS `example`; +DROP TABLE IF EXISTS t1; --enable_warnings ---disable_abort_on_error -CREATE TABLE `example` ( - `ID_EXAMPLE` int(10) unsigned NOT NULL AUTO_INCREMENT, - `DESCRIPTION` varchar(30) NOT NULL, - `LEVEL` smallint(5) unsigned DEFAULT NULL, - PRIMARY KEY (`ID_EXAMPLE`) +CREATE TABLE t1 ( + c1 int(10) unsigned NOT NULL AUTO_INCREMENT, + c2 varchar(30) NOT NULL, + c3 smallint(5) unsigned DEFAULT NULL, + PRIMARY KEY (c1) ) ENGINE = MYISAM -PARTITION BY HASH(ID_EXAMPLE)( -PARTITION p0 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p0Data', -PARTITION p1 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p1Data', -PARTITION p2 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p2Data', -PARTITION p3 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p3Data' +PARTITION BY HASH(c1)( + PARTITION p0 + DATA DIRECTORY = 'C:/mysqltest/p0Data' + INDEX DIRECTORY = 'D:/mysqltest/p0Index', + PARTITION p1, + PARTITION p2 + DATA DIRECTORY = 'E:/mysqltest/p2Data' + INDEX DIRECTORY = 'F:/mysqltest/p2Index' ); ---enable_abort_on_error +INSERT INTO t1 VALUES (NULL, "first", 1); +INSERT INTO t1 VALUES (NULL, "second", 2); +INSERT INTO t1 VALUES (NULL, "third", 3); +ALTER TABLE t1 ADD PARTITION (PARTITION p3 DATA DIRECTORY = 'G:/mysqltest/p3Data' INDEX DIRECTORY = 'H:/mysqltest/p3Index'); +INSERT INTO t1 VALUES (NULL, "last", 4); +DROP TABLE t1; -- cgit v1.2.1 From d84a0e5caa26602b282695b52417cf7d9b667e7e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 9 Jan 2008 13:15:50 +0100 Subject: Bug#31931 Partitions: unjustified 'mix of handlers' error message Problem was that the mix of handlers was not consistent between CREATE and ALTER changed so that it works like: - All partitions must use the same engine AND it must be the same as the table. - if one does NOT specify an engine on the table level then one must either NOT specify any engine on any partition/subpartition OR for ALL partitions/subpartitions Note: that after a table have been created, the storage engine is specified for all parts of the table (table/partition/subpartition) and so when using alter, one does not need to specify it (unless one wants to change the storage engine, then one have to specify it on the table level) mysql-test/r/partition.result: Bug#31931 Partitions: unjustified 'mix of handlers' error message test result updated mysql-test/r/partition_innodb.result: Bug#31931 Partitions: unjustified 'mix of handlers' error message test result updated mysql-test/suite/ndb/r/ndb_partition_key.result: Bug#31931 Partitions: unjustified 'mix of handlers' error message test result updated mysql-test/suite/ndb/t/ndb_partition_key.test: Bug#31931 Partitions: unjustified 'mix of handlers' error message test case update mysql-test/suite/parts/inc/partition_engine.inc: Bug#31931 Partitions: unjustified 'mix of handlers' error message test case updated mysql-test/suite/parts/r/ndb_partition_key.result: Bug#31931 Partitions: unjustified 'mix of handlers' error message test result updated mysql-test/suite/parts/r/partition_engine_innodb.result: Bug#31931 Partitions: unjustified 'mix of handlers' error message test result updated mysql-test/suite/parts/r/partition_engine_myisam.result: Bug#31931 Partitions: unjustified 'mix of handlers' error message test result updated mysql-test/suite/parts/t/ndb_partition_key.test: Bug#31931 Partitions: unjustified 'mix of handlers' error message test case updated mysql-test/t/partition.test: Bug#31931 Partitions: unjustified 'mix of handlers' error message test case updated mysql-test/t/partition_innodb.test: Bug#31931 Partitions: unjustified 'mix of handlers' error message test case updated sql/partition_info.cc: Bug#31931 Partitions: unjustified 'mix of handlers' error message moved the check_engine_condition here from sql_partition.cc created a new check_engine_mix from check_native_partitioned in sql_partition.cc sql/partition_info.h: Bug#31931 Partitions: unjustified 'mix of handlers' error message non static function check_engine_mix (now used in sql_partition.cc) sql/sql_partition.cc: Bug#31931 Partitions: unjustified 'mix of handlers' error message moved check_engine_condition to partition_info.cc and moved out some common code in check_native_partitioned to check_engine_mix in partition_info.cc --- mysql-test/t/partition.test | 7 +++++-- mysql-test/t/partition_innodb.test | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 23d6c5f8865..1ba8402cdf0 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -49,6 +49,7 @@ create table t1 (id int auto_increment, s1 int, primary key (id)); insert into t1 values (null,1); insert into t1 values (null,6); +-- sorted_result select * from t1; alter table t1 partition by range (id) ( @@ -618,12 +619,14 @@ partition by key (a) (partition p0, partition p1); show create table t1; ---error ER_MIX_HANDLER_ERROR +# Since alter, it already have ENGINE=HEAP from before on table level +# -> OK alter table t1 partition by key(a) (partition p0, partition p1 engine=heap); ---error ER_MIX_HANDLER_ERROR +# Since alter, it already have ENGINE=HEAP from before on table level +# -> OK alter table t1 partition by key(a) (partition p0 engine=heap, partition p1); diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index 58010f85ecf..5445be6019e 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -86,6 +86,7 @@ engine = innodb partition by list (a) (partition p0 values in (0)); +-- error ER_MIX_HANDLER_ERROR alter table t1 engine = x; show create table t1; drop table t1; @@ -164,8 +165,10 @@ DROP TABLE t1; create table t1 (int_column int, char_column char(5)) PARTITION BY RANGE (int_column) subpartition by key (char_column) subpartitions 2 (PARTITION p1 VALUES LESS THAN (5) ENGINE = InnoDB); -alter table t1 PARTITION BY RANGE (int_column) +alter table t1 +ENGINE = MyISAM +PARTITION BY RANGE (int_column) subpartition by key (char_column) subpartitions 2 - (PARTITION p1 VALUES LESS THAN (5) ENGINE = myisam); + (PARTITION p1 VALUES LESS THAN (5)); show create table t1; drop table t1; -- cgit v1.2.1 From c3bf70215b4515c2fcf21bbb9a93aaf66d8c3faf Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Jan 2008 17:59:45 +0100 Subject: Bug#33222 - myisam-table drops rows when column is added and a char-field > 128 exists CHECK TABLE (non-QUICK) and any form of repair table did wrongly rate records as corrupted under the following conditions: 1. The table has dynamic row format and 2. it has a CHAR like column > 127 bytes (but not VARCHAR) (for multi-byte character sets this could be less than 127 characters) and 3. it has records with > 127 bytes significant length in that column (a byte beyond byte position 127 must be non-space). Affected were the statements CHECK TABLE, REPAIR TABLE, OPTIMIZE TABLE, ALTER TABLE. CHECK TABLE reported and marked the table as crashed if any record was present that fulfilled condition 3. The other statements deleted these records. The problem was a signed/unsigned compare in MyISAM code. A char to uchar change became necessary after the big byte to uchar change. mysql-test/r/myisam.result: Bug#33222 - myisam-table drops rows when column is added and a char-field > 128 exists Added test result. mysql-test/t/myisam.test: Bug#33222 - myisam-table drops rows when column is added and a char-field > 128 exists Added test. storage/myisam/mi_dynrec.c: Bug#33222 - myisam-table drops rows when column is added and a char-field > 128 exists char -> uchar became necessary after big byte -> uchar change. Fixed some small coding style violations near the changes. --- mysql-test/t/myisam.test | 170 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index cadab8b3b70..334ecfd02d3 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1261,5 +1261,175 @@ DELETE FROM t1 WHERE c1 >= 10; CHECK TABLE t1; DROP TABLE t1; +# +# Bug#33222 - myisam-table drops rows when column is added +# and a char-field > 128 exists +# +# Test #1 - CHECK TABLE sees wrong record, REPAR TABLE deletes it. +# Using a CHAR column that can have > 127 characters. +# Using a VARCHAR to create a table with dynamic row format. +CREATE TABLE t1 ( + c1 CHAR(130), + c2 VARCHAR(1) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES(REPEAT("a",128), 'b'); +SELECT COUNT(*) FROM t1; +CHECK TABLE t1; +REPAIR TABLE t1; +SELECT COUNT(*) FROM t1; +CHECK TABLE t1; +DROP TABLE t1; +# +# Test #2 - same as test #1, but using EXTENDED. +# Using a CHAR column that can have > 127 characters. +# Using a VARCHAR to create a table with dynamic row format. +CREATE TABLE t1 ( + c1 CHAR(130), + c2 VARCHAR(1) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES(REPEAT("a",128), 'b'); +SELECT COUNT(*) FROM t1; +CHECK TABLE t1 EXTENDED; +REPAIR TABLE t1 EXTENDED; +SELECT COUNT(*) FROM t1; +CHECK TABLE t1 EXTENDED; +DROP TABLE t1; +# +# Test #3 - same as test #1, but using OPTIMIZE TABLE. +# Using a CHAR column that can have > 127 characters. +# Using a VARCHAR to create a table with dynamic row format. +CREATE TABLE t1 ( + c1 CHAR(130), + c2 VARCHAR(1) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES(REPEAT("a",128), 'b'); +# Insert more rows and delete one in the middle to force optimize. +INSERT INTO t1 VALUES('b', 'b'); +INSERT INTO t1 VALUES('c', 'b'); +DELETE FROM t1 WHERE c1='b'; +SELECT COUNT(*) FROM t1; +OPTIMIZE TABLE t1; +SELECT COUNT(*) FROM t1; +DROP TABLE t1; +# +# Test #4 - ALTER TABLE deletes rows. +# Using a CHAR column that can have > 127 characters. +# Using a VARCHAR to create a table with dynamic row format. +# Using an index which can be disabled during bulk insert. +CREATE TABLE t1 ( + c1 CHAR(130), + c2 VARCHAR(1), + KEY (c1) +) ENGINE=MyISAM; +# +# Insert 100 rows. This turns bulk insert on during the copy phase of +# ALTER TABLE. Bulk insert disables keys before the insert and re-enables +# them by repair after the insert. +--disable_query_log +let $count= 100; +--echo # Insert $count rows. Query log disabled. +while ($count) +{ + INSERT INTO t1 VALUES ('a', 'b'); + dec $count; +} +--enable_query_log +# +# Change most of the rows into long character values with > 127 characters. +UPDATE t1 SET c1=REPEAT("a",128) LIMIT 90; +SELECT COUNT(*) FROM t1; +ALTER TABLE t1 ENGINE=MyISAM; +# +# With bug present, this shows that all long rows are gone. +SELECT COUNT(*) FROM t1; +CHECK TABLE t1; +CHECK TABLE t1 EXTENDED; +DROP TABLE t1; +# +# Test #5 - same as test #1 but UTF-8. +# Using a CHAR column that can have > 127 characters. +# Using a VARCHAR to create a table with dynamic row format. +CREATE TABLE t1 ( + c1 CHAR(50), + c2 VARCHAR(1) +) ENGINE=MyISAM DEFAULT CHARSET UTF8; +# Using Tamil Letter A, Unicode U+0B85 +INSERT INTO t1 VALUES(REPEAT(_utf8 x'e0ae85',43), 'b'); +SELECT COUNT(*) FROM t1; +CHECK TABLE t1; +REPAIR TABLE t1; +SELECT COUNT(*) FROM t1; +CHECK TABLE t1; +DROP TABLE t1; +# +# Test #6 - same as test #2, but UTF-8. +# Using a CHAR column that can have > 127 characters. +# Using a VARCHAR to create a table with dynamic row format. +CREATE TABLE t1 ( + c1 CHAR(50), + c2 VARCHAR(1) +) ENGINE=MyISAM DEFAULT CHARSET UTF8; +# Using Tamil Letter A, Unicode U+0B85 +INSERT INTO t1 VALUES(REPEAT(_utf8 x'e0ae85',43), 'b'); +SELECT COUNT(*) FROM t1; +CHECK TABLE t1 EXTENDED; +REPAIR TABLE t1 EXTENDED; +SELECT COUNT(*) FROM t1; +CHECK TABLE t1 EXTENDED; +DROP TABLE t1; +# +# Test #7 - same as test #3, but UTF-8. +# Using a CHAR column that can have > 127 characters. +# Using a VARCHAR to create a table with dynamic row format. +CREATE TABLE t1 ( + c1 CHAR(50), + c2 VARCHAR(1) +) ENGINE=MyISAM DEFAULT CHARSET UTF8; +# Using Tamil Letter A, Unicode U+0B85 +INSERT INTO t1 VALUES(REPEAT(_utf8 x'e0ae85',43), 'b'); +# Insert more rows and delete one in the middle to force optimize. +INSERT INTO t1 VALUES('b', 'b'); +INSERT INTO t1 VALUES('c', 'b'); +DELETE FROM t1 WHERE c1='b'; +SELECT COUNT(*) FROM t1; +OPTIMIZE TABLE t1; +SELECT COUNT(*) FROM t1; +DROP TABLE t1; +# +# Test #8 - same as test #4, but UTF-8. +# Using a CHAR column that can have > 42 UTF-8 characters. +# Using a VARCHAR to create a table with dynamic row format. +# Using an index which can be disabled during bulk insert. +CREATE TABLE t1 ( + c1 CHAR(50), + c2 VARCHAR(1), + KEY (c1) +) ENGINE=MyISAM DEFAULT CHARSET UTF8; +# +# Insert 100 rows. This turns bulk insert on during the copy phase of +# ALTER TABLE. Bulk insert disables keys before the insert and re-enables +# them by repair after the insert. +--disable_query_log +let $count= 100; +--echo # Insert $count rows. Query log disabled. +while ($count) +{ + INSERT INTO t1 VALUES ('a', 'b'); + dec $count; +} +--enable_query_log +# +# Change most of the rows into long character values with > 42 characters. +# Using Tamil Letter A, Unicode U+0B85 +UPDATE t1 SET c1=REPEAT(_utf8 x'e0ae85',43) LIMIT 90; +SELECT COUNT(*) FROM t1; +ALTER TABLE t1 ENGINE=MyISAM; +# +# With bug present, this shows that all long rows are gone. +SELECT COUNT(*) FROM t1; +CHECK TABLE t1; +CHECK TABLE t1 EXTENDED; +DROP TABLE t1; + --echo End of 5.1 tests -- cgit v1.2.1 From 4fe64cf67ee7c486082f64cb4e5af3855feeec51 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Jan 2008 11:48:04 +0100 Subject: Bug#32705 - myisam corruption: Key in wrong position at page 1024 with ucs2_bin Post-pushbuild fix. Moved test from myisam.test to ctype_ucs2_def.test. UCS2 is not always available. mysql-test/r/ctype_ucs2_def.result: Bug#32705 - myisam corruption: Key in wrong position at page 1024 with ucs2_bin Moved test result from myisam.result to here. mysql-test/r/myisam.result: Bug#32705 - myisam corruption: Key in wrong position at page 1024 with ucs2_bin Moved test result from here to ctype_ucs2_def.result. mysql-test/t/ctype_ucs2_def.test: Bug#32705 - myisam corruption: Key in wrong position at page 1024 with ucs2_bin Moved test from myisam.test to here. UCS2 is not always available. mysql-test/t/myisam.test: Bug#32705 - myisam corruption: Key in wrong position at page 1024 with ucs2_bin Moved test from here to ctype_ucs2_def.test. UCS2 is not always available. --- mysql-test/t/ctype_ucs2_def.test | 13 +++++++++++++ mysql-test/t/myisam.test | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/ctype_ucs2_def.test b/mysql-test/t/ctype_ucs2_def.test index c80444daddd..b146dc63626 100644 --- a/mysql-test/t/ctype_ucs2_def.test +++ b/mysql-test/t/ctype_ucs2_def.test @@ -39,4 +39,17 @@ INSERT INTO t1 VALUES('A', 'A'), ('B', 'B'), ('C', 'C'); INSERT INTO t1 VALUES('A ', 'A '); DROP TABLE t1; +# +# Bug#32705 - myisam corruption: Key in wrong position +# at page 1024 with ucs2_bin +# +CREATE TABLE t1 ( + c1 CHAR(255) CHARACTER SET UCS2 COLLATE UCS2_BIN NOT NULL, + KEY(c1) + ) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('marshall\'s'); +INSERT INTO t1 VALUES ('marsh'); +CHECK TABLE t1 EXTENDED; +DROP TABLE t1; + --echo End of 5.0 tests diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index b182c35514c..80c7a92c12f 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1193,17 +1193,4 @@ SET @@myisam_repair_threads=1; CHECK TABLE t1 EXTENDED; DROP TABLE t1; -# -# Bug#32705 - myisam corruption: Key in wrong position -# at page 1024 with ucs2_bin -# -CREATE TABLE t1 ( - c1 CHAR(255) CHARACTER SET UCS2 COLLATE UCS2_BIN NOT NULL, - KEY(c1) - ) ENGINE=MyISAM; -INSERT INTO t1 VALUES ('marshall\'s'); -INSERT INTO t1 VALUES ('marsh'); -CHECK TABLE t1 EXTENDED; -DROP TABLE t1; - --echo End of 5.0 tests -- cgit v1.2.1 From 8f3a0ea2c8e791f0ee84c3e1dd7f09ef7daf0d48 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Jan 2008 15:37:18 -0800 Subject: Bug#33067 "Update of CSV row incorrect for some BLOBs" when reading in rows, move blob columns into temporary storage not allocated by Field_blob class or else row update operation will alter original row and make mysql think that nothing has been changed. fix incrementing wrong statistic values. mysql-test/r/csv.result: test for bug33067 mysql-test/t/csv.test: test for bug33067 storage/csv/ha_tina.cc: bug33067 when reading in rows, move blob columns into temporary storage not allocated by Field_blob class or else row update operation will alter original row and make mysql think that nothing has been changed. fix incrementing wrong statistic values. storage/csv/ha_tina.h: bug33067 new memroot attribute for blobs --- mysql-test/t/csv.test | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test index 7b4f95bbf8a..dd8c940ac44 100644 --- a/mysql-test/t/csv.test +++ b/mysql-test/t/csv.test @@ -1773,4 +1773,15 @@ drop table t1; CREATE TABLE t1(a INT) ENGINE=CSV; SHOW WARNINGS; +# +# BUG#33067 - . +# +create table t1 (c1 tinyblob not null) engine=csv; +insert into t1 values("This"); +--enable_info +update t1 set c1="That" where c1="This"; +--disable_info +select * from t1; +drop table t1; + --echo End of 5.1 tests -- cgit v1.2.1 From 1804046d78a4e4c8750aed1dfbffdd1f07fc7857 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 24 Jan 2008 18:56:42 +0100 Subject: Bug#29182 - MyISAMCHK reports wrong character set myisamchk did always show Character set: latin1_swedish_ci (8), regardless what DEFAULT CHARSET the table had. When the server created a MyISAM table, it did not copy the characterset number into the MyISAM create info structure. Added assignment of charset number to MI_CREATE_INFO. mysql-test/r/myisam.result: Bug#29182 - MyISAMCHK reports wrong character set Added test result. mysql-test/t/myisam.test: Bug#29182 - MyISAMCHK reports wrong character set Added test. storage/myisam/ha_myisam.cc: Bug#29182 - MyISAMCHK reports wrong character set Added assignment of charset number to MI_CREATE_INFO. --- mysql-test/t/myisam.test | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index bb2c295eac2..21ffa0683b6 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1448,5 +1448,19 @@ CHECK TABLE t1; CHECK TABLE t1 EXTENDED; DROP TABLE t1; +# +# Bug#29182 - MyISAMCHK reports wrong character set +# +CREATE TABLE t1 ( + c1 VARCHAR(10) NOT NULL, + c2 CHAR(10) DEFAULT NULL, + c3 VARCHAR(10) NOT NULL, + KEY (c1), + KEY (c2) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--exec $MYISAMCHK -d $MYSQLTEST_VARDIR/master-data/test/t1 +DROP TABLE t1; + --echo End of 5.1 tests -- cgit v1.2.1 From f1042103e619330f5b1fdd11faed7d07c79df49f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 25 Jan 2008 16:05:15 -0800 Subject: Bug#33358 "Plugin enum variables can't be set from command line" fix crash of LOCK_plugins mutex when loading plug-ins from command line. fix off-by-one bug when loading multiple plug-ins from the command line. initialize command line handling for ENUM and SET plugin variable types. sql/sql_plugin.cc: Bug33358 fix crash of LOCK_plugins mutex when loading plug-ins from command line. fix off-by-one bug when loading multiple plug-ins from the command line. initialize command line handling for ENUM and SET plugin variable types. mysql-test/r/plugin_load.result: New BitKeeper file ``mysql-test/r/plugin_load.result'' mysql-test/t/plugin_load-master.opt: New BitKeeper file ``mysql-test/t/plugin_load-master.opt'' mysql-test/t/plugin_load.test: New BitKeeper file ``mysql-test/t/plugin_load.test'' --- mysql-test/t/plugin_load-master.opt | 3 +++ mysql-test/t/plugin_load.test | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 mysql-test/t/plugin_load-master.opt create mode 100644 mysql-test/t/plugin_load.test (limited to 'mysql-test/t') diff --git a/mysql-test/t/plugin_load-master.opt b/mysql-test/t/plugin_load-master.opt new file mode 100644 index 00000000000..34186aab890 --- /dev/null +++ b/mysql-test/t/plugin_load-master.opt @@ -0,0 +1,3 @@ +$EXAMPLE_PLUGIN_OPT +"--plugin-load=;EXAMPLE=ha_example.so;" +--plugin-example-enum-var=e2 diff --git a/mysql-test/t/plugin_load.test b/mysql-test/t/plugin_load.test new file mode 100644 index 00000000000..8555247dd71 --- /dev/null +++ b/mysql-test/t/plugin_load.test @@ -0,0 +1,3 @@ +--source include/have_example_plugin.inc + +SELECT @@global.example_enum_var = 'e2'; -- cgit v1.2.1 From 70884e09b8d10088da4598aaf0b8ebe04e6a97b8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 26 Jan 2008 02:13:35 -0800 Subject: fixes to make pushbuild tests green mysql-test/t/plugin_load-master.opt: add '--loose' modifier to allow test to be skipped if plugin is not available. sql/sql_plugin.cc: Failure to load a plugin from command line option made non-fatal as plugin load failures from plugin table is already non-fatal. --- mysql-test/t/plugin_load-master.opt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/plugin_load-master.opt b/mysql-test/t/plugin_load-master.opt index 34186aab890..66637841f16 100644 --- a/mysql-test/t/plugin_load-master.opt +++ b/mysql-test/t/plugin_load-master.opt @@ -1,3 +1,3 @@ $EXAMPLE_PLUGIN_OPT "--plugin-load=;EXAMPLE=ha_example.so;" ---plugin-example-enum-var=e2 +--loose-plugin-example-enum-var=e2 -- cgit v1.2.1 From e30a0dda8f322aa8714caf6d6de6d583e51809f1 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 26 Jan 2008 21:45:35 -0800 Subject: Fixed bug #33833. Two disjuncts containing equalities of the form key=const1 and key=const2 can be merged into one if const1 is equal to const2. To check it the common collation of the constants were used rather than the collation of the field key. For example when the default collation of the constants was cases insensitive while the collation of the field was case sensitive, then two or-ed equality predicates key='b' and key='B' incorrectly were merged into one f='b'. As a result ref access was used instead of range access and wrong result sets were returned in many cases. Fixed the problem by comparing constant in the or-ed predicate with collation of the key field. mysql-test/r/range.result: Added a test case for bug #33833. mysql-test/t/range.test: Added a test case for bug #33833. sql/item.cc: Fixed bug #33833. Added the method eq_by_collation that compares two items almost as the method Item::eq, but it rather enforces a given collation for the comparison. sql/item.h: Fixed bug #33833. Added the method eq_by_collation that compares two items almost as the method Item::eq, but it rather enforces a given collation for the comparison. --- mysql-test/t/range.test | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 87ba3510326..1352b366508 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -955,4 +955,21 @@ explain select * from t1 where dateval >= '2007-01-01 00:00:00' and dateval <= ' drop table t1; +# +# Bug #33833: different or-ed predicates were erroneously merged into one that +# resulted in ref access instead of range access and a wrong result set +# + +CREATE TABLE t1 ( + a varchar(32), index (a) +) DEFAULT CHARSET=latin1 COLLATE=latin1_bin; + +INSERT INTO t1 VALUES + ('B'), ('A'), ('A'), ('C'), ('B'), ('A'), ('A'); + +SELECT a FROM t1 WHERE a='b' OR a='B'; +EXPLAIN SELECT a FROM t1 WHERE a='b' OR a='B'; + +DROP TABLE t1; + # End of 5.0 tests -- cgit v1.2.1 From 516f95acea961ed8e7c550ba49acdd884678058c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 28 Jan 2008 15:20:55 +0100 Subject: BUG#32943: Fixed buggy lock handling of ALTER TABLE for partitioning mysql-test/r/partition_range.result: Added new test cases for lock tables and ALTER TABLE for partitions, also added a test case with a trigger. mysql-test/t/partition_range.test: Added new test cases for lock tables and ALTER TABLE for partitions, also added a test case with a trigger. sql/mysql_priv.h: Added WFRM_KEEP_SHARE for use of code not to be used otherwise sql/sql_partition.cc: Removed get_name_lock and release_name_lock, use close_data_files_and_morph_locks which leaves an exclusive name lock after completing. Reopen table after completing if under lock tables Updated comments sql/sql_table.cc: Ensure that code to set partition syntax isn't used other than when specifically asked to do it. --- mysql-test/t/partition_range.test | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/partition_range.test b/mysql-test/t/partition_range.test index 6ed3abab46a..c73a56aff9d 100644 --- a/mysql-test/t/partition_range.test +++ b/mysql-test/t/partition_range.test @@ -9,6 +9,41 @@ drop table if exists t1, t2; --enable_warnings +# +# BUG 32943: +# Locking problems in relation to partitioning and triggers +# Also fixes and test cases of generic lock issues with +# partition change code. +# +create table t1 (a integer) +partition by range (a) +( partition p0 values less than (4), + partition p1 values less than (100)); + +delimiter |; +create trigger tr1 before insert on t1 +for each row begin + set @a = 1; +end| + +delimiter ;| +alter table t1 drop partition p0; + +drop table t1; + +create table t1 (a integer) +partition by range (a) +( partition p0 values less than (4), + partition p1 values less than (100)); +LOCK TABLES t1 WRITE; +alter table t1 drop partition p0; +alter table t1 reorganize partition p1 into +( partition p0 values less than (4), + partition p1 values less than (100)); +alter table t1 add partition ( partition p2 values less than (200)); +UNLOCK TABLES; +drop table t1; + # # BUG 18198: Various tests for partition functions # -- cgit v1.2.1 From 21e654a828fb553a05fa59ce1e24a9360e377835 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 28 Jan 2008 16:11:43 +0100 Subject: BUG#33429: No check for maxvalue before adding partition mysql-test/r/partition_range.result: Added new test cases mysql-test/t/partition_range.test: Added new test cases sql/sql_partition.cc: Added check that last partition hasn't got maxvalue defined when executing ADD PARTITION --- mysql-test/t/partition_range.test | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/partition_range.test b/mysql-test/t/partition_range.test index 6ed3abab46a..035a895dbab 100644 --- a/mysql-test/t/partition_range.test +++ b/mysql-test/t/partition_range.test @@ -9,6 +9,17 @@ drop table if exists t1, t2; --enable_warnings +# +# BUG 33429: Succeeds in adding partition when maxvalue on last partition +# +create table t1 (a int) +partition by range (a) +( partition p0 values less than (maxvalue)); +--error ER_PARTITION_MAXVALUE_ERROR +alter table t1 add partition (partition p1 values less than (100000)); +show create table t1; +drop table t1; + # # BUG 18198: Various tests for partition functions # -- cgit v1.2.1 From bb091abb145f89e2332a5b49cbc221793bce3452 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 28 Jan 2008 22:05:25 +0100 Subject: BUG#33182: Disallow division due to div_precision_increment problems mysql-test/r/partition.result: New test case to validate that '/' is no longer allowed, only integer division is allowed mysql-test/t/partition.test: New test case to validate that '/' is no longer allowed, only integer division is allowed sql/item_func.h: +,-,*, mod is allowed / is disallowed --- mysql-test/t/partition.test | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 23d6c5f8865..7ca6f0f55d6 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -14,6 +14,10 @@ drop table if exists t1; --enable_warnings +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (a int) partition by list ((a/3)*10 div 1) +(partition p0 values in (0), partition p1 values in (1)); + # # Bug #30695: An apostrophe ' in the comment of the ADD PARTITION causes the Server to crash. # -- cgit v1.2.1 From 754c3f51ec6e0557b8c4ca2f141ee74075e11b48 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 31 Jan 2008 23:46:26 +0300 Subject: Bug#30787: Stored function ignores user defined alias. Simple subselects are pulled into upper selects. This operation substitutes the pulled subselect for the first item from the select list of the subselect. If an alias is defined for a subselect it is inherited by the replacement item. As this is done after fix_fields phase this alias isn't showed if the replacement item is a stored function. This happens because the Item_func_sp::make_field function makes send field from its result_field and ignores the defined alias. Now when an alias is defined the Item_func_sp::make_field function sets it for the returned field. mysql-test/t/sp.test: Added a test case for the bug#30787: Stored function ignores user defined alias. mysql-test/r/sp.result: Added a test case for the bug#30787: Stored function ignores user defined alias. sql/item_func.cc: Bug#30787: Stored function ignores user defined alias. Now when an alias is defined the Item_func_sp::make_field function sets it for the returned field. --- mysql-test/t/sp.test | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 785e7e3793c..b9cba0f489f 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -7699,6 +7699,25 @@ DROP PROCEDURE db28318_b.t2; DROP DATABASE db28318_a; DROP DATABASE db28318_b; +--echo # +--echo # Bug#30787: Stored function ignores user defined alias. +--echo # +use test; +--disable_warnings +drop function if exists func30787; +--enable_warnings +create table t1(f1 int); +insert into t1 values(1),(2); +delimiter |; +create function func30787(p1 int) returns int +begin + return p1; +end | +delimiter ;| +select (select func30787(f1)) as ttt from t1; +drop function func30787; +drop table t1; + --echo # ------------------------------------------------------------------ --echo # -- End of 5.0 tests -- cgit v1.2.1 From 4d794c233419658cd79b416a3ce45d0b1efea688 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 1 Feb 2008 13:00:40 +0500 Subject: Fix for bug #25162: Backing up DB from 5.1 adds 'USING BTREE' to KEYs on table creates The problem was in incompatible syntax for key definition in CREATE TABLE. 5.0 supports only the following syntax for key definition (see "CREATE TABLE syntax" in the manual): {INDEX|KEY} [index_name] [index_type] (index_col_name,...) While 5.1 parser supports the above syntax, the "preferred" syntax was changed to: {INDEX|KEY} [index_name] (index_col_name,...) [index_type] The above syntax is used in 5.1 for the SHOW CREATE TABLE output, which led to dumps generated by 5.1 being incompatible with 5.0. Fixed by changing the parser in 5.0 to support both 5.0 and 5.1 syntax for key definition. mysql-test/r/create.result: Added a test case for bug #25162. mysql-test/t/create.test: Added a test case for bug #25162. sql/sql_yacc.yy: Changed the parser to support both 5.0 and 5.1 syntax for index type specification in CREATE TABLE. --- mysql-test/t/create.test | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 64081c0248a..97a7ea71b29 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -1148,4 +1148,28 @@ create table t2 select sql_big_result f1,count(f2) from t1 group by f1; show status like 'handler_read%'; drop table t1,t2; +# +# Bug #25162: Backing up DB from 5.1 adds 'USING BTREE' to KEYs on table creates +# + +# Show that the old syntax for index type is supported +CREATE TABLE t1(c1 VARCHAR(33), KEY USING BTREE (c1)); +DROP TABLE t1; + +# Show that the new syntax for index type is supported +CREATE TABLE t1(c1 VARCHAR(33), KEY (c1) USING BTREE); +DROP TABLE t1; + +# Show that in case of multiple index type definitions, the last one takes +# precedence + +CREATE TABLE t1(c1 VARCHAR(33), KEY USING BTREE (c1) USING HASH) ENGINE=MEMORY; +SHOW INDEX FROM t1; +DROP TABLE t1; + +CREATE TABLE t1(c1 VARCHAR(33), KEY USING HASH (c1) USING BTREE) ENGINE=MEMORY; +SHOW INDEX FROM t1; +DROP TABLE t1; + + --echo End of 5.0 tests -- cgit v1.2.1 From 3891d43617e82dcb1a1ecdf876fa2094d672cb79 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Feb 2008 02:33:21 +0400 Subject: Fixed bug#30059. Server handles truncation for assignment of too-long values into CHAR/VARCHAR/TEXT columns in a different ways when the truncated characters are spaces: 1. CHAR(N) columns silently ignore end-space truncation; 2. TEXT columns post a truncation warning/error in the non-strict/strict mode. 3. VARCHAR columns always post a truncation note in any mode. Space truncation processing has been synchronised over CHAR/VARCHAR/TEXT columns: current behavior of VARCHAR columns has been propagated as standard. Binary-encoded string/BLOB columns are not affected. mysql-test/r/heap.result: Updated test case for bug#30059. mysql-test/r/innodb.result: Updated test case for bug#30059. mysql-test/r/myisam.result: Updated test case for bug#30059. mysql-test/r/strict.result: Updated test case for bug#30059. mysql-test/r/type_binary.result: Updated test case for bug#30059. mysql-test/r/warnings.result: Added test case for bug#30059. mysql-test/t/warnings.test: Added test case for bug#30059. sql/field.cc: Fixed bug#30059. The report_data_too_long function was replaced with the Field_longstr::report_if_important_data method. The Field_string::store and the Field_blob::store methods was synchronized with the Field_varstring::store method. Changes: 1. to CHAR(N): posting of space truncation note has been added in both (strict and non-strict) modes; 2. to BLOBs: a check for space truncation has been added, a warning in the non-strict mode and an error message in the strict mode have been replaced with a truncation note. Similar parts of Field_string::store, Field_blob::store and Field_varstring::store have been moved to the Field_longstr::report_if_important_data method. sql/field.h: Fixed bug#30059. The Field_longstr::report_if_important_data method has been declared. --- mysql-test/t/warnings.test | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test index 5e9d25aa09b..c42dd22024c 100644 --- a/mysql-test/t/warnings.test +++ b/mysql-test/t/warnings.test @@ -212,4 +212,37 @@ DROP PROCEDURE sp1; DROP PROCEDURE sp2; DROP PROCEDURE sp3; + +# +# Bug#30059: End-space truncation warnings are inconsistent or incorrect +# + +create table t1 (c_char char(255), c_varchar varchar(255), c_tinytext tinytext); +create table t2 (c_tinyblob tinyblob); # not affected by bug, for regression testing +set @c = repeat(' ', 256); +set @q = repeat('q', 256); + +set sql_mode = ''; + +insert into t1 values(@c, @c, @c); +insert into t2 values(@c); +insert into t1 values(@q, @q, @q); +insert into t2 values(@q); + +set sql_mode = 'traditional'; + +insert into t1 values(@c, @c, @c); +--error 1406 +insert into t2 values(@c); +--error 1406 +insert into t1 values(@q, NULL, NULL); +--error 1406 +insert into t1 values(NULL, @q, NULL); +--error 1406 +insert into t1 values(NULL, NULL, @q); +--error 1406 +insert into t2 values(@q); + +drop table t1, t2; + --echo End of 5.0 tests -- cgit v1.2.1 From 5cf3f53e420d185b0a3beec83154d514c3b32deb Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Feb 2008 04:14:50 +0400 Subject: Fixed bug#34223: Failure on assignment to my_innodb_autoextend_increment and my_innodb_commit_concurrency global variables. Type of the my_innodb_autoextend_increment and the my_innodb_commit_concurrency variables has been changed to GET_ULONG. mysql-test/r/variables.result: Added test case for bug#34223. mysql-test/t/variables.test: Added test case for bug#34223. sql/mysqld.cc: Fixed bug#34223. Last update of the getopt_ull_limit_value function introduced a sanity check for a variable type (only GET_UINT or GET_ULONG are valid types). However, my_innodb_autoextend_increment and my_innodb_commit_concurrency are declared as GET_LONG. Call stack is: sys_var_long_ptr_global::update() fix_unsigned() getopt_ull_limit_value() Type of the my_innodb_autoextend_increment and the my_innodb_commit_concurrency variables has been changed to GET_ULONG. --- mysql-test/t/variables.test | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index c86e7dfa7f3..191022f44fb 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -696,6 +696,19 @@ SELECT @@log_slow_queries; --error 1238 SET GLOBAL log_slow_queries=0; +# +# Bug #34223: Assertion failed: (optp->var_type & 127) == 8, +# file .\my_getopt.c, line 830 +# + +set @my_innodb_autoextend_increment=@@global.innodb_autoextend_increment; +set global innodb_autoextend_increment=8; +set global innodb_autoextend_increment=@my_innodb_autoextend_increment; + +set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency; +set global innodb_commit_concurrency=0; +set global innodb_commit_concurrency=@my_innodb_commit_concurrency; + --echo End of 5.0 tests # This is at the very after the versioned tests, since it involves doing -- cgit v1.2.1 From a4eaf17ccb6799fc5f27b80024b94573c486536b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Feb 2008 11:12:49 +0400 Subject: innodb_mysql.test, variables.result, variables.test, innodb_mysql.result: Minor post-fix for bug#34223. mysql-test/r/innodb_mysql.result: Minor post-fix for bug#34223. mysql-test/r/variables.result: Minor post-fix for bug#34223. mysql-test/t/innodb_mysql.test: Minor post-fix for bug#34223. mysql-test/t/variables.test: Minor post-fix for bug#34223. --- mysql-test/t/innodb_mysql.test | 14 ++++++++++++++ mysql-test/t/variables.test | 13 ------------- 2 files changed, 14 insertions(+), 13 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test index 020295684b0..59ee7c274bb 100644 --- a/mysql-test/t/innodb_mysql.test +++ b/mysql-test/t/innodb_mysql.test @@ -982,4 +982,18 @@ desc t1; show create table t1; drop table t1; + +# +# Bug #34223: Assertion failed: (optp->var_type & 127) == 8, +# file .\my_getopt.c, line 830 +# + +set @my_innodb_autoextend_increment=@@global.innodb_autoextend_increment; +set global innodb_autoextend_increment=8; +set global innodb_autoextend_increment=@my_innodb_autoextend_increment; + +set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency; +set global innodb_commit_concurrency=0; +set global innodb_commit_concurrency=@my_innodb_commit_concurrency; + --echo End of 5.0 tests diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 191022f44fb..c86e7dfa7f3 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -696,19 +696,6 @@ SELECT @@log_slow_queries; --error 1238 SET GLOBAL log_slow_queries=0; -# -# Bug #34223: Assertion failed: (optp->var_type & 127) == 8, -# file .\my_getopt.c, line 830 -# - -set @my_innodb_autoextend_increment=@@global.innodb_autoextend_increment; -set global innodb_autoextend_increment=8; -set global innodb_autoextend_increment=@my_innodb_autoextend_increment; - -set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency; -set global innodb_commit_concurrency=0; -set global innodb_commit_concurrency=@my_innodb_commit_concurrency; - --echo End of 5.0 tests # This is at the very after the versioned tests, since it involves doing -- cgit v1.2.1 From 64d17dd1c2fdca2cc102cd582b38a324ca1ad82c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Feb 2008 12:04:19 +0100 Subject: Bug#34376 - merge-big test fails After changes to the bug fix for bug 26379 (Combination of FLUSH TABLE and REPAIR TABLE corrupts a MERGE table) the test case merge-big failed. Repaired the test case. Removed tests for INSERT ... SELECT, which is disabled for MERGE. Test case change only. mysql-test/r/merge-big.result: Bug#34376 - merge-big test fails Removed result for removed tests. mysql-test/t/merge-big.test: Bug#34376 - merge-big test fails Repaired the test case. Removed tests for INSERT ... SELECT, which is disabled for MERGE. --- mysql-test/t/merge-big.test | 84 +++++---------------------------------------- 1 file changed, 8 insertions(+), 76 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/merge-big.test b/mysql-test/t/merge-big.test index eddcbb59ed4..b687973c9d1 100644 --- a/mysql-test/t/merge-big.test +++ b/mysql-test/t/merge-big.test @@ -3,8 +3,10 @@ # # This test takes rather long time so let us run it only in --big-test mode --source include/big_test.inc -# We are using some debug-only features in this test +# We use some debug-only features in this test --source include/have_debug.inc +# We use INFORMATION_SCHEMA.PROCESSLIST in this test +--source include/not_embedded.inc --disable_warnings drop table if exists t1,t2,t3,t4,t5,t6; @@ -46,6 +48,8 @@ LOCK TABLE t1 WRITE; --echo # connection default connection default; --echo # Let INSERT go into thr_multi_lock(). +#--sleep 8 +#SELECT ID,STATE,INFO FROM INFORMATION_SCHEMA.PROCESSLIST; let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE ID = $con1_id AND STATE = 'Locked'; --source include/wait_condition.inc @@ -54,8 +58,10 @@ let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST FLUSH TABLES; #SELECT NOW(); --echo # Let INSERT go through open_tables() where it sleeps. +#--sleep 8 +#SELECT ID,STATE,INFO FROM INFORMATION_SCHEMA.PROCESSLIST; let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST - WHERE ID = $con1_id AND STATE = 'DBUG sleep'; + WHERE ID = $con1_id AND STATE = 'Waiting for table'; --source include/wait_condition.inc #SELECT NOW(); --echo # Unlock and close table and wait for con1 to close too. @@ -74,77 +80,3 @@ UNLOCK TABLES; connection default; DROP TABLE t1; ---echo # ---echo # Extra tests for Bug#26379 - Combination of FLUSH TABLE and ---echo # REPAIR TABLE corrupts a MERGE table ---echo # -CREATE TABLE t1 (c1 INT); -CREATE TABLE t2 (c1 INT); -CREATE TABLE t3 (c1 INT); -INSERT INTO t1 VALUES (1); -INSERT INTO t2 VALUES (2); -INSERT INTO t3 VALUES (3); ---echo # ---echo # CREATE ... SELECT ---echo # try to access parent from another thread. ---echo # -#SELECT NOW(); - --echo # connection con1 - connect (con1,localhost,root,,); - let $con1_id= `SELECT CONNECTION_ID()`; - SET SESSION debug="+d,sleep_create_select_before_lock"; - send CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2) - INSERT_METHOD=FIRST SELECT * FROM t3; ---echo # connection default -connection default; -# wait for the other query to start executing -let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST - WHERE ID = $con1_id AND STATE = 'DBUG sleep'; ---source include/wait_condition.inc -#SELECT NOW(); ---echo # Now try to access the parent. ---echo # If 3 is in table, SELECT had to wait. -SELECT * FROM t4 ORDER BY c1; -#SELECT NOW(); - --echo # connection con1 - connection con1; - reap; - #SELECT NOW(); - SET SESSION debug="-d,sleep_create_select_before_lock"; - disconnect con1; ---echo # connection default -connection default; ---echo # Cleanup for next test. -DROP TABLE t4; -DELETE FROM t1 WHERE c1 != 1; ---echo # ---echo # CREATE ... SELECT ---echo # try to access child from another thread. ---echo # -#SELECT NOW(); - --echo # connection con1 - connect (con1,localhost,root,,); - let $con1_id= `SELECT CONNECTION_ID()`; - SET SESSION debug="+d,sleep_create_select_before_lock"; - send CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2) - INSERT_METHOD=FIRST SELECT * FROM t3; ---echo # connection default -connection default; -# wait for the other query to start executing -let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST - WHERE ID = $con1_id AND STATE = 'DBUG sleep'; ---source include/wait_condition.inc -#SELECT NOW(); ---echo # Now try to access a child. ---echo # If 3 is in table, SELECT had to wait. -SELECT * FROM t1 ORDER BY c1; -#SELECT NOW(); - --echo # connection con1 - connection con1; - reap; - #SELECT NOW(); - SET SESSION debug="-d,sleep_create_select_before_lock"; - disconnect con1; ---echo # connection default -connection default; -DROP TABLE t1, t2, t3, t4; -- cgit v1.2.1 From b2f0ed637171a1658699e3084c3a68710fefac93 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Feb 2008 12:28:38 +0100 Subject: Bug#33379: valgrind error in parts/partition_bit_myisam Problem was that Field_bit used Field::hash() function that did not know about using null-byte for storing bits. Resulting in wrong length, which was caught by valgrind. Solution: created a Field_bit::hash() that uses Field_bit::val_int() and my_charset_bin-collation function hash_sort. Also use the store function for platform independs mysql-test/r/partition_datatype.result: Bug#33379: valgrind error in parts/partition_bit_myisam result file enabled bit datatype test mysql-test/t/partition_datatype.test: Bug#33379: valgrind error in parts/partition_bit_myisam test file enabled bit datatype test sql/field.cc: Bug#33379: valgrind error in parts/partition_bit_myisam Problem was that Field_bit used Field::hash() function that did not know about using null-byte for storing bits. Resulting in wrong length. Solution: created a Field_bit::hash() that uses Field_bit::val_int() and my_charset_bin-collation function hash_sort. Also use the store function for platform independens. sql/field.h: Bug#33379: valgrind error in parts/partition_bit_myisam Problem was that Field_bit used Field::hash() function that did not know about using null-byte for storing bits. Resulting in wrong length. Solution: created a Field_bit::hash(). --- mysql-test/t/partition_datatype.test | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/partition_datatype.test b/mysql-test/t/partition_datatype.test index 61d3cb42c7b..d6e65c3406e 100644 --- a/mysql-test/t/partition_datatype.test +++ b/mysql-test/t/partition_datatype.test @@ -11,11 +11,11 @@ drop table if exists t1; --enable_warnings -# FIXME: disabled this test because of valgrind error -#create table t1 (a bit not null) partition by key (a); -#insert into t1 values (b'1'); -#select * from t1 where a = b'1'; -#drop table t1; +-- echo # test with not null +create table t1 (a bit not null) partition by key (a); +insert into t1 values (b'1'); +select hex(a) from t1 where a = b'1'; +drop table t1; create table t1 (a tinyint not null) partition by key (a); insert into t1 values (2); select * from t1 where a = 2; @@ -100,11 +100,11 @@ create table t1 (a set('y','n') not null) partition by key (a); insert into t1 values ('y'); select * from t1 where a = 'y'; drop table t1; -# FIXME: disabled this test because of valgrind error -#create table t1 (a bit) partition by key (a); -#insert into t1 values (b'1'); -#select * from t1 where a = b'1'; -#drop table t1; +-- echo # test with null allowed +create table t1 (a bit) partition by key (a); +insert into t1 values (b'1'); +select hex(a) from t1 where a = b'1'; +drop table t1; create table t1 (a tinyint) partition by key (a); insert into t1 values (2); select * from t1 where a = 2; -- cgit v1.2.1 From 1c0bd60db4e6810e4ac11f2626ab97063f205477 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Feb 2008 15:09:59 +0100 Subject: Bug#34358: Cannot find specified bit row in partitioned table Problem was incorrect data length in the key_restore function resulting in overwriting the search key. Solution, remove one byte in length if uneven bits are used. mysql-test/r/partition_datatype.result: Bug#34358: Cannot find specified bit row Updated result file mysql-test/t/partition_datatype.test: Bug#34358: Cannot find specified bit row Updated test file (corrected a few errors and added a test case for the bug) sql/key.cc: Bug34358: error in key_restore for bit fields with uneven bits When uneven bits exist, it has special treatment for the uneven bits but does use the same byte again when copying the rest of the key_part. --- mysql-test/t/partition_datatype.test | 42 +++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 13 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/partition_datatype.test b/mysql-test/t/partition_datatype.test index 61d3cb42c7b..33975e3cf85 100644 --- a/mysql-test/t/partition_datatype.test +++ b/mysql-test/t/partition_datatype.test @@ -37,14 +37,14 @@ insert into t1 values (2); select * from t1 where a = 2; drop table t1; create table t1 (a float not null) partition by key (a); -insert into t1 values (2.1); -select * from t1 where a = 2.1; +insert into t1 values (0.5); +select * from t1 where a = 0.5; drop table t1; create table t1 (a double not null) partition by key (a); -insert into t1 values (2.1); -select * from t1 where a = 2.1; +insert into t1 values (0.5); +select * from t1 where a = 0.5; drop table t1; -create table t1 (a decimal not null) partition by key (a); +create table t1 (a decimal(4,2) not null) partition by key (a); insert into t1 values (2.1); select * from t1 where a = 2.1; drop table t1; @@ -126,14 +126,14 @@ insert into t1 values (2); select * from t1 where a = 2; drop table t1; create table t1 (a float) partition by key (a); -insert into t1 values (2.1); -select * from t1 where a = 2.1; +insert into t1 values (0.5); +select * from t1 where a = 0.5; drop table t1; create table t1 (a double) partition by key (a); -insert into t1 values (2.1); -select * from t1 where a = 2.1; +insert into t1 values (0.5); +select * from t1 where a = 0.5; drop table t1; -create table t1 (a decimal) partition by key (a); +create table t1 (a decimal(4,2)) partition by key (a); insert into t1 values (2.1); select * from t1 where a = 2.1; drop table t1; @@ -192,18 +192,23 @@ drop table t1; create table t1 (a varchar(65531)) partition by key (a); insert into t1 values ('bbbb'); insert into t1 values ('aaaa'); -select * from t1 where a = 'aaa%'; +select * from t1 where a = 'aaaa'; select * from t1 where a like 'aaa%'; +select * from t1 where a = 'bbbb'; drop table t1; create table t1 (a varchar(65532)) partition by key (a); insert into t1 values ('bbbb'); insert into t1 values ('aaaa'); -select * from t1 where a = 'aaa%'; +select * from t1 where a = 'aaaa'; select * from t1 where a like 'aaa%'; +select * from t1 where a = 'bbbb'; drop table t1; create table t1 (a varchar(65533) not null) partition by key (a); +insert into t1 values ('bbbb'); insert into t1 values ('aaaa'); -select * from t1 where a = 'aaa%'; +select * from t1 where a = 'aaaa'; +select * from t1 where a like 'aaa%'; +select * from t1 where a = 'bbbb'; drop table t1; -- error ER_TOO_BIG_ROWSIZE create table t1 (a varchar(65533)) partition by key (a); @@ -211,3 +216,14 @@ create table t1 (a varchar(65533)) partition by key (a); create table t1 (a varchar(65534) not null) partition by key (a); -- error ER_TOO_BIG_ROWSIZE create table t1 (a varchar(65535)) partition by key (a); + +# +# Bug#34358: error in key_restore for bitfields with uneven bits +# +create table t1 (a bit(27), primary key (a)) engine=myisam +partition by hash (a) +(partition p0, partition p1, partition p2); +show create table t1; +insert into t1 values (1),(4),(7),(10),(13),(16),(19),(22),(25),(28),(31),(34); +select hex(a) from t1 where a = 7; +drop table t1; -- cgit v1.2.1 From d8eab9769309b36b96c2239d436fdb93b175a760 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 8 Feb 2008 13:35:00 +0300 Subject: Bug#31590: Wrong error message on sort buffer being too small. The out of memory error was thrown when the sort buffer size were too small. This led to a user confusion. Now filesort throws the error message about sort buffer being too small. mysql-test/t/order_by.test: Added a test case for the bug#31590: Wrong error message on sort buffer being too small. mysql-test/r/order_by.result: Added a test case for the bug#31590: Wrong error message on sort buffer being too small. sql/filesort.cc: Bug#31590: Wrong error message on sort buffer being too small. Now filesort throws the error message about sort buffer being too small instead of out of memory error. --- mysql-test/t/order_by.test | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test index 29a290c7fbf..9a55c27df99 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -726,3 +726,15 @@ SELECT a, b FROM t1 ORDER BY b DESC; SELECT a, b FROM t1 ORDER BY SEC_TO_TIME(a) DESC; DROP TABLE t1; + +--echo # +--echo # Bug#31590: Wrong error message on sort buffer being too small. +--echo # +create table t1(a int, b tinytext); +insert into t1 values (1,2),(3,2); +set session sort_buffer_size= 30000; +set session max_sort_length= 2180; +--error 1038 +select * from t1 order by b; +drop table t1; + -- cgit v1.2.1 From 213b4dcd9ede1b1de850d526d6600c5fe4aa5497 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 8 Feb 2008 16:04:01 +0400 Subject: Fixed bug#15409: Columns with 64-element SET may not be updated with integers. SET column storing procedure has been modified to be 64bit-clean. mysql-test/r/type_set.result: Added test case for bug#15409. mysql-test/t/type_set.test: Added test case for bug#15409. sql/field.cc: Fixed bug#15409. The Field_set::store(longlong nr,...) method incompletely calculates a bit mask for the comparison with a given number: if that number is greater than 0x7F00 0000 0000 0000 (LONGLONG_MAX), it uses zero bit mask instead of 0xFFFF FFFF FFFF FFFF (ULONGLONG_MAX). Incomplete expression has been replaced with a set_bits macro call. --- mysql-test/t/type_set.test | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/type_set.test b/mysql-test/t/type_set.test index b1c816f3371..c7f8c59de28 100644 --- a/mysql-test/t/type_set.test +++ b/mysql-test/t/type_set.test @@ -56,3 +56,23 @@ set('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17', '50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','1')); show create table t1; drop table t1; + +# +# Bug#15409: Columns with SET datatype with 64-element sets +# may not be updated with integers +# + +let $i=64; +let $s='$i'; +dec $i; +while ($i) { + let $s='$i',$s; + dec $i; +} +--eval CREATE TABLE t1(c set($s)) +INSERT INTO t1 VALUES(7); +INSERT INTO t1 VALUES(9223372036854775808); +SELECT * FROM t1; +DROP TABLE t1; + +--# echo End of 5.0 tests -- cgit v1.2.1 From 6a15453640b4d92797817aeb83bcc96957a12c51 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 11 Feb 2008 11:32:46 +0100 Subject: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Problem was that it did not work with corrupted/crashed tables. Solution is to disable these commands until WL#4176 is completed mysql-test/r/partition.result: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Test result mysql-test/suite/parts/inc/partition_alter4.inc: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION copy-paste error, changed from REBUILT to REPAIR, as the heading says mysql-test/suite/parts/r/partition_alter1_innodb.result: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Test result mysql-test/suite/parts/r/partition_alter1_myisam.result: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Test result mysql-test/suite/parts/r/partition_alter2_innodb.result: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Test result mysql-test/suite/parts/r/partition_alter2_myisam.result: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Test result mysql-test/suite/parts/r/partition_basic_innodb.result: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Test result mysql-test/suite/parts/r/partition_basic_myisam.result: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Test result mysql-test/suite/parts/r/partition_engine_innodb.result: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Test result mysql-test/suite/parts/r/partition_engine_myisam.result: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Test result mysql-test/suite/parts/t/disabled.def: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Disabled test since the tested feature is not longer supported mysql-test/t/partition.test: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION OPTIMIZE PARTITION is not longer supported, waiting for WL#4176 sql/ha_partition.cc: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Problem was that it did not work with corrupted/crashed tables. Solution is to disable these commands until WL#4176 is completed (returning HA_ADMIN_NOT_IMPLEMENTED and #ifdef'ed the non-reachable code) --- mysql-test/t/partition.test | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 23d6c5f8865..dc0f6cdcc2e 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -35,7 +35,7 @@ PARTITION `p5` VALUES LESS THAN (2010) COMMENT 'APSTART \' APEND' ); #--exec sed 's/APSTART \\/APSTART /' var/master-data/test/t1.frm > tmpt1.frm && mv tmpt1.frm var/master-data/test/t1.frm -#--error 1064 +#--error ER_PARSE_ERROR SELECT * FROM t1 LIMIT 1; DROP TABLE t1; @@ -1208,9 +1208,11 @@ SHOW TABLE STATUS; DELETE from t1 where a = 1; --replace_column 9 0 12 NULL 13 NULL 14 NULL SHOW TABLE STATUS; +# restore this after WL#4176 is completed +-- error ER_CHECK_NOT_IMPLEMENTED ALTER TABLE t1 OPTIMIZE PARTITION p0; ---replace_column 12 NULL 13 NULL 14 NULL -SHOW TABLE STATUS; +#--replace_column 12 NULL 13 NULL 14 NULL +#SHOW TABLE STATUS; DROP TABLE t1; # @@ -1568,9 +1570,9 @@ PARTITION BY RANGE (a) ( PARTITION p1 VALUES LESS THAN (10), PARTITION p2 VALUES LESS THAN (20) ); ---error 1064 +--error ER_PARSE_ERROR ALTER TABLE t1 OPTIMIZE PARTITION p1 EXTENDED; ---error 1064 +--error ER_PARSE_ERROR ALTER TABLE t1 ANALYZE PARTITION p1 EXTENDED; DROP TABLE t1; -- cgit v1.2.1 From d5092fa9caf06376023c25cd55610b9a033e3904 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 12 Feb 2008 12:43:55 +0300 Subject: Fix for bug #33389: Selecting from a view into a table from within SP or trigger crashes server Under some circumstances a combination of VIEWs, subselects with outer references and PS/SP/triggers could lead to use of uninitialized memory and server crash as a result. Fixed by changing the code in Item_field::fix_fields() so that in cases when the field is a VIEW reference, we first check whether the field is also an outer reference, and mark it appropriately before returning. mysql-test/r/view.result: Added a test case for bug #33389. mysql-test/t/view.test: Added a test case for bug #33389. sql/item.cc: In cases when in Item_field::fix_fields() from_field is a view reference, do not return too early, i.e. before marking the reference as an outer one when needed. --- mysql-test/t/view.test | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 340a34db5a1..b321f8604f7 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -3470,5 +3470,27 @@ insert into v1 values(1); set @@sql_mode=@old_mode; drop view v1; drop table t1; + +# +# Bug #33389: Selecting from a view into a table from within SP or trigger +# crashes server +# + +create table t1 (a int, key(a)); +create table t2 (c int); + +create view v1 as select a b from t1; +create view v2 as select 1 a from t2, v1 where c in + (select 1 from t1 where b = a); + +insert into t1 values (1), (1); +insert into t2 values (1), (1); + +prepare stmt from "select * from v2 where a = 1"; +execute stmt; + +drop view v1, v2; +drop table t1, t2; + --echo End of 5.0 tests. -- cgit v1.2.1 From 247efb9cf060f0cd8d8eb7e4ecd084b9a202a395 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 13 Feb 2008 19:32:19 +0400 Subject: Fixed bug#33764: Wrong result with IN(), CONCAT() and implicit type conversion. Instead of copying of whole character string from a temporary buffer, the server copied a short-living pointer to that string into a long-living structure. That has been fixed. mysql-test/r/select.result: Added test case for bug#33764. mysql-test/t/select.test: Added test case for bug#33764. sql/item_cmpfunc.cc: Fixed bug#33764. Copying of a pointer has been replaced with an optional copying of a whole array to a newly allocated memory space in case of a functional source item. --- mysql-test/t/select.test | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index c48f2771aa8..4b52dac680c 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -3672,4 +3672,15 @@ DROP TABLE t1; --echo +########################################################################### + +# +# Bug #33764: Wrong result with IN(), CONCAT() and implicit type conversion +# + +CREATE TABLE t1 (a VARCHAR(10) NOT NULL PRIMARY KEY); +INSERT INTO t1 (a) VALUES ('foo0'), ('bar0'), ('baz0'); +SELECT * FROM t1 WHERE a IN (CONCAT('foo', 0), 'bar'); +DROP TABLE t1; + --echo End of 5.0 tests -- cgit v1.2.1 From 7a290b55f7691b2518cb1d83da252e07376954f6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 13 Feb 2008 19:34:12 +0400 Subject: Fixed bug#31194: Privilege ordering does not order properly for wildcard values. The server ignored escape character before wildcards during the calculation of priority values for sorting of a privilege list. (Actually the server counted an escape character as an ordinary wildcard like % or _). I.e. the table name template with a wildcard character like 'tbl_1' had higher priority in a privilege list than concrete table name without wildcards like 'tbl\_1', and some privileges of 'tbl\_1' was hidden by privileges for 'tbl_1'. The get_sort function has been modified to ignore escaped wildcards as usual. mysql-test/r/grant3.result: Added test case for bug#31194. mysql-test/t/grant3.test: Added test case for bug#31194. sql/sql_acl.cc: Fixed bug#31194. The server used the wild_prefix escape character (usually \-character) like % and _ wildcards in the get_sort function for sorting weights calculation. The get_sort function has been modified to ignore escaped wildcards and alone escapes like in the wild_case_compare function. --- mysql-test/t/grant3.test | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/grant3.test b/mysql-test/t/grant3.test index fac577ef0ff..8eceb851c29 100644 --- a/mysql-test/t/grant3.test +++ b/mysql-test/t/grant3.test @@ -134,3 +134,29 @@ SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by DROP USER CUser2@localhost; DROP USER CUser2@LOCALHOST; + + +# +# Bug#31194: Privilege ordering does not order properly for wildcard values +# + +CREATE DATABASE mysqltest_1; +CREATE TABLE mysqltest_1.t1 (a INT); +CREATE USER 'mysqltest1'@'%'; +GRANT SELECT, UPDATE ON `mysqltest_1`.* TO 'mysqltest1'@'%'; +REVOKE SELECT ON `mysqltest_1`.* FROM 'mysqltest1'@'%'; +GRANT SELECT, UPDATE ON `mysqltest\_1`.* TO 'mysqltest1'@'%'; +FLUSH PRIVILEGES; + +connect (conn1,localhost,mysqltest1,,); +connection conn1; +SHOW GRANTS; +SELECT * FROM mysqltest_1.t1; +disconnect conn1; + +connection default; +DROP USER 'mysqltest1'@'%'; +DROP DATABASE mysqltest_1; + + +--echo End of 5.0 tests -- cgit v1.2.1 From 55f6727b708d99562b48ba5391a43ec235375125 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 14 Feb 2008 16:27:01 +0400 Subject: BUG#33946 - Join on Federated tables with Unique index gives error 1430 from storage engine Federated may crash a server, return wrong result set, return "ERROR 1030 (HY000): Got error 1430 from storage engine" message when local (engine=federated) table has a key against nullable column. The problem was wrong implementation of function that creates WHERE clause for remote query from key. mysql-test/r/federated.result: A test case for BUG#33946. mysql-test/t/federated.test: A test case for BUG#33946. sql/ha_federated.cc: Fixed that federated adds " IS NULL " condition to a remote query, whereas "IS NOT NULL" requested by original query. Fixed that federated didn't check for end of key buffer, didn't setup key buffer pointer and remaining lenght of key buffer, didn't add " AND " between conditions in case original query has IS [NOT] NULL condition against nullable column. Fixed that federated wrongly shifts key buffer pointer by extra one byte when key part may be null (was: store_length + 1, now: store_length). --- mysql-test/t/federated.test | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index d4f22650a32..934db5cd68b 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -1716,5 +1716,26 @@ connection slave; drop table t1; drop view v1; +# +# BUG#33946 - Join on Federated tables with Unique index gives error 1430 +# from storage engine +# +connection slave; +CREATE TABLE t1 (a INT, b INT, KEY(a,b)); +INSERT INTO t1 VALUES(NULL,1),(1,NULL),(NULL,NULL),(1,1),(2,2); + +connection master; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE t1 (a INT, b INT, KEY(a,b)) ENGINE=federated +CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1'; +SELECT * FROM t1 WHERE a IS NULL; +SELECT * FROM t1 WHERE a IS NOT NULL; +SELECT * FROM t1 WHERE a=1 AND b=1; +SELECT * FROM t1 WHERE a IS NULL AND b=1; +SELECT * FROM t1 WHERE a IS NOT NULL AND b=1; +DROP TABLE t1; + +connection slave; +DROP TABLE t1; source include/federated_cleanup.inc; -- cgit v1.2.1 From cc2e929ac4b787220118f6d4dc4a72b796bf4ea0 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 15 Feb 2008 15:47:32 +0200 Subject: Bug #31887: DML Select statement not returning same results when executed in version 5 Zero fill is a field attribute only. So we can't always propagate constants for zerofill fields : the values and expression results don't have that flag. Fixed by converting the const value to a string and using that in const propagation when the context allows it. Disable const propagation for fields with ZEROFILL flag in all the other cases. mysql-test/r/compare.result: Bug #31887: test case mysql-test/t/compare.test: Bug #31887: test case sql/item.cc: Bug #31887: If the context allows conversion of an int constant to a zero-filled string constant put the string constant instead of the int constant when doing const propagation sql/mysql_priv.h: Bug #31887: a macro to get all the Field_num descendant fields. --- mysql-test/t/compare.test | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/compare.test b/mysql-test/t/compare.test index 337035a8095..8863ed825c2 100644 --- a/mysql-test/t/compare.test +++ b/mysql-test/t/compare.test @@ -46,3 +46,34 @@ insert into t1 values (0x01,0x01); select * from t1 where a=b; select * from t1 where a=b and b=0x01; drop table if exists t1; + +# +# Bug #31887: DML Select statement not returning same results when executed +# in version 5 +# + +CREATE TABLE t1 (b int(2) zerofill, c int(2) zerofill); +INSERT INTO t1 (b,c) VALUES (1,2), (1,1), (2,2); + +SELECT CONCAT(b,c), CONCAT(b,c) = '0101' FROM t1; + +EXPLAIN EXTENDED SELECT b,c FROM t1 WHERE b = 1 AND CONCAT(b,c) = '0101'; +SELECT b,c FROM t1 WHERE b = 1 AND CONCAT(b,c) = '0101'; + +CREATE TABLE t2 (a int); +INSERT INTO t2 VALUES (1),(2); + +SELECT a, + (SELECT COUNT(*) FROM t1 + WHERE b = t2.a AND CONCAT(b,c) = CONCAT('0',t2.a,'01')) x +FROM t2 ORDER BY a; + +EXPLAIN EXTENDED +SELECT a, + (SELECT COUNT(*) FROM t1 + WHERE b = t2.a AND CONCAT(b,c) = CONCAT('0',t2.a,'01')) x +FROM t2 ORDER BY a; + +DROP TABLE t1,t2; + +--echo End of 5.0 tests -- cgit v1.2.1 From d6be1a9b957b47c2cf67590932629984c1ef5a14 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 17 Feb 2008 15:48:17 +0400 Subject: Bug #32942 now() - interval '7200' second NOT pre-calculated, causing "full table scan" Problem is not about intervals and doesn't actually cause 'full table scan'. We have an optimization for DISTINCT when we have 'DISTINCT field_from_first_join_table' we don't need to read all the rows from the JOIN-ed table if we found one conforming row. It stopped working in 5.0 as we return NESTED_LOOP_OK if we came upon that case in the evaluate_join_record() and that doesn't break the recordreading loop in sub_select(). Fixed by returning NESTED_LOOP_NO_MORE_ROWS in this case. mysql-test/r/select.result: Bug #32942 now() - interval '7200' second is NOT pre-calculated, causing "full table scan". test result mysql-test/t/select.test: Bug #32942 now() - interval '7200' second is NOT pre-calculated, causing "full table scan" test case sql/sql_select.cc: Bug #32942 now() - interval '7200' second NOT pre-calculated, causing "full table scan" return NESTED_LOOP_NO_MORE_ROWS when we don't need to read rows from this table anymore --- mysql-test/t/select.test | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index c48f2771aa8..51e0aeace7c 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -3672,4 +3672,22 @@ DROP TABLE t1; --echo +# +# Bug #32942 now() - interval '7200' second is NOT pre-calculated, causing "full table scan" +# + +CREATE TABLE t1 (a INT, b INT); +CREATE TABLE t2 (a INT, c INT, KEY(a)); + +INSERT INTO t1 VALUES (1, 1), (2, 2); +INSERT INTO t2 VALUES (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), + (2, 1), (2, 2), (2, 3), (2, 4), (2, 5), + (3, 1), (3, 2), (3, 3), (3, 4), (3, 5), + (4, 1), (4, 2), (4, 3), (4, 4), (4, 5); + +FLUSH STATUS; +SELECT DISTINCT b FROM t1 LEFT JOIN t2 USING(a) WHERE c <= 3; +SHOW STATUS LIKE 'Handler_read%'; +DROP TABLE t1, t2; + --echo End of 5.0 tests -- cgit v1.2.1 From e31806674f134f456af312b62b981bf2735768e2 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 17 Feb 2008 15:07:41 +0300 Subject: Post-merge fix. --- mysql-test/t/sp.test | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index b9f5572864e..b9056d86d7e 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -7900,25 +7900,6 @@ DROP DATABASE db28318_a; DROP DATABASE db28318_b; use test; ---echo # ---echo # Bug#30787: Stored function ignores user defined alias. ---echo # -use test; ---disable_warnings -drop function if exists func30787; ---enable_warnings -create table t1(f1 int); -insert into t1 values(1),(2); -delimiter |; -create function func30787(p1 int) returns int -begin - return p1; -end | -delimiter ;| -select (select func30787(f1)) as ttt from t1; -drop function func30787; -drop table t1; - ########################################################################### # @@ -7996,6 +7977,25 @@ call proc_33618(20); drop table t_33618; drop procedure proc_33618; +--echo # +--echo # Bug#30787: Stored function ignores user defined alias. +--echo # +use test; +--disable_warnings +drop function if exists func30787; +--enable_warnings +create table t1(f1 int); +insert into t1 values(1),(2); +delimiter |; +create function func30787(p1 int) returns int +begin + return p1; +end | +delimiter ;| +select (select func30787(f1)) as ttt from t1; +drop function func30787; +drop table t1; + ########################################################################### --echo # ------------------------------------------------------------------ -- cgit v1.2.1 From f802cd51238c7842b789e49ba27d3c119ebb8ce3 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 19 Feb 2008 18:16:17 +0400 Subject: BUG#34289 - Incorrect NAME_CONST substitution in stored procedures breaks replication NAME_CONST() didn't replicate constant character set and collation correctly. With this fix NAME_CONST() inherits collation from the value argument. mysql-test/r/func_misc.result: A test case for BUG#34289. mysql-test/t/func_misc.test: A test case for BUG#34289. sql/item.cc: Inherit collation from value argument. --- mysql-test/t/func_misc.test | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test index ccb59df5677..17a0dbe50a7 100644 --- a/mysql-test/t/func_misc.test +++ b/mysql-test/t/func_misc.test @@ -237,5 +237,11 @@ insert into t1 values (-1), (-2); select min(a) from t1 group by inet_ntoa(a); drop table t1; +# +# BUG#34289 - Incorrect NAME_CONST substitution in stored procedures breaks +# replication +# +SELECT NAME_CONST('var', 'value') COLLATE latin1_general_cs; + --echo End of 5.0 tests -- cgit v1.2.1 From 1ac319248f6d9ed920c402cb90ed52690161750c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 19 Feb 2008 17:27:18 +0200 Subject: Bug #30604: different flagging of time_zone_used in normal and ps-protocol Finding a routine should be a transparent operation as far as the binary log is concerned. But it was influencing the binary log because of the TIMESTAMP column in the proc table. Fixed by preserving and restoring the time_zone usage flag when searching for a stored routine in the proc table. mysql-test/r/binlog_innodb.result: Bug #30604: test case mysql-test/r/ctype_cp932_binlog.result: Bug #30604: updated test results (a procedure call before that) mysql-test/t/binlog_innodb.test: Bug #30604: test case sql/sp.cc: Bug #30604: finding a routine should be a transparent operation as far as the binary log is concerned. Fixed by preserving and restoring the time_zone usage flag. --- mysql-test/t/binlog_innodb.test | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/binlog_innodb.test b/mysql-test/t/binlog_innodb.test index 2da7b2b0895..47b09719ef5 100644 --- a/mysql-test/t/binlog_innodb.test +++ b/mysql-test/t/binlog_innodb.test @@ -37,3 +37,28 @@ show status like "binlog_cache_disk_use"; drop table t1; +# +# Bug #30604: different flagging of time_zone_used in normal and ps-protocol +# + +CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=MyISAM; +CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB; + +DELIMITER |; +# the function does not deal with time objects +CREATE FUNCTION bug23333() +RETURNS int(11) +DETERMINISTIC +BEGIN + INSERT INTO t1 VALUES (NULL); + SELECT COUNT(*) FROM t1 INTO @a; + RETURN @a; +END| + +DELIMITER ;| + +INSERT INTO t2 VALUES (2),(10+bug23333()); +--replace_column 1 # +SHOW MASTER STATUS; +DROP FUNCTION bug23333; +DROP TABLE t1, t2; -- cgit v1.2.1 From 61c31af45d075e1aa1135b502209c04ca890425f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 Feb 2008 00:33:43 +0300 Subject: Fix for bug #31236: Inconsistent division by zero behavior for floating point numbers Some math functions did not check if the result is a valid number (i.e. neither of +-inf or nan). Fixed by validating the result where necessary and returning NULL in case of invalid result. BitKeeper/deleted/.del-matherr.c: Rename: sql/matherr.c -> BitKeeper/deleted/.del-matherr.c configure.in: Removed DONT_USE_FINITE, it is not used anywhere. include/my_global.h: isfinite() is a C99 macro which absoletes finite(). First try to use it, then fall back to finite() if the target platform has it, otherwise use our own implementation. mysql-test/r/func_math.result: Added a test case for bug #31236. mysql-test/r/strict.result: Fixed a test case which relied on old behavior. mysql-test/t/func_math.test: Added a test case for bug #31236. mysql-test/t/strict.test: Fixed a test case which relied on old behavior. sql/field.cc: No need to check if the finite() or its equivalent is available. sql/item_func.cc: Use fix_result() wherever the result can be one of +-inf or nan, assuming the function arguments are valid numbers. Removed fix_result() from functions that are defined for all possible input numbers. sql/item_func.h: Moved fix_result() from Item_dec_func to Item_func which is a common ancestor for Item_dec_func and Item_num_op. sql/unireg.h: Removed POSTFIX_ERROR because no code returns it. --- mysql-test/t/func_math.test | 14 +++++++++++++- mysql-test/t/strict.test | 1 - 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index 274a953a314..87b172a6436 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -248,5 +248,17 @@ INSERT INTO t1 VALUES ('a'); SELECT a DIV 2 FROM t1 UNION SELECT a DIV 2 FROM t1; DROP TABLE t1; - --echo End of 5.0 tests + +# +# Bug #31236: Inconsistent division by zero behavior for floating point numbers +# + +SELECT 1e308 + 1e308; +SELECT -1e308 - 1e308; +SELECT 1e300 * 1e300; +SELECT 1e300 / 1e-300; +SELECT EXP(750); +SELECT POW(10, 309); + +--echo End of 5.1 tests diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test index 2b71bf1093c..486f7ce7897 100644 --- a/mysql-test/t/strict.test +++ b/mysql-test/t/strict.test @@ -822,7 +822,6 @@ INSERT INTO t1 (col2) VALUES (-1.1E-3); INSERT INTO t1 (col1) VALUES ('+1.8E+309'); --error 1264 INSERT INTO t1 (col2) VALUES ('-1.2E-3'); ---error 1264 UPDATE t1 SET col1 =col1 * 5000 WHERE col1 > 0; --error 1365 UPDATE t1 SET col2 =col2 / 0 WHERE col2 > 0; -- cgit v1.2.1 From daffceb4e275cb520c7c3277aae420e11c94ca0e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 Feb 2008 17:41:39 +0300 Subject: Bug#33266: Incorrect test case for the bug#31048 failing on some platforms. The test case for the bug#31048 checks that there is no crash on stack overrun. But due to different stack sizes on different platforms it failed on some of them. The new test case check that a query with at least 4 level subquery nesting works without the stack overrun nesting and other levels of nesting doesn't cause a crash. mysql-test/t/subselect.test: Corrected test case for the bug#31048. mysql-test/r/subselect.result: Corrected test case for the bug#31048. --- mysql-test/t/subselect.test | 124 ++++++++++++++------------------------------ 1 file changed, 38 insertions(+), 86 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 326d80f84c1..c5edd5414e3 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -3006,92 +3006,44 @@ DROP TABLE t1,t2; create table t1(a int,b int,key(a),key(b)); insert into t1(a,b) values (1,2),(2,1),(2,3),(3,4),(5,4),(5,5), (6,7),(7,4),(5,3); -# test for the stack overflow bug -select sum(a),a from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 - )group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1) -group by a; ---replace_regex /overrun.*$/overrun detected/ ---error 1436 -select sum(a),a from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1) -group by a; -# test for the memory consumption & subquery slowness bug -explain select sum(a),a from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 - )group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1) -group by a; ---replace_regex /overrun.*$/overrun detected/ ---error 1436 -explain select sum(a),a from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1) -group by a; + +let $nesting= 26; +let $should_work_nesting= 5; +let $start= select sum(a),a from t1 where a> ( select sum(a) from t1 ; +let $end= )group by a ; +let $start_app= where a> ( select sum(a) from t1 ; +let $end_pre= )group by b limit 1 ; + +--disable_result_log +--disable_query_log +# At least 4 level nesting should work without errors +while ($should_work_nesting) +{ +--echo $should_work_nesting + eval $start $end; + eval explain $start $end; + let $start= $start + $start_app; + let $end= $end_pre + $end; + dec $should_work_nesting; +} +# Other may fail with the 'stack overrun error' +while ($nesting) +{ +--echo $nesting +--error 0,1436 + eval $start $end; +--error 0,1436 + eval explain $start $end; + let $start= $start + $start_app; + let $end= $end_pre + $end; + dec $nesting; +} +--enable_result_log +--enable_query_log drop table t1; # -- cgit v1.2.1 From 27498bbaba9f40f875d62fe0bb676c8218ee2880 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 Feb 2008 16:59:03 +0200 Subject: Fixed a test. mysql-test/r/change_user.result: Replaced value in result file, it was dependend on architecture. mysql-test/t/change_user.test: Replaced an architecture dependend value in test sql/mysqld.cc: Can be made shorter and without ifdefs. --- mysql-test/t/change_user.test | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/change_user.test b/mysql-test/t/change_user.test index d0cdfc8a741..fa7cecdb5ee 100644 --- a/mysql-test/t/change_user.test +++ b/mysql-test/t/change_user.test @@ -4,17 +4,22 @@ --echo Bug#20023 SELECT @@session.sql_big_selects; +--replace_result 18446744073709551615 MAX_JOIN_SIZE 4294967295 MAX_JOIN_SIZE SELECT @@global.max_join_size; --echo change_user --change_user SELECT @@session.sql_big_selects; +--replace_result 18446744073709551615 MAX_JOIN_SIZE 4294967295 MAX_JOIN_SIZE SELECT @@global.max_join_size; SET @@global.max_join_size = 10000; SET @@session.max_join_size = default; --echo change_user --change_user SELECT @@session.sql_big_selects; +# On some machines the following will result into a warning +--disable_warnings SET @@global.max_join_size = -1; +--enable_warnings SET @@session.max_join_size = default; --echo change_user --change_user -- cgit v1.2.1 From 1a8be8bccb198959c35794bc9055da093b0a4fc9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Feb 2008 12:30:17 +0400 Subject: Bug#23588 SHOW COLUMNS on a temporary table causes locking issues skip lock_type update for temporary tables mysql-test/r/tablelock.result: test result mysql-test/t/tablelock.test: test case sql/sql_base.cc: skip lock_type update for temporary tables --- mysql-test/t/tablelock.test | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/tablelock.test b/mysql-test/t/tablelock.test index 95533903b45..5ac93f09ac1 100644 --- a/mysql-test/t/tablelock.test +++ b/mysql-test/t/tablelock.test @@ -49,3 +49,16 @@ drop table t2,t1; unlock tables; # End of 4.1 tests + +# +# Bug#23588 SHOW COLUMNS on a temporary table causes locking issues +# +create temporary table t1(f1 int); +lock tables t1 write; +insert into t1 values (1); +show columns from t1; +insert into t1 values(2); +drop table t1; +unlock tables; + +# End of 5.0 tests -- cgit v1.2.1 From 012aab7d8bf7ae9c30751a6d5f666c7731ecfdf3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Feb 2008 11:34:18 +0300 Subject: Fix for bug #33049: Assert while running test-as3ap test(mysql-bench suite) Under some circumstances a combination of aggregate functions and GROUP BY in a SELECT query over a VIEW could lead to incorrect calculation of the result type of the aggregate function. This in turn could result in incorrect results, or assertion failures on debug builds. Fixed by changing the logic in Item_sum_hybrid::fix_fields() so that the argument's item is dereferenced before calling its type() method. mysql-test/r/view.result: Added a test case for bug #33049. mysql-test/t/view.test: Added a test case for bug #33049. sql/item_sum.cc: When calculating the result type of an aggregate function, dereference the argument's item before calling its type() method. --- mysql-test/t/view.test | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index b321f8604f7..d7461504b20 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -3492,5 +3492,18 @@ execute stmt; drop view v1, v2; drop table t1, t2; +# +# Bug #33049: Assert while running test-as3ap test(mysql-bench suite) +# + +CREATE TABLE t1 (a INT); +CREATE VIEW v1 AS SELECT p.a AS a FROM t1 p, t1 q; + +INSERT INTO t1 VALUES (1), (1); +SELECT MAX(a), COUNT(DISTINCT a) FROM v1 GROUP BY a; + +DROP VIEW v1; +DROP TABLE t1; + --echo End of 5.0 tests. -- cgit v1.2.1 From fea2a5d83dea81e231bb14bc5535b60261c7b30d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Feb 2008 19:07:07 +0400 Subject: BUG#13861 - START SLAVE UNTIL may stop 1 evnt too late if log-slave-updates and circul repl Slave SQL thread may execute one extra event when there are events skipped by slave I/O thread (e.g. originated by the same server). Whereas it was requested not to do so by the UNTIL condition. This happens because we compare with the end position of previously executed event. This is fine when there are no skipped by slave I/O thread events, as end position of previous event equals to start position of to be executed event. Otherwise this position equals to start position of skipped event. This is fixed by: - reading the event to be executed before checking if the until condition is satisfied. - comparing the start position of the event to be executed. Since we do not have the start position available, we compute it by subtracting event length from end position (which is available). - if there are no events on the event queue at the slave sql starting time, that meet until condition, we stop immediately, as in this case we do not want to wait for next event. mysql-test/r/rpl_dual_pos_advance.result: A test case for BUG#13861. mysql-test/t/rpl_dual_pos_advance.test: A test case for BUG#13861. sql/log_event.cc: Store length of event. This is needed for further calculation of the beginning of event. sql/slave.cc: Slave SQL thread may execute one extra event when there are events skipped by slave I/O thread (e.g. originated by the same server). Whereas it was requested not to do so by the UNTIL condition. This happens because we compare with the end position of previously executed event. This is fine when there are no skipped by slave I/O thread events, as end position of previous event equals to start position of to be executed event. Otherwise this position equals to start position of skipped event. This is fixed by: - reading the event to be executed before checking if the until condition is satisfied. - comparing the start position of the event to be executed. Since we do not have the start position available, we compute it by subtracting event length from end position (which is available). - if there are no events on the event queue at the slave sql starting time, that meet until condition, we stop immediately, as in this case we do not want to wait for next event. sql/slave.h: Added master_log_pos parametr to is_until_satisfied(). mysql-test/t/rpl_dual_pos_advance-slave.opt: New BitKeeper file ``mysql-test/t/rpl_dual_pos_advance-slave.opt'' --- mysql-test/t/rpl_dual_pos_advance-slave.opt | 1 + mysql-test/t/rpl_dual_pos_advance.test | 56 +++++++++++++++++++---------- 2 files changed, 39 insertions(+), 18 deletions(-) create mode 100644 mysql-test/t/rpl_dual_pos_advance-slave.opt (limited to 'mysql-test/t') diff --git a/mysql-test/t/rpl_dual_pos_advance-slave.opt b/mysql-test/t/rpl_dual_pos_advance-slave.opt new file mode 100644 index 00000000000..627becdbfb5 --- /dev/null +++ b/mysql-test/t/rpl_dual_pos_advance-slave.opt @@ -0,0 +1 @@ +--innodb diff --git a/mysql-test/t/rpl_dual_pos_advance.test b/mysql-test/t/rpl_dual_pos_advance.test index 518fa9df885..5e08284a2f2 100644 --- a/mysql-test/t/rpl_dual_pos_advance.test +++ b/mysql-test/t/rpl_dual_pos_advance.test @@ -7,6 +7,7 @@ # It also will test BUG#13861. source include/master-slave.inc; +source include/have_innodb.inc; # set up "dual head" @@ -30,45 +31,64 @@ save_master_pos; connection master; sync_with_master; -# Now test BUG#13861. This will be enabled when Guilhem fixes this -# bug. +# +# BUG#13861 - START SLAVE UNTIL may stop 1 evnt too late if +# log-slave-updates and circul repl +# +stop slave; -# stop slave +create table t2 (n int); # create one ignored event -# create table t2 (n int); # create one ignored event +save_master_pos; +connection slave; +sync_with_master; -# save_master_pos; -# connection slave; -# sync_with_master; +connection slave; -# connection slave; +show tables; -# show tables; +save_master_pos; -# save_master_pos; +create table t3 (n int) engine=innodb; +set @a=1; +insert into t3 values(@a); +begin; +insert into t3 values(2); +insert into t3 values(3); +commit; +insert into t3 values(4); -# create table t3 (n int); -# connection master; +connection master; # bug is that START SLAVE UNTIL may stop too late, we test that by # asking it to stop before creation of t3. -# start slave until master_log_file="slave-bin.000001",master_log_pos=195; +start slave until master_log_file="slave-bin.000001",master_log_pos=195; # wait until it's started (the position below is the start of "CREATE # TABLE t2") (otherwise wait_for_slave_to_stop may return at once) -# select master_pos_wait("slave-bin.000001",137); +select master_pos_wait("slave-bin.000001",137); -# wait_for_slave_to_stop; +wait_for_slave_to_stop; # then BUG#13861 causes t3 to show up below (because stopped too # late). -# show tables; +show tables; + +# ensure that we do not break set @a=1; insert into t3 values(@a); +start slave until master_log_file="slave-bin.000001",master_log_pos=438; +wait_for_slave_to_stop; +select * from t3; + +# ensure that we do not break transaction +start slave until master_log_file="slave-bin.000001",master_log_pos=663; +wait_for_slave_to_stop; +select * from t3; -# start slave; +start slave; # BUG#13023 is that Exec_master_log_pos may stay too low "forever": @@ -99,7 +119,7 @@ show tables; stop slave; reset slave; -drop table t1,t4,t5,t6; # add t2 and t3 later +drop table t1,t2,t3,t4,t5,t6; save_master_pos; connection slave; -- cgit v1.2.1 From 7b8717ace88805a6a243a2800fc7d3fc70d2fddc Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 24 Feb 2008 01:31:54 +0100 Subject: Bug#20752: BENCHMARK with many iterations returns too quickly In BENCHMARK(count, expr), count could overflow/wrap-around. Patch changes to a sufficiently large data-type. Adds a warning for negative count values. mysql-test/r/func_str.result: show that a negative 'count' for BENCHMARK(count, expr) throws a warning and returns NULL. mysql-test/t/func_str.test: show that a negative 'count' for BENCHMARK(count, expr) throws a warning and returns NULL. sql/item_func.cc: use ulonglong rather than ulong in BENCHMARK(count, expr) throw warning on negative 'count'; return SQL-NULL. --- mysql-test/t/func_str.test | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index b6da14211ae..5a5f4024bc4 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -874,6 +874,13 @@ select benchmark(0, NULL); select benchmark(100, NULL); select benchmark(NULL, 1+1); +# +# Bug #20752: BENCHMARK with many iterations returns too quickly +# + +# not a string, but belongs with the above Bug#22684 +select benchmark(-1, 1); + # # Please note: # 1) The collation of the password is irrelevant, the encryption uses -- cgit v1.2.1 From a22c3d21096f827d4eb7dfc1b3546cb758123756 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 24 Feb 2008 13:58:07 +0100 Subject: Bug#32753: PAD_CHAR_TO_FULL_LENGTH is not documented and interferes with grant tables SQL-mode PAD_CHAR_TO_FULL_LENGTH affected mysqld's user-table too. If enabled, user-name and host were space-padded and no longer matched the login-data of incoming connexions. Patch disregards pad-flag while loading privileges so ability to log in does not depend on SQL-mode. mysql-test/r/sql_mode.result: show that SQL-mode 'PAD_CHAR_TO_FULL_LENGTH' does not affect loading of privileges (and by extension, ability to log in). mysql-test/t/sql_mode.test: show that SQL-mode 'PAD_CHAR_TO_FULL_LENGTH' does not affect loading of privileges (and by extension, ability to log in). sql/sql_acl.cc: temporarily disable SQL-mode 'PAD_CHAR_TO_FULL_LENGTH' while reloading privileges --- mysql-test/t/sql_mode.test | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/sql_mode.test b/mysql-test/t/sql_mode.test index 7a9036c8621..acc9cc7979e 100644 --- a/mysql-test/t/sql_mode.test +++ b/mysql-test/t/sql_mode.test @@ -279,3 +279,32 @@ select concat('x',b,'x') from t1; drop table t1; SET @@SQL_MODE=@OLD_SQL_MODE; + + +# +# Bug #32753: PAD_CHAR_TO_FULL_LENGTH is not documented and interferes +# with grant tables +# + +create user mysqltest_32753@localhost; + +# try to make the user-table space-padded +--connection default +set @OLD_SQL_MODE=@@SESSION.SQL_MODE; +set session sql_mode='PAD_CHAR_TO_FULL_LENGTH'; +flush privileges; + +# if user-table is affected by PAD_CHAR_TO_FULL_LENGTH, our connect will fail +# --error 1045 +connect (user_32753,localhost,mysqltest_32753,,test,$MASTER_MYPORT,$MASTER_MYSOCK); +select current_user(); + +# clean up +--connection default +set session sql_mode=@OLD_SQL_MODE; +flush privileges; + +--disconnect user_32753 + +--connection default +drop user mysqltest_32753@localhost; -- cgit v1.2.1 From 9bd3b8545a44188502a1a142e6f2171ac5b600e1 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 24 Feb 2008 14:12:17 +0100 Subject: Bug#32757: hang with sql_mode set when setting some global variables If setting a system-variable provided by a plug-in failed, no OK or error was sent in some cases, hanging the client. We now send an error in the case from the ticket (integer-argument out of range in STRICT mode). We also provide a semi-generic fallback message for possible future cases like this where an error is signalled, but no message is sent to the client. The error/warning handling is unified so it's the same again for variables provided by plugins and those in the server proper. mysql-test/r/plugin.result: show that on out-of-range values, plugin interface throws errors in STRICT mode and warnings otherwise. mysql-test/t/plugin.test: show that on out-of-range values, plugin interface throws errors in STRICT mode and warnings otherwise. sql/set_var.cc: - handle signedness of values used in warnings - in STRICT mode, throw errors rather than warnings sql/sql_parse.cc: If sql_set_variables() returns with an error but no message was sent to the client, send a semi-generic one so the session won't hang and we won't fail silently. sql/sql_plugin.cc: throw a warning if more than just block-size was corrected (or an error in STRICT mode). use functions from set_var for uniform behaviour of server- and plug-in variables. storage/example/ha_example.cc: Add a ULONG system variable to example plugin so we can test integers in the plugin-interface without having to depend on the presence of innobase. --- mysql-test/t/plugin.test | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/plugin.test b/mysql-test/t/plugin.test index d8d6d069676..0635a58a4a6 100644 --- a/mysql-test/t/plugin.test +++ b/mysql-test/t/plugin.test @@ -39,3 +39,38 @@ SET GLOBAL example_enum_var= e2; SET GLOBAL example_enum_var= impossible; UNINSTALL PLUGIN example; + + + +# +# Bug #32757 hang with sql_mode set when setting some global variables +# +INSTALL PLUGIN example SONAME 'ha_example.so'; + +select @@session.sql_mode into @old_sql_mode; + +# first, try normal sql_mode (no error, send OK) +set session sql_mode=''; +set global example_ulong_var=500; +select @@global.example_ulong_var; +# overflow -- correct value, but throw warning +set global example_ulong_var=1111; +select @@global.example_ulong_var; + +# now, try STRICT (error occurrs, no message is sent, so send default) +set session sql_mode='STRICT_ALL_TABLES'; +set global example_ulong_var=500; +select @@global.example_ulong_var; +# overflow -- throw warning, do NOT change value +--error ER_WRONG_VALUE_FOR_VAR +set global example_ulong_var=1111; +select @@global.example_ulong_var; + +set session sql_mode=@old_sql_mode; + +# finally, show that conditions that already raised an error are not +# adversely affected (error was already sent, do nothing) +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session old=bla; + +UNINSTALL PLUGIN example; -- cgit v1.2.1 From 4f3eab58046a42f66abd68d547ad97a9d58ecb04 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 25 Feb 2008 13:25:57 +0300 Subject: Fix for bug #33834: FRAC_SECOND: Applicability not clear in documentation While the manual mentions FRAC_SECOND only for the TIMESTAMPADD() function, it was also possible to use FRAC_SECOND with DATE_ADD(), DATE_SUB() and +/- INTERVAL. Fixed the parser to match the manual, i.e. using FRAC_SECOND for anything other than TIMESTAMPADD()/TIMESTAMPDIFF() now produces a syntax error. Additionally, the patch allows MICROSECOND to be used in TIMESTAMPADD/ TIMESTAMPDIFF and marks FRAC_SECOND as deprecated. mysql-test/r/func_time.result: Added a test case for bug #33834. mysql-test/t/func_time.test: Added a test case for bug #33834. sql/sql_yacc.yy: Reject FRAC_SECOND for anything other than TIMESTAMPADD() or TIMESTAMPDIFF(). Allow MICROSECOND to be used with TIMESTAMPADD()/TIMESTAMPDIFF(). Warn about FRAC_SECOND being a deprecated unit. --- mysql-test/t/func_time.test | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index b0f47e0ad56..613a2fc7ca0 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -804,4 +804,23 @@ select DATE_ADD(20071108, INTERVAL 1 DAY); select LAST_DAY('2007-12-06 08:59:19.05') - INTERVAL 1 SECOND; +# +# Bug#33834: FRAC_SECOND: Applicability not clear in documentation +# +# Show that he use of FRAC_SECOND, for anything other than +# TIMESTAMPADD / TIMESTAMPDIFF, is a server error. + +SELECT TIMESTAMPADD(FRAC_SECOND, 1, '2008-02-18'); +SELECT TIMESTAMPDIFF(FRAC_SECOND, '2008-02-17', '2008-02-18'); + +--error ER_PARSE_ERROR +SELECT DATE_ADD('2008-02-18', INTERVAL 1 FRAC_SECOND); +--error ER_PARSE_ERROR +SELECT DATE_SUB('2008-02-18', INTERVAL 1 FRAC_SECOND); + +--error ER_PARSE_ERROR +SELECT '2008-02-18' + INTERVAL 1 FRAC_SECOND; +--error ER_PARSE_ERROR +SELECT '2008-02-18' - INTERVAL 1 FRAC_SECOND; + --echo End of 5.0 tests -- cgit v1.2.1 From db9b2bdc1b229e492d0e60761d7f62db1ee0f652 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 25 Feb 2008 21:18:50 +0100 Subject: Post push fix Fixed a missed case in the patch for Bug#31931. Also makes Bug#33722 a duplicate of Bug#31931. Added tests for better coverage. Replaced some legacy function calls. mysql-test/r/partition.result: Added tests for better coverage mysql-test/r/partition_datatype.result: Added tests for better coverage mysql-test/r/partition_error.result: Added tests for better coverage mysql-test/suite/parts/inc/partition_engine.inc: Bug#31931: Mix of handlers error message Bug#33722 is fixed within this patch too mysql-test/suite/parts/r/partition_engine_innodb.result: Bug#31931: Mix of handlers error message Bug#33722 is fixed within this patch too mysql-test/suite/parts/r/partition_engine_myisam.result: Bug#31931: Mix of handlers error message Bug#33722 is fixed within this patch too mysql-test/t/partition.test: Added tests for better coverage mysql-test/t/partition_datatype.test: Added tests for better coverage mysql-test/t/partition_error.test: Added tests for Bug#31931 sql/partition_info.cc: Bug#31931: Mix of handlers error message Fixed case where given info->db_type not matched thd->lex->create_info.db_type And the check for inconsistent subpartition engines-clauses. sql/sql_partition.cc: Changed ha_legacy_type to ha_resolve_storage_engine_name sql/sql_table.cc: Changed ha_legacy_type to ha_resolve_storage_engine_name --- mysql-test/t/partition.test | 14 ++++++++++++-- mysql-test/t/partition_datatype.test | 3 +++ mysql-test/t/partition_error.test | 18 ++++++++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 5adf21d53e8..c4e447988db 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -1215,13 +1215,15 @@ DROP TABLE t1; # # Bug 17455 Partitions: Wrong message and error when using Repair/Optimize # table on partitioned table -# +# (added check/analyze for gcov of Bug#20129) create table t1 (a int) engine=MEMORY partition by key (a); REPAIR TABLE t1; OPTIMIZE TABLE t1; +CHECK TABLE t1; +ANALYZE TABLE t1; drop table t1; @@ -1524,7 +1526,7 @@ select c1 from t1 group by (select c0 from t1 limit 1); drop table t1; # Bug #30495: optimize table t1,t2,t3 extended errors -# +# (added more maintenace commands for Bug#20129 CREATE TABLE t1(a int) PARTITION BY RANGE (a) ( PARTITION p1 VALUES LESS THAN (10), @@ -1534,6 +1536,14 @@ PARTITION BY RANGE (a) ( ALTER TABLE t1 OPTIMIZE PARTITION p1 EXTENDED; --error ER_PARSE_ERROR ALTER TABLE t1 ANALYZE PARTITION p1 EXTENDED; +--error ER_CHECK_NOT_IMPLEMENTED +ALTER TABLE t1 ANALYZE PARTITION p1; +--error ER_CHECK_NOT_IMPLEMENTED +ALTER TABLE t1 CHECK PARTITION p1; +--error ER_CHECK_NOT_IMPLEMENTED +ALTER TABLE t1 REPAIR PARTITION p1; +--error ER_CHECK_NOT_IMPLEMENTED +ALTER TABLE t1 OPTIMIZE PARTITION p1; DROP TABLE t1; # diff --git a/mysql-test/t/partition_datatype.test b/mysql-test/t/partition_datatype.test index c21fb40f735..7440a9bf3a3 100644 --- a/mysql-test/t/partition_datatype.test +++ b/mysql-test/t/partition_datatype.test @@ -103,7 +103,10 @@ drop table t1; -- echo # test with null allowed create table t1 (a bit) partition by key (a); insert into t1 values (b'1'); +insert into t1 values (NULL); select hex(a) from t1 where a = b'1'; +select hex(a) from t1 where a is NULL; +select hex(a) from t1 order by a; drop table t1; create table t1 (a tinyint) partition by key (a); insert into t1 values (2); diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test index c9b95fc1664..d470fb67b49 100644 --- a/mysql-test/t/partition_error.test +++ b/mysql-test/t/partition_error.test @@ -8,6 +8,24 @@ drop table if exists t1; --enable_warnings +# +# Bug#31931: Mix of handlers error message +# +--error ER_MIX_HANDLER_ERROR +CREATE TABLE t1 (a INT) +PARTITION BY HASH (a) +( PARTITION p0 ENGINE=MyISAM, + PARTITION p1); +--error ER_MIX_HANDLER_ERROR +CREATE TABLE t1 (a INT) +PARTITION BY LIST (a) +SUBPARTITION BY HASH (a) +( PARTITION p0 VALUES IN (0) +( SUBPARTITION s0, SUBPARTITION s1 ENGINE=MyISAM, SUBPARTITION s2), + PARTITION p1 VALUES IN (1) +( SUBPARTITION s3 ENGINE=MyISAM, SUBPARTITION s4, SUBPARTITION s5 ENGINE=MyISAM)); + + # # Bug 29368: # Incorrect error, 1467, for syntax error when creating partition -- cgit v1.2.1 From c8885dfb7328525d4068d6354931e1f68374c605 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Feb 2008 18:12:08 +0300 Subject: Fixed test suite failures with --ps-protocol introduced in PB by the patch for bug #33834. --- mysql-test/t/func_time.test | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 613a2fc7ca0..ef22adb4251 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -336,7 +336,7 @@ select date_add(date,INTERVAL "1" QUARTER) from t1; select timestampadd(MINUTE, 1, date) from t1; select timestampadd(WEEK, 1, date) from t1; select timestampadd(SQL_TSI_SECOND, 1, date) from t1; -# Prepared statements doesn't support FRAC_SECOND yet +# mysqltest.c discards an expected 'deprecated' warning on prepare stage --disable_ps_protocol select timestampadd(SQL_TSI_FRAC_SECOND, 1, date) from t1; --enable_ps_protocol @@ -351,7 +351,10 @@ select timestampdiff(SQL_TSI_HOUR, '2001-02-01', '2001-05-01') as a; select timestampdiff(SQL_TSI_DAY, '2001-02-01', '2001-05-01') as a; select timestampdiff(SQL_TSI_MINUTE, '2001-02-01 12:59:59', '2001-05-01 12:58:59') as a; select timestampdiff(SQL_TSI_SECOND, '2001-02-01 12:59:59', '2001-05-01 12:58:58') as a; +# mysqltest.c discards an expected 'deprecated' warning on prepare stage +--disable_ps_protocol select timestampdiff(SQL_TSI_FRAC_SECOND, '2001-02-01 12:59:59.120000', '2001-05-01 12:58:58.119999') as a; +--enable_ps_protocol select timestampdiff(SQL_TSI_DAY, '1986-02-01', '1986-03-01') as a1, timestampdiff(SQL_TSI_DAY, '1900-02-01', '1900-03-01') as a2, @@ -810,8 +813,11 @@ select LAST_DAY('2007-12-06 08:59:19.05') - INTERVAL 1 SECOND; # Show that he use of FRAC_SECOND, for anything other than # TIMESTAMPADD / TIMESTAMPDIFF, is a server error. +# mysqltest.c discards an expected 'deprecated' warning on prepare stage +--disable_ps_protocol SELECT TIMESTAMPADD(FRAC_SECOND, 1, '2008-02-18'); SELECT TIMESTAMPDIFF(FRAC_SECOND, '2008-02-17', '2008-02-18'); +--enable_ps_protocol --error ER_PARSE_ERROR SELECT DATE_ADD('2008-02-18', INTERVAL 1 FRAC_SECOND); -- cgit v1.2.1 From f28612eae272fb56f9bb07bddf31852882af7ed8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Feb 2008 13:31:19 +0200 Subject: Bug #34747: crash in debug assertion check after derived table Was a double-free of the Unique member of Item_func_group_concat. This was not causing a crash because the Unique is a descendent of Sql_alloc. Fixed to free the Unique only if it was allocated for the instance of Item_func_group_concat it was referenced from mysql-test/r/func_gconcat.result: Bug #34747: test case mysql-test/t/func_gconcat.test: Bug #34747: test case sql/item_sum.cc: Bug #34747: free the Unique only if it was allocated for this instance of Item_func_group_concat --- mysql-test/t/func_gconcat.test | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 84c286e516b..87632fbdbb8 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -640,4 +640,21 @@ SELECT GROUP_CONCAT(DISTINCT b, a ORDER BY b) FROM t1; DROP TABLE t1, t2, t3; +# +# Bug #34747: crash in debug assertion check after derived table +# +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (),(); +SELECT s1.d1 FROM +( + SELECT + t1.a as d1, + GROUP_CONCAT(DISTINCT t1.a) AS d2 + FROM + t1 AS t1, + t1 AS t2 + GROUP BY 1 +) AS s1; +DROP TABLE t1; + --echo End of 5.0 tests -- cgit v1.2.1 From 1af419436456808d05063810dfbeb11ac6aae9aa Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Feb 2008 16:46:52 +0400 Subject: Bug#32167 another privilege bypass with DATA/INDEX DIRECORY(3rd version for 5.1) added new function test_if_data_home_dir() which checks that path does not contain mysql data home directory. Using of 'mysql data home'/'any db name' in DATA DIRECTORY & INDEX DIRECTORY is disallowed mysql-test/r/partition.result: test result mysql-test/r/partition_not_windows.result: result fix mysql-test/r/partition_symlink.result: result fix mysql-test/r/symlink.result: test result update mysql-test/t/partition.test: test case mysql-test/t/partition_not_windows.test: test case update mysql-test/t/partition_symlink.test: test case update mysql-test/t/symlink.test: test case sql/mysql_priv.h: new variable mysql_unpacked_real_data_home sql/mysqld.cc: new variable mysql_unpacked_real_data_home sql/partition_info.cc: new check_partition_dirs() which checks data directory and index directory for partition elements sql/partition_info.h: new check_partition_dirs() which checks data directory and index directory for partition elements sql/sql_parse.cc: added new function test_if_data_home_dir() which checks that path does not contain mysql data home directory. Using of 'mysql data home'/'any db name' in DATA DIRECTORY & INDEX DIRECTORY is disallowed --- mysql-test/t/partition.test | 42 ++++++++++++++- mysql-test/t/partition_not_windows.test | 32 +++++------ mysql-test/t/partition_symlink.test | 40 ++++++++------ mysql-test/t/symlink.test | 94 +++++++++++++++------------------ 4 files changed, 121 insertions(+), 87 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 23d6c5f8865..d889fe83dc1 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -1407,8 +1407,8 @@ eval create table t2 (i int ) partition by range (i) ( partition p01 values less than (1000) - data directory="$MYSQLTEST_VARDIR/master-data/test/" - index directory="$MYSQLTEST_VARDIR/master-data/test/" + data directory="$MYSQLTEST_VARDIR/tmp/" + index directory="$MYSQLTEST_VARDIR/tmp/" ); enable_query_log; @@ -1574,6 +1574,44 @@ ALTER TABLE t1 OPTIMIZE PARTITION p1 EXTENDED; ALTER TABLE t1 ANALYZE PARTITION p1 EXTENDED; DROP TABLE t1; +# +# Bug#32167: another privilege bypass with DATA/INDEX DIRECTORY +# +--replace_result $MYSQLTEST_VARDIR TEST_DIR +--error 1210 +eval CREATE TABLE t1(a INT) +PARTITION BY KEY (a) +(PARTITION p0 DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'); +--replace_result $MYSQLTEST_VARDIR TEST_DIR +--error 1210 +eval CREATE TABLE t1(a INT) +PARTITION BY KEY (a) +(PARTITION p0 INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'); + +--replace_result $MYSQLTEST_VARDIR TEST_DIR +--error 1210 +eval CREATE TABLE ts (id INT, purchased DATE) +PARTITION BY RANGE(YEAR(purchased)) +SUBPARTITION BY HASH(TO_DAYS(purchased)) ( +PARTITION p0 VALUES LESS THAN (1990) ( +SUBPARTITION s0a + DATA DIRECTORY = '$MYSQLTEST_VARDIR/master-data/test', +SUBPARTITION s0b + DATA DIRECTORY = '$MYSQLTEST_VARDIR/master-data/test' +)); + +--replace_result $MYSQLTEST_VARDIR TEST_DIR +--error 1210 +eval CREATE TABLE ts (id INT, purchased DATE) +PARTITION BY RANGE(YEAR(purchased)) +SUBPARTITION BY HASH(TO_DAYS(purchased)) ( +PARTITION p0 VALUES LESS THAN (1990) ( +SUBPARTITION s0a + INDEX DIRECTORY = '$MYSQLTEST_VARDIR/master-data/test', +SUBPARTITION s0b + INDEX DIRECTORY = '$MYSQLTEST_VARDIR/master-data/test' +)); + # # Bug #29258: Partitions: search fails for maximum unsigned bigint # diff --git a/mysql-test/t/partition_not_windows.test b/mysql-test/t/partition_not_windows.test index 012b8b50dee..c5f54286095 100644 --- a/mysql-test/t/partition_not_windows.test +++ b/mysql-test/t/partition_not_windows.test @@ -12,12 +12,10 @@ # doesn't remove old directory --disable_query_log ---exec mkdir $MYSQLTEST_VARDIR/master-data/tmpdata || true -eval SET @data_dir = 'DATA DIRECTORY = ''$MYSQLTEST_VARDIR/master-data/tmpdata'''; +eval SET @data_dir = 'DATA DIRECTORY = ''$MYSQLTEST_VARDIR/tmp'''; let $data_directory = `select @data_dir`; ---exec mkdir $MYSQLTEST_VARDIR/master-data/tmpinx || true -eval SET @inx_dir = 'INDEX DIRECTORY = ''$MYSQLTEST_VARDIR/master-data/tmpinx'''; +eval SET @inx_dir = 'INDEX DIRECTORY = ''$MYSQLTEST_VARDIR/tmp'''; let $inx_directory = `select @inx_dir`; --enable_query_log @@ -35,10 +33,10 @@ subpartition by hash (a) --file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0#SP#subpart00.MYI --file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0#SP#subpart01.MYD --file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0#SP#subpart01.MYI ---file_exists $MYSQLTEST_VARDIR/master-data/tmpdata/t1#P#p0#SP#subpart00.MYD ---file_exists $MYSQLTEST_VARDIR/master-data/tmpdata/t1#P#p0#SP#subpart01.MYD ---file_exists $MYSQLTEST_VARDIR/master-data/tmpinx/t1#P#p0#SP#subpart00.MYI ---file_exists $MYSQLTEST_VARDIR/master-data/tmpinx/t1#P#p0#SP#subpart01.MYI +--file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p0#SP#subpart00.MYD +--file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p0#SP#subpart01.MYD +--file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p0#SP#subpart00.MYI +--file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p0#SP#subpart01.MYI --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval ALTER TABLE t1 REORGANIZE PARTITION p0 INTO @@ -58,18 +56,16 @@ eval ALTER TABLE t1 REORGANIZE PARTITION p0 INTO --file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p2#SP#subpart20.MYI --file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p2#SP#subpart21.MYD --file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p2#SP#subpart21.MYI ---file_exists $MYSQLTEST_VARDIR/master-data/tmpdata/t1#P#p1#SP#subpart10.MYD ---file_exists $MYSQLTEST_VARDIR/master-data/tmpdata/t1#P#p1#SP#subpart11.MYD ---file_exists $MYSQLTEST_VARDIR/master-data/tmpdata/t1#P#p2#SP#subpart20.MYD ---file_exists $MYSQLTEST_VARDIR/master-data/tmpdata/t1#P#p2#SP#subpart21.MYD ---file_exists $MYSQLTEST_VARDIR/master-data/tmpinx/t1#P#p1#SP#subpart10.MYI ---file_exists $MYSQLTEST_VARDIR/master-data/tmpinx/t1#P#p1#SP#subpart11.MYI ---file_exists $MYSQLTEST_VARDIR/master-data/tmpinx/t1#P#p2#SP#subpart20.MYI ---file_exists $MYSQLTEST_VARDIR/master-data/tmpinx/t1#P#p2#SP#subpart21.MYI +--file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p1#SP#subpart10.MYD +--file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p1#SP#subpart11.MYD +--file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p2#SP#subpart20.MYD +--file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p2#SP#subpart21.MYD +--file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p1#SP#subpart10.MYI +--file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p1#SP#subpart11.MYI +--file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p2#SP#subpart20.MYI +--file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p2#SP#subpart21.MYI drop table t1; ---exec rmdir $MYSQLTEST_VARDIR/master-data/tmpdata || true ---exec rmdir $MYSQLTEST_VARDIR/master-data/tmpinx || true # End Windows specific test failures. diff --git a/mysql-test/t/partition_symlink.test b/mysql-test/t/partition_symlink.test index ab779ec2b68..4c6acec64eb 100644 --- a/mysql-test/t/partition_symlink.test +++ b/mysql-test/t/partition_symlink.test @@ -24,6 +24,10 @@ DROP DATABASE IF EXISTS mysqltest2; # files, but not the other way around (any db-user can use any # directory or file that the mysqld-process can use, via DATA/INDEX DIR) # this is the security flaw that was used in bug#32091 and bug#32111 + +#--exec mkdir $MYSQLTEST_VARDIR/tmp/test || true +#--exec mkdir $MYSQLTEST_VARDIR/tmp/mysqltest2 || true + -- echo # Creating two non colliding tables mysqltest2.t1 and test.t1 -- echo # test.t1 have partitions in mysqltest2-directory! -- echo # user root: @@ -39,11 +43,11 @@ connect(con1,localhost,mysqltest_1,,); eval CREATE TABLE t1 (a INT) PARTITION BY LIST (a) ( PARTITION p0 VALUES IN (0) - DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2' - INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2', + DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp' + INDEX DIRECTORY '$MYSQLTEST_VARDIR/tmp', PARTITION p1 VALUES IN (1) - DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/test' - INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/test', + DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp' + INDEX DIRECTORY '$MYSQLTEST_VARDIR/tmp', PARTITION p2 VALUES IN (2) ); -- echo # without the patch for bug#32091 this would create @@ -74,17 +78,18 @@ connection default; # So it is using/blocking 2 files in (in 2 different directories -- echo # test that symlinks can not overwrite files when CREATE TABLE -- echo # user root: + CREATE DATABASE mysqltest2; USE mysqltest2; -- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval CREATE TABLE t1 (a INT) PARTITION BY LIST (a) ( PARTITION p0 VALUES IN (0) - DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2' - INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2', + DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp' + INDEX DIRECTORY '$MYSQLTEST_VARDIR/tmp', PARTITION p1 VALUES IN (1) - DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/test' - INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/test' + DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp' + INDEX DIRECTORY '$MYSQLTEST_VARDIR/tmp' ); connection con1; -- echo # user mysqltest_1: @@ -94,22 +99,22 @@ connection con1; eval CREATE TABLE t1 (a INT) PARTITION BY LIST (a) ( PARTITION p0 VALUES IN (0) - DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2' - INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2', + DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp' + INDEX DIRECTORY '$MYSQLTEST_VARDIR/tmp', PARTITION p1 VALUES IN (1) - DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/test' - INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/test' + DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp' + INDEX DIRECTORY '$MYSQLTEST_VARDIR/tmp' ); -- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -- error 1,1 eval CREATE TABLE t1 (a INT) PARTITION BY LIST (a) ( PARTITION p0 VALUES IN (0) - DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/test' - INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/test', + DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp' + INDEX DIRECTORY '$MYSQLTEST_VARDIR/tmp', PARTITION p1 VALUES IN (1) - DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2' - INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2' + DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp' + INDEX DIRECTORY '$MYSQLTEST_VARDIR/tmp' ); connection default; -- echo # user root (cleanup): @@ -118,4 +123,5 @@ connection default; DROP USER mysqltest_1@localhost; disconnect con1; - +#--exec rmdir $MYSQLTEST_VARDIR/tmp/test || true +#--exec rmdir $MYSQLTEST_VARDIR/tmp/mysqltest2 || true diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test index f339b29c83a..1b75fa6b1ab 100644 --- a/mysql-test/t/symlink.test +++ b/mysql-test/t/symlink.test @@ -123,29 +123,22 @@ drop table t1; # # BUG#32111 - Security Breach via DATA/INDEX DIRECORY and RENAME TABLE # +--write_file $MYSQLTEST_VARDIR/tmp/t1.MYI +EOF --replace_result $MYSQLTEST_VARDIR TEST_DIR +--error 1 eval CREATE TABLE t1(a INT) -DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/mysql' -INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data/mysql'; +DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp' +INDEX DIRECTORY='$MYSQLTEST_VARDIR/tmp'; +--replace_result $MYSQLTEST_VARDIR TEST_DIR +eval CREATE TABLE t2(a INT) +DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp' +INDEX DIRECTORY='$MYSQLTEST_VARDIR/tmp'; --replace_result $MYSQLTEST_VARDIR TEST_DIR --error 1 -RENAME TABLE t1 TO user; -DROP TABLE t1; - -# -# Test specifying DATA DIRECTORY that is the same as what would normally -# have been chosen. (Bug #8707) -# -disable_query_log; -eval create table t1 (i int) data directory = "$MYSQLTEST_VARDIR/master-data/test/"; -enable_query_log; -show create table t1; -drop table t1; -disable_query_log; -eval create table t1 (i int) index directory = "$MYSQLTEST_VARDIR/master-data/test/"; -enable_query_log; -show create table t1; -drop table t1; +RENAME TABLE t2 TO t1; +DROP TABLE t2; +--remove_file $MYSQLTEST_VARDIR/tmp/t1.MYI # # Bug#8706 - temporary table with data directory option fails @@ -189,40 +182,41 @@ drop table t1; # # Bug #29325: create table overwrites .MYD file of other table (datadir) # - -CREATE DATABASE db1; -CREATE DATABASE db2; - -USE db2; ---disable_query_log -eval CREATE TABLE t1 (b INT) ENGINE MYISAM -DATA DIRECTORY = '$MYSQLTEST_VARDIR/master-data/db1/'; ---enable_query_log - -INSERT INTO db2.t1 VALUES (1); -SELECT * FROM db2.t1; -RESET QUERY CACHE; - -USE db1; - -#no warning from create table SET SESSION keep_files_on_create = TRUE; +--write_file $MYSQLTEST_VARDIR/master-data/test/t1.MYD +EOF --disable_abort_on_error ---error 1,1 +--error 1 CREATE TABLE t1 (a INT) ENGINE MYISAM; +--error 0,1 +--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYD; --enable_abort_on_error - -CREATE TABLE t3 (a INT) Engine=MyISAM; -INSERT INTO t3 VALUES (1),(2),(3); -TRUNCATE TABLE t3; -SELECT * from t3; - -SET SESSION keep_files_on_create = DEFAULT; - -DROP TABLE db2.t1, db1.t3; -DROP DATABASE db1; -DROP DATABASE db2; -USE test; - +SET SESSION keep_files_on_create = FALSE; +CREATE TABLE t1 (a INT) ENGINE MYISAM; +DROP TABLE t1; --echo End of 5.0 tests + +# +# Bug#32167: another privilege bypass with DATA/INDEX DIRECTORY +# +--replace_result $MYSQLTEST_VARDIR TEST_DIR +--error 1210 +eval CREATE TABLE t1(a INT) +INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data/mysql'; +--replace_result $MYSQLTEST_VARDIR TEST_DIR +--error 1210 +eval CREATE TABLE t1(a INT) +DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/test'; +--replace_result $MYSQLTEST_VARDIR TEST_DIR +eval CREATE TABLE t1(a INT) +DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/'; +DROP TABLE t1; +--replace_result $MYSQLTEST_VARDIR TEST_DIR +eval CREATE TABLE t1(a INT) +INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data'; +DROP TABLE t1; +--replace_result $MYSQLTEST_VARDIR TEST_DIR +--error 1 +eval CREATE TABLE t1(a INT) +INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data_var'; -- cgit v1.2.1 From a0eec8abbb233d9e3f278d343eaed2e70b55161e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Feb 2008 14:23:22 +0100 Subject: Bug#34749: Server crash when using NAME_CONST() with an aggregate function NAME_CONST('whatever', -1) * MAX(whatever) bombed since -1 was not seen as constant, but as FUNCTION_UNARY_MINUS(constant) while we are at the same time pretending it was a basic const item. This confused the aggregate handlers in exciting ways. We now make NAME_CONST() behave more consistently. mysql-test/r/func_misc.result: show that a combination of NAME_CONST('x', -y) and an aggregate no longer crashes the server. mysql-test/t/func_misc.test: show that a combination of NAME_CONST('x', -y) and an aggregate no longer crashes the server. sql/ha_ndbcluster_cond.cc: tell cluster about "new" function type NEG_FUNC. (this was previous identified as UNKNOWN_FUNC, so we just handle it the same way, that's all.) sql/ha_ndbcluster_cond.h: tell cluster about "new" function type NEG_FUNC. (this was previous identified as UNKNOWN_FUNC, so we just handle it the same way, that's all.) sql/item.cc: make NAME_CONST() transparent in that type() of -constant is that of constant, not that of unary minus (id est, FUNC_ITEM). sql/item.h: Move constructor to item.cc sql/item_func.h: Revert Bug#30832; we can apply the magic more narrowly (just for NAME_CONST() rather than all Item_func_neg). Introduce new function type "NEG_FUNC." --- mysql-test/t/func_misc.test | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test index ccb59df5677..17c147f7193 100644 --- a/mysql-test/t/func_misc.test +++ b/mysql-test/t/func_misc.test @@ -204,6 +204,24 @@ SELECT NAME_CONST('test', 1.0); SELECT NAME_CONST('test', -1.0); SELECT NAME_CONST('test', 'test'); +# +# Bug #34749: Server crash when using NAME_CONST() with an aggregate function +# + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2),(3); +# NAME_CONST() + aggregate. +SELECT NAME_CONST('flag',1) * MAX(a) FROM t1; +SELECT NAME_CONST('flag',1.5) * MAX(a) FROM t1; +# Now, wrap the INT_ITEM in Item_func_neg and watch the pretty explosions +SELECT NAME_CONST('flag',-1) * MAX(a) FROM t1; +SELECT NAME_CONST('flag',-1.5) * MAX(a) FROM t1; +--error ER_WRONG_ARGUMENTS +SELECT NAME_CONST('flag', SQRT(4)) * MAX(a) FROM t1; +--error ER_WRONG_ARGUMENTS +SELECT NAME_CONST('flag',-SQRT(4)) * MAX(a) FROM t1; +DROP TABLE t1; + # # Bug #27545: erroneous usage of NAME_CONST with a name as the first parameter # resolved against a column name of a derived table hangs the client -- cgit v1.2.1 From d40ca16156641481abd45f93e31233044f4b9df6 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Feb 2008 22:53:31 +0400 Subject: Fixed bug #34620: item_row.cc:50: Item_row::illegal_method_call(const char*): Assertion `0' failed If ROW item is a part of an expression that also has aggregate function calls (COUNT/SUM/AVG...), a "splitting" with an Item::split_sum_func2 function is applied to that ROW item. Current implementation of Item::split_sum_func2 replaces this Item_row with a newly created Item_aggregate_ref reference to it. Then the row cache tries to work with the Item_aggregate_ref object as with the Item_row object: row cache calls row-emulation methods such as cols and element_index. Item_aggregate_ref (like it's parent Item_ref) inherits dummy implementations of those methods from the hierarchy root Item, and call to them leads to failed assertions and wrong data output. Row-emulation virtual functions (cols, element_index, addr, check_cols, null_inside and bring_value) of Item_ref have been overloaded to forward calls to an underlying item reference. mysql-test/r/row.result: Added test case for bug #34620. mysql-test/t/row.test: Added test case for bug #34620. sql/item.h: Fixed bug #34620. Row-emulation virtual functions (cols, element_index, addr, check_cols, null_inside and bring_value) of Item_ref have been overloaded to forward calls to an underlying item reference. --- mysql-test/t/row.test | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/row.test b/mysql-test/t/row.test index 20d044306a6..1601f7afd0e 100644 --- a/mysql-test/t/row.test +++ b/mysql-test/t/row.test @@ -224,3 +224,16 @@ SET @x:= (SELECT h FROM t1 WHERE (a,b,c,d,e,f,g)=(1,2,3,4,5,6,7)); SELECT @x; DROP TABLE t1; + +# +# Bug #34620: item_row.cc:50: Item_row::illegal_method_call(const char*): +# Assertion `0' failed +# + +CREATE TABLE t1 (a INT, b INT); +INSERT INTO t1 VALUES (1,1); + +SELECT ROW(a, 1) IN (SELECT SUM(b), 1) FROM t1 GROUP BY a; +SELECT ROW(a, 1) IN (SELECT SUM(b), 3) FROM t1 GROUP BY a; + +DROP TABLE t1; -- cgit v1.2.1 From ab6042590186ad14bbd73a64f5d1f3f77223bdb3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Feb 2008 13:55:00 +0400 Subject: Bug#32167 another privilege bypass with DATA/INDEX DIRECORY(ver 4.1,5.0) added new function test_if_data_home_dir() which checks that path does not contain mysql data home directory. Using of mysql data home directory in DATA DIRECTORY & INDEX DIRECTORY is disallowed. mysql-test/r/symlink.result: test result mysql-test/t/symlink.test: test case sql/mysql_priv.h: new variable mysql_unpacked_real_data_home sql/mysqld.cc: new variable mysql_unpacked_real_data_home sql/sql_parse.cc: added new function test_if_data_home_dir() which checks that path does not contain mysql data home directory. Using of mysql data home directory in DATA DIRECTORY & INDEX DIRECTORY is disallowed. --- mysql-test/t/symlink.test | 48 ++++++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 19 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test index 40127a697ac..7dfccaad8dc 100644 --- a/mysql-test/t/symlink.test +++ b/mysql-test/t/symlink.test @@ -121,29 +121,22 @@ drop table t1; # # BUG#32111 - Security Breach via DATA/INDEX DIRECORY and RENAME TABLE # +--write_file $MYSQLTEST_VARDIR/tmp/t1.MYI +EOF --replace_result $MYSQLTEST_VARDIR TEST_DIR +--error 1 eval CREATE TABLE t1(a INT) -DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/mysql' -INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data/mysql'; +DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp' +INDEX DIRECTORY='$MYSQLTEST_VARDIR/tmp'; +--replace_result $MYSQLTEST_VARDIR TEST_DIR +eval CREATE TABLE t2(a INT) +DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp' +INDEX DIRECTORY='$MYSQLTEST_VARDIR/tmp'; --replace_result $MYSQLTEST_VARDIR TEST_DIR --error 1 -RENAME TABLE t1 TO user; -DROP TABLE t1; - -# -# Test specifying DATA DIRECTORY that is the same as what would normally -# have been chosen. (Bug #8707) -# -disable_query_log; -eval create table t1 (i int) data directory = "$MYSQL_TEST_DIR/var/master-data/test/"; -enable_query_log; -show create table t1; -drop table t1; -disable_query_log; -eval create table t1 (i int) index directory = "$MYSQL_TEST_DIR/var/master-data/test/"; -enable_query_log; -show create table t1; -drop table t1; +RENAME TABLE t2 TO t1; +DROP TABLE t2; +--remove_file $MYSQLTEST_VARDIR/tmp/t1.MYI # # Bug#8706 - temporary table with data directory option fails @@ -201,4 +194,21 @@ show create table t1; drop table t1; deallocate prepare stmt; +# +# Bug#32167 another privilege bypass with DATA/INDEX DIRECORY +# +--replace_result $MYSQL_TEST_DIR TEST_DIR +--error 1210 +eval CREATE TABLE t1(a INT) +DATA DIRECTORY='$MYSQL_TEST_DIR/var/master-data/test'; +--error 1210 +eval CREATE TABLE t1(a INT) +DATA DIRECTORY='$MYSQL_TEST_DIR/var/master-data/'; +--error 1210 +eval CREATE TABLE t1(a INT) +INDEX DIRECTORY='$MYSQL_TEST_DIR/var/master-data'; +--error 1 +eval CREATE TABLE t1(a INT) +INDEX DIRECTORY='$MYSQL_TEST_DIR/var/master-data_var'; + --echo End of 4.1 tests -- cgit v1.2.1 From fa9e35b48d1322b80cf3a8f6ffd4b2fde7f46c0c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Feb 2008 15:04:00 +0400 Subject: after merge fix --- mysql-test/t/symlink.test | 38 ++++++++------------------------------ 1 file changed, 8 insertions(+), 30 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test index f4a10bc58d8..ffe5cc76737 100644 --- a/mysql-test/t/symlink.test +++ b/mysql-test/t/symlink.test @@ -222,39 +222,17 @@ INDEX DIRECTORY='$MYSQL_TEST_DIR/var/master-data_var'; # # Bug #29325: create table overwrites .MYD file of other table (datadir) # - -CREATE DATABASE db1; -CREATE DATABASE db2; - -USE db2; ---disable_query_log -eval CREATE TABLE t1 (b INT) ENGINE MYISAM -DATA DIRECTORY = '$MYSQLTEST_VARDIR/master-data/db1/'; ---enable_query_log - -INSERT INTO db2.t1 VALUES (1); -SELECT * FROM db2.t1; -RESET QUERY CACHE; - -USE db1; - -#no warning from create table SET SESSION keep_files_on_create = TRUE; +--write_file $MYSQLTEST_VARDIR/master-data/test/t1.MYD +EOF --disable_abort_on_error +--error 1 CREATE TABLE t1 (a INT) ENGINE MYISAM; +--error 0,1 +--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYD; --enable_abort_on_error - -CREATE TABLE t3 (a INT) Engine=MyISAM; -INSERT INTO t3 VALUES (1),(2),(3); -TRUNCATE TABLE t3; -SELECT * from t3; - -SET SESSION keep_files_on_create = DEFAULT; - -DROP TABLE db2.t1, db1.t3; -DROP DATABASE db1; -DROP DATABASE db2; -USE test; - +SET SESSION keep_files_on_create = FALSE; +CREATE TABLE t1 (a INT) ENGINE MYISAM; +DROP TABLE t1; --echo End of 5.0 tests -- cgit v1.2.1 From be59a0ea7f6f7a4fc08e1da5888fecde28289194 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Feb 2008 16:56:41 +0400 Subject: test fix mysql-test/r/symlink.result: result fix --- mysql-test/t/symlink.test | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test index 7dfccaad8dc..c8790c450f9 100644 --- a/mysql-test/t/symlink.test +++ b/mysql-test/t/symlink.test @@ -201,12 +201,15 @@ deallocate prepare stmt; --error 1210 eval CREATE TABLE t1(a INT) DATA DIRECTORY='$MYSQL_TEST_DIR/var/master-data/test'; +--replace_result $MYSQL_TEST_DIR TEST_DIR --error 1210 eval CREATE TABLE t1(a INT) DATA DIRECTORY='$MYSQL_TEST_DIR/var/master-data/'; +--replace_result $MYSQL_TEST_DIR TEST_DIR --error 1210 eval CREATE TABLE t1(a INT) INDEX DIRECTORY='$MYSQL_TEST_DIR/var/master-data'; +--replace_result $MYSQL_TEST_DIR TEST_DIR --error 1 eval CREATE TABLE t1(a INT) INDEX DIRECTORY='$MYSQL_TEST_DIR/var/master-data_var'; -- cgit v1.2.1 From 1ed34fed3390e10ff67981c4470f46c6ce1e2a6e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Feb 2008 17:56:50 +0400 Subject: Bug#23924 general_log truncates queries with character set introducers. Problem: logging of utf8-incompatible binary strings didn't work Fix: hex-encoding of incompatible sequences. mysql-test/r/log_tables.result: Adding test mysql-test/t/log_tables.test: Adding test sql/field.cc: Copying with hex escaping sql/field.h: New field flag sql/log.cc: Marking the column "general_log.argument" as hex-escaping field. sql/sql_string.cc: New function to copy strings with hex-encoding of incompatible characters. sql/sql_string.h: Prototype for the new function --- mysql-test/t/log_tables.test | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/log_tables.test b/mysql-test/t/log_tables.test index 0c986c6d63a..3047d16d3b6 100644 --- a/mysql-test/t/log_tables.test +++ b/mysql-test/t/log_tables.test @@ -130,6 +130,16 @@ show open tables; SET GLOBAL GENERAL_LOG=ON; SET GLOBAL SLOW_QUERY_LOG=ON; +# +# Bug#23924 general_log truncates queries with character set introducers. +# +truncate table mysql.general_log; +set names binary; +select _koi8r'ÔÅÓÔ' as test; +--replace_column 1 TIMESTAMP 2 USER_HOST 3 THREAD_ID +select * from mysql.general_log; +set names utf8; + # # Bug #16905 Log tables: unicode statements are logged incorrectly # -- cgit v1.2.1 From f39817ce47c650a365358ba76d0e4212cb318905 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Feb 2008 17:58:35 +0400 Subject: fixed problem with embedded server mysql-test/r/symlink.result: test result fix --- mysql-test/t/symlink.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test index 1b75fa6b1ab..69535b7d9d1 100644 --- a/mysql-test/t/symlink.test +++ b/mysql-test/t/symlink.test @@ -186,7 +186,7 @@ SET SESSION keep_files_on_create = TRUE; --write_file $MYSQLTEST_VARDIR/master-data/test/t1.MYD EOF --disable_abort_on_error ---error 1 +--error 1,1,ER_TABLE_EXISTS_ERROR CREATE TABLE t1 (a INT) ENGINE MYISAM; --error 0,1 --remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYD; -- cgit v1.2.1 From f7458e075de1572d18c2e6006e65ac2fd217a634 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Mar 2008 12:16:43 +0400 Subject: Bug #32801 wait_timeout.test fails randomly wait_timeout test enabled mysql-test/t/disabled.def: Bug #32801 wait_timeout.test fails randomly wait_timeout enabled --- mysql-test/t/disabled.def | 1 - 1 file changed, 1 deletion(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 2cbfb3cf658..9daaa7a5e03 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -19,7 +19,6 @@ events : Bug#32664 events.test fails randomly lowercase_table3 : Bug#32667 lowercase_table3.test reports to error log kill : Bug#29149: Test "kill" fails on Windows innodb_mysql : Bug#32724: innodb_mysql.test fails randomly -wait_timeout : Bug#32801 wait_timeout.test fails randomly ctype_create : Bug#32965 main.ctype_create fails status : Bug#32966 main.status fails ps_ddl : Bug#12093 2007-12-14 pending WL#4165 / WL#4166 -- cgit v1.2.1 From 2cb35cd680d70f3e1e26b5672f2125d6fdff4921 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Mar 2008 15:02:34 +0400 Subject: test case fix --- mysql-test/t/symlink.test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test index 8878f9fc461..10d8f355c98 100644 --- a/mysql-test/t/symlink.test +++ b/mysql-test/t/symlink.test @@ -204,19 +204,19 @@ deallocate prepare stmt; # Bug#32167 another privilege bypass with DATA/INDEX DIRECORY # --replace_result $MYSQL_TEST_DIR TEST_DIR ---error 1210 +--error 1,1210 eval CREATE TABLE t1(a INT) DATA DIRECTORY='$MYSQL_TEST_DIR/var/master-data/test'; --replace_result $MYSQL_TEST_DIR TEST_DIR ---error 1210 +--error 1,1210 eval CREATE TABLE t1(a INT) DATA DIRECTORY='$MYSQL_TEST_DIR/var/master-data/'; --replace_result $MYSQL_TEST_DIR TEST_DIR ---error 1210 +--error 1,1210 eval CREATE TABLE t1(a INT) INDEX DIRECTORY='$MYSQL_TEST_DIR/var/master-data'; --replace_result $MYSQL_TEST_DIR TEST_DIR ---error 1 +--error 1,1210 eval CREATE TABLE t1(a INT) INDEX DIRECTORY='$MYSQL_TEST_DIR/var/master-data_var'; -- cgit v1.2.1 From 8a176c559bbcded042f79da89878d9824b8286c5 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Mar 2008 15:38:18 +0400 Subject: test case fix mysql-test/r/partition.result: the test is moved to 'partition_not_windows' test mysql-test/r/partition_not_windows.result: the test is moved from 'partition' test mysql-test/t/partition.test: the test is moved to 'partition_not_windows' test mysql-test/t/partition_not_windows.test: the test is moved from 'partition' test --- mysql-test/t/partition.test | 29 ----------------------------- mysql-test/t/partition_not_windows.test | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 29 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index d889fe83dc1..e7e4111e261 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -1398,35 +1398,6 @@ SELECT t2.id FROM t2 WHERE t2.id IN (SELECT id FROM t1 WHERE status = 'Verified' drop table t1, t2; -# -# Bug #24633 SQL MODE "NO_DIR_IN_CREATE" does not work with partitioned tables -# - -disable_query_log; -eval create table t2 (i int ) -partition by range (i) -( - partition p01 values less than (1000) - data directory="$MYSQLTEST_VARDIR/tmp/" - index directory="$MYSQLTEST_VARDIR/tmp/" -); -enable_query_log; - -set @org_mode=@@sql_mode; -set @@sql_mode='NO_DIR_IN_CREATE'; -select @@sql_mode; -create table t1 (i int ) -partition by range (i) -( - partition p01 values less than (1000) - data directory='/not/existing' - index directory='/not/existing' -); - -show create table t2; -DROP TABLE t1, t2; -set @@sql_mode=@org_mode; - # # Bug #27123 partition + on duplicate key update + varchar = Can't find record in
# diff --git a/mysql-test/t/partition_not_windows.test b/mysql-test/t/partition_not_windows.test index c5f54286095..836d5ab10e6 100644 --- a/mysql-test/t/partition_not_windows.test +++ b/mysql-test/t/partition_not_windows.test @@ -67,6 +67,33 @@ eval ALTER TABLE t1 REORGANIZE PARTITION p0 INTO drop table t1; +# +# Bug #24633 SQL MODE "NO_DIR_IN_CREATE" does not work with partitioned tables +# +disable_query_log; +eval create table t2 (i int ) +partition by range (i) +( + partition p01 values less than (1000) + data directory="$MYSQLTEST_VARDIR/tmp/" + index directory="$MYSQLTEST_VARDIR/tmp/" +); +enable_query_log; + +set @org_mode=@@sql_mode; +set @@sql_mode='NO_DIR_IN_CREATE'; +select @@sql_mode; +create table t1 (i int ) +partition by range (i) +( + partition p01 values less than (1000) + data directory='/not/existing' + index directory='/not/existing' +); +show create table t2; +DROP TABLE t1, t2; +set @@sql_mode=@org_mode; + # End Windows specific test failures. # These tests contain non-Windows specific directory/file format. -- cgit v1.2.1 From 28dc3ac696bd69a08ba4e5591668c3b270710b58 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Mar 2008 20:29:58 +0400 Subject: fixed test case problem on win mysql-test/r/partition.result: the test is moved to 'partition_not_windows' test case mysql-test/r/partition_not_windows.result: the test is moved from 'partition' test case mysql-test/t/partition.test: the test is moved to 'partition_not_windows' test case mysql-test/t/partition_not_windows.test: the test is moved from 'partition' test case --- mysql-test/t/partition.test | 38 --------------------------------- mysql-test/t/partition_not_windows.test | 38 +++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 38 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index e7e4111e261..c35626e06b7 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -1545,44 +1545,6 @@ ALTER TABLE t1 OPTIMIZE PARTITION p1 EXTENDED; ALTER TABLE t1 ANALYZE PARTITION p1 EXTENDED; DROP TABLE t1; -# -# Bug#32167: another privilege bypass with DATA/INDEX DIRECTORY -# ---replace_result $MYSQLTEST_VARDIR TEST_DIR ---error 1210 -eval CREATE TABLE t1(a INT) -PARTITION BY KEY (a) -(PARTITION p0 DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'); ---replace_result $MYSQLTEST_VARDIR TEST_DIR ---error 1210 -eval CREATE TABLE t1(a INT) -PARTITION BY KEY (a) -(PARTITION p0 INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'); - ---replace_result $MYSQLTEST_VARDIR TEST_DIR ---error 1210 -eval CREATE TABLE ts (id INT, purchased DATE) -PARTITION BY RANGE(YEAR(purchased)) -SUBPARTITION BY HASH(TO_DAYS(purchased)) ( -PARTITION p0 VALUES LESS THAN (1990) ( -SUBPARTITION s0a - DATA DIRECTORY = '$MYSQLTEST_VARDIR/master-data/test', -SUBPARTITION s0b - DATA DIRECTORY = '$MYSQLTEST_VARDIR/master-data/test' -)); - ---replace_result $MYSQLTEST_VARDIR TEST_DIR ---error 1210 -eval CREATE TABLE ts (id INT, purchased DATE) -PARTITION BY RANGE(YEAR(purchased)) -SUBPARTITION BY HASH(TO_DAYS(purchased)) ( -PARTITION p0 VALUES LESS THAN (1990) ( -SUBPARTITION s0a - INDEX DIRECTORY = '$MYSQLTEST_VARDIR/master-data/test', -SUBPARTITION s0b - INDEX DIRECTORY = '$MYSQLTEST_VARDIR/master-data/test' -)); - # # Bug #29258: Partitions: search fails for maximum unsigned bigint # diff --git a/mysql-test/t/partition_not_windows.test b/mysql-test/t/partition_not_windows.test index 836d5ab10e6..103fb05029e 100644 --- a/mysql-test/t/partition_not_windows.test +++ b/mysql-test/t/partition_not_windows.test @@ -94,6 +94,44 @@ show create table t2; DROP TABLE t1, t2; set @@sql_mode=@org_mode; +# +# Bug#32167: another privilege bypass with DATA/INDEX DIRECTORY +# +--replace_result $MYSQLTEST_VARDIR TEST_DIR +--error 1210 +eval CREATE TABLE t1(a INT) +PARTITION BY KEY (a) +(PARTITION p0 DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'); +--replace_result $MYSQLTEST_VARDIR TEST_DIR +--error 1210 +eval CREATE TABLE t1(a INT) +PARTITION BY KEY (a) +(PARTITION p0 INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'); + +--replace_result $MYSQLTEST_VARDIR TEST_DIR +--error 1210 +eval CREATE TABLE ts (id INT, purchased DATE) +PARTITION BY RANGE(YEAR(purchased)) +SUBPARTITION BY HASH(TO_DAYS(purchased)) ( +PARTITION p0 VALUES LESS THAN (1990) ( +SUBPARTITION s0a + DATA DIRECTORY = '$MYSQLTEST_VARDIR/master-data/test', +SUBPARTITION s0b + DATA DIRECTORY = '$MYSQLTEST_VARDIR/master-data/test' +)); + +--replace_result $MYSQLTEST_VARDIR TEST_DIR +--error 1210 +eval CREATE TABLE ts (id INT, purchased DATE) +PARTITION BY RANGE(YEAR(purchased)) +SUBPARTITION BY HASH(TO_DAYS(purchased)) ( +PARTITION p0 VALUES LESS THAN (1990) ( +SUBPARTITION s0a + INDEX DIRECTORY = '$MYSQLTEST_VARDIR/master-data/test', +SUBPARTITION s0b + INDEX DIRECTORY = '$MYSQLTEST_VARDIR/master-data/test' +)); + # End Windows specific test failures. # These tests contain non-Windows specific directory/file format. -- cgit v1.2.1 From cd9f2d1c285d1bc5f5115e517da806ccb2bd1d28 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Mar 2008 20:35:44 +0300 Subject: BUG#34945: "ref_or_null queries that are null_rejecting and have a null value crash mysql" - Apply Eric Bergen's patch: in join_read_always_key(), move ha_index_init() call to before the late NULLs filtering code. - Backport function comments from 6.0. mysql-test/r/null_key.result: BUG#34945: "ref_or_null queries that are null_rejecting and have a null value crash mysql" - Testcase mysql-test/t/null_key.test: BUG#34945: "ref_or_null queries that are null_rejecting and have a null value crash mysql" - Testcase sql/sql_select.cc: BUG#34945: "ref_or_null queries that are null_rejecting and have a null value crash mysql" - Apply Eric Bergen's patch: in join_read_always_key(), move ha_index_init() call to before the late NULLs filtering code. - Backport function comments from 6.0 --- mysql-test/t/null_key.test | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/null_key.test b/mysql-test/t/null_key.test index e15aec01d2a..1400c643203 100644 --- a/mysql-test/t/null_key.test +++ b/mysql-test/t/null_key.test @@ -240,3 +240,26 @@ SHOW STATUS LIKE "handler_read%"; DROP TABLE t1,t2,t3,t4; # End of 4.1 tests + +# +# BUG#34945 "ref_or_null queries that are null_rejecting and have a null value crash mysql" +# +CREATE TABLE t1 ( + a int(11) default NULL, + b int(11) default NULL, + KEY a (a,b) +); +INSERT INTO t1 VALUES (0,10),(0,11),(0,12); + +CREATE TABLE t2 ( + a int(11) default NULL, + b int(11) default NULL, + KEY a (a) +); +INSERT INTO t2 VALUES (3,NULL),(3,11),(3,12); + +SELECT * FROM t2 inner join t1 WHERE ( t1.a = 0 OR t1.a IS NULL) AND t2.a = 3 AND t2.b = t1.b; + +drop table t1, t2; +-- echo End of 5.0 tests + -- cgit v1.2.1 From 0fa2ee981be78dd30073313a9fbeb48edce6e96b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Mar 2008 10:17:49 -0300 Subject: Bug#35009 Results of mysql_client_test are discarded upon failure It's impossible to determine which test inside mysql_client_test failed if the log file is overwritten by mysqltest when dumping the test case results. Redirect mysql_client_test output to a separate file. mysql-test/t/mysql_client_test.test: Redirect mysql_client_test output to a separate log file so it doesn't get overwritten by mysqltest. --- mysql-test/t/mysql_client_test.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test index 66a27abd61a..b46a127785a 100644 --- a/mysql-test/t/mysql_client_test.test +++ b/mysql-test/t/mysql_client_test.test @@ -8,8 +8,8 @@ # server or run mysql-test-run --debug mysql_client_test and check # var/log/mysql_client_test.trace ---exec echo "$MYSQL_CLIENT_TEST" > $MYSQLTEST_VARDIR/log/mysql_client_test.log 2>&1 ---exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.log 2>&1 +--exec echo "$MYSQL_CLIENT_TEST" > $MYSQLTEST_VARDIR/log/mysql_client_test.out 2>&1 +--exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.out 2>&1 # End of 4.1 tests echo ok; -- cgit v1.2.1 From 0769fe559036512506736768fb31ddb0482ac2e6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Mar 2008 10:32:30 -0300 Subject: Use the same name for mysql_client_test output file in all branches. mysql-test/t/mysql_client_test.test: Rename mysql_client_test output file to mysql_client_test.out.log --- mysql-test/t/mysql_client_test.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test index b46a127785a..7667522feaf 100644 --- a/mysql-test/t/mysql_client_test.test +++ b/mysql-test/t/mysql_client_test.test @@ -8,8 +8,8 @@ # server or run mysql-test-run --debug mysql_client_test and check # var/log/mysql_client_test.trace ---exec echo "$MYSQL_CLIENT_TEST" > $MYSQLTEST_VARDIR/log/mysql_client_test.out 2>&1 ---exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.out 2>&1 +--exec echo "$MYSQL_CLIENT_TEST" > $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 +--exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 # End of 4.1 tests echo ok; -- cgit v1.2.1 From 2b7dda9e9d06f2ab6036da39250a765926c9c437 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Mar 2008 09:33:32 -0500 Subject: Bug#33464: DROP FUNCTION caused a crash The cause of the crash is an assertion failure that we do not emit an error message (grant not found) and then return "ok". The assertion is valid, and we were ignoring the buggy behavior prior to the "Diagnostics" result-verification. Use an error handler to mutate innocuous missing-grant errors, when removing routines, into warnings. mysql-test/r/drop.result: Show that the crash disappears. Also prepare for the larger bug to be fixed with only minor changes to this test. mysql-test/t/drop.test: Show that the crash disappears. Also prepare for the larger bug to be fixed with only minor changes to this test. sql/sql_acl.cc: Disable a segment of code that makes a faulty assumption about the existence of a routine's defining user, until that assumption becomes true. Push a new handler onto the error-handler stack, so that when removing a routine, a missing ACL grant is now a warning instead of an error. If any unexpected error is raised then tell the caller. --- mysql-test/t/drop.test | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/drop.test b/mysql-test/t/drop.test index a79044436eb..3dd180f2d78 100644 --- a/mysql-test/t/drop.test +++ b/mysql-test/t/drop.test @@ -134,4 +134,66 @@ drop table mysql_test.`#sql-347f_8`; copy_file $MYSQLTEST_VARDIR/master-data/mysql_test/t1.frm $MYSQLTEST_VARDIR/master-data/mysql_test/#sql-347f_6.frm; drop database mysql_test; + +# +# Bug#33464: DROP FUNCTION caused a crash. +# +CREATE DATABASE dbbug33464; +CREATE USER 'userbug33464'@'localhost'; + +GRANT CREATE ROUTINE ON dbbug33464.* TO 'userbug33464'@'localhost'; + +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (connbug33464, localhost, userbug33464, , dbbug33464); +--source suite/funcs_1/include/show_connection.inc + +--disable_warnings +DROP PROCEDURE IF EXISTS sp3; +DROP FUNCTION IF EXISTS fn1; +--enable_warnings + +delimiter //; +CREATE PROCEDURE sp3(v1 char(20)) +BEGIN + SELECT * from dbbug33464.t6 where t6.f2= 'xyz'; +END// +delimiter ;// + +delimiter //; +CREATE FUNCTION fn1() returns char(50) SQL SECURITY INVOKER +BEGIN + return 1; +END// +delimiter ;// + +delimiter //; +CREATE FUNCTION fn2() returns char(50) SQL SECURITY DEFINER +BEGIN + return 2; +END// +delimiter ;// + +disconnect connbug33464; + +# cleanup +connection default; +USE dbbug33464; +--source suite/funcs_1/include/show_connection.inc + +SELECT fn1(); +SELECT fn2(); + +--error 0, ER_CANNOT_USER +DROP USER 'userbug33464'@'localhost'; + +DROP FUNCTION fn1; +DROP FUNCTION fn2; +DROP PROCEDURE sp3; + +--error 0, ER_CANNOT_USER +DROP USER 'userbug33464'@'localhost'; + +use test; +DROP DATABASE dbbug33464; + --echo End of 5.1 tests -- cgit v1.2.1 From 2eb67908704727d276cae0d63e5d116511a5fc7d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Mar 2008 14:18:35 -0500 Subject: Move test that has more to do with grants than DROP. We shouldn't have grant warnings on embedded server. mysql-test/r/drop.result: Move test that has more to do with grants than DROP. mysql-test/r/grant.result: Move test that has more to do with grants than DROP. mysql-test/t/drop.test: Move test that has more to do with grants than DROP. mysql-test/t/grant.test: Move test that has more to do with grants than DROP. --- mysql-test/t/drop.test | 62 ------------------------------------------------- mysql-test/t/grant.test | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 62 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/drop.test b/mysql-test/t/drop.test index 3dd180f2d78..a79044436eb 100644 --- a/mysql-test/t/drop.test +++ b/mysql-test/t/drop.test @@ -134,66 +134,4 @@ drop table mysql_test.`#sql-347f_8`; copy_file $MYSQLTEST_VARDIR/master-data/mysql_test/t1.frm $MYSQLTEST_VARDIR/master-data/mysql_test/#sql-347f_6.frm; drop database mysql_test; - -# -# Bug#33464: DROP FUNCTION caused a crash. -# -CREATE DATABASE dbbug33464; -CREATE USER 'userbug33464'@'localhost'; - -GRANT CREATE ROUTINE ON dbbug33464.* TO 'userbug33464'@'localhost'; - ---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK -connect (connbug33464, localhost, userbug33464, , dbbug33464); ---source suite/funcs_1/include/show_connection.inc - ---disable_warnings -DROP PROCEDURE IF EXISTS sp3; -DROP FUNCTION IF EXISTS fn1; ---enable_warnings - -delimiter //; -CREATE PROCEDURE sp3(v1 char(20)) -BEGIN - SELECT * from dbbug33464.t6 where t6.f2= 'xyz'; -END// -delimiter ;// - -delimiter //; -CREATE FUNCTION fn1() returns char(50) SQL SECURITY INVOKER -BEGIN - return 1; -END// -delimiter ;// - -delimiter //; -CREATE FUNCTION fn2() returns char(50) SQL SECURITY DEFINER -BEGIN - return 2; -END// -delimiter ;// - -disconnect connbug33464; - -# cleanup -connection default; -USE dbbug33464; ---source suite/funcs_1/include/show_connection.inc - -SELECT fn1(); -SELECT fn2(); - ---error 0, ER_CANNOT_USER -DROP USER 'userbug33464'@'localhost'; - -DROP FUNCTION fn1; -DROP FUNCTION fn2; -DROP PROCEDURE sp3; - ---error 0, ER_CANNOT_USER -DROP USER 'userbug33464'@'localhost'; - -use test; -DROP DATABASE dbbug33464; - --echo End of 5.1 tests diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 16cccd1a1f4..eb02433c71e 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -1377,4 +1377,66 @@ RENAME TABLE mysql.procs_gone TO mysql.procs_priv; FLUSH PRIVILEGES; +# +# Bug#33464: DROP FUNCTION caused a crash. +# +CREATE DATABASE dbbug33464; +CREATE USER 'userbug33464'@'localhost'; + +GRANT CREATE ROUTINE ON dbbug33464.* TO 'userbug33464'@'localhost'; + +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (connbug33464, localhost, userbug33464, , dbbug33464); +--source suite/funcs_1/include/show_connection.inc + +--disable_warnings +DROP PROCEDURE IF EXISTS sp3; +DROP FUNCTION IF EXISTS fn1; +--enable_warnings + +delimiter //; +CREATE PROCEDURE sp3(v1 char(20)) +BEGIN + SELECT * from dbbug33464.t6 where t6.f2= 'xyz'; +END// +delimiter ;// + +delimiter //; +CREATE FUNCTION fn1() returns char(50) SQL SECURITY INVOKER +BEGIN + return 1; +END// +delimiter ;// + +delimiter //; +CREATE FUNCTION fn2() returns char(50) SQL SECURITY DEFINER +BEGIN + return 2; +END// +delimiter ;// + +disconnect connbug33464; + +# cleanup +connection default; +USE dbbug33464; +--source suite/funcs_1/include/show_connection.inc + +SELECT fn1(); +SELECT fn2(); + +--error 0, ER_CANNOT_USER +DROP USER 'userbug33464'@'localhost'; + +DROP FUNCTION fn1; +DROP FUNCTION fn2; +DROP PROCEDURE sp3; + +--error 0, ER_CANNOT_USER +DROP USER 'userbug33464'@'localhost'; + +use test; +DROP DATABASE dbbug33464; + + --echo End of 5.1 tests -- cgit v1.2.1 From c184cd6320ac3b5cbd1ab953d94ea1ef8c4d200e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Mar 2008 12:40:46 +0100 Subject: Bug#25132 disabled query cache: Qcache_free_blocks = 1 The initial value of free memory blocks in 0. When the query cache is enabled a new memory block gets allocated and is assigned number 1. The free memory block is later split each time query cache memory is allocated for new blocks. This means that the free memory block counter won't be reduced to zero when the number of allocated blocks are zero, but rather one. To avoid confusion this patch changes this behavior so that the free memory block counter is reset to zero when the query cache is disabled. Note that when the query cache is enabled and resized the free memory block counter was still calculated correctly. mysql-test/r/query_cache.result: test case mysql-test/t/query_cache.test: test case sql/sql_cache.cc: Restore the memory block count to 0 for consistency. --- mysql-test/t/query_cache.test | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index 44b63df9739..e0042ab6311 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -1251,6 +1251,15 @@ DROP DATABASE bug30269; disconnect bug30269; DROP USER 'bug30269'@'localhost'; +--echo # +--echo # Bug#25132 disabled query cache: Qcache_free_blocks = 1 +--echo # +set global query_cache_size=100000; +set global query_cache_size=0; +set global query_cache_type=0; +show status like 'Qcache_free_blocks'; + +--echo Restore default values. set GLOBAL query_cache_type=default; set GLOBAL query_cache_limit=default; set GLOBAL query_cache_min_res_unit=default; -- cgit v1.2.1 From 8270d9875ff44900f3c57c15711c03d0b83cbe5d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Mar 2008 18:19:47 +0300 Subject: Fix for bug #34512: CAST( AVG( double ) AS DECIMAL ) returns wrong results Casting AVG() to DECIMAL led to incorrect results when the arguments had a non-DECIMAL type, because in this case Item_sum_avg::val_decimal() performed the division by the number of arguments twice. Fixed by changing Item_sum_avg::val_decimal() to not rely on Item_sum_sum::val_decimal(), i.e. calculate sum and divide using DECIMAL arithmetics for DECIMAL arguments, and utilize val_real() with subsequent conversion to DECIMAL otherwise. mysql-test/r/func_group.result: Added a test case for bug #34512. mysql-test/t/func_group.test: Added a test case for bug #34512. sql/item_sum.cc: Do not use Item_sum_sum::val_decimal() in Item_sum_avg::val_decimal() because the first one, depending on the arguments type, may return either the sum of the arguments, or the average calculated by the virtual val_real() method of Item_sum_avg. Instead, do our own calculation based on the arguments type. --- mysql-test/t/func_group.test | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index 75a380c733f..dbe6d3113d5 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -916,5 +916,15 @@ DROP VIEW v1; DROP TABLE t1; SET SQL_MODE=DEFAULT; +# +# Bug #34512: CAST( AVG( double ) AS DECIMAL ) returns wrong results +# + +CREATE TABLE t1(a DOUBLE); +INSERT INTO t1 VALUES (10), (20); +SELECT AVG(a), CAST(AVG(a) AS DECIMAL) FROM t1; + +DROP TABLE t1; + ### --echo End of 5.0 tests -- cgit v1.2.1 From b2a68038cecdd9881ef420fcbe984acfaa934b7a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Mar 2008 14:07:49 -0500 Subject: Bug#28269: FEDERATED engine fails to quote reserved words for \ field names Add a test that proves the bug is fixed. This doesn't add any new server code. mysql-test/r/federated.result: Verifying that one can use federated with keyword and bizarre column names. mysql-test/t/federated.test: Verifying that one can use federated with keyword and bizarre column names. Eval interprets one level of backslash escaping, so some of this may look strange. --- mysql-test/t/federated.test | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index 76cb5fd4793..191bba244c3 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -6,6 +6,9 @@ connection slave; DROP TABLE IF EXISTS federated.t1; CREATE TABLE federated.t1 ( `id` int(20) NOT NULL, + `group` int NOT NULL default 0, + `a\\b` int NOT NULL default 0, + `a\\` int NOT NULL default 0, `name` varchar(32) NOT NULL default '' ) DEFAULT CHARSET=latin1; @@ -16,6 +19,9 @@ DROP TABLE IF EXISTS federated.t1; --error 1432 CREATE TABLE federated.t1 ( `id` int(20) NOT NULL, + `group` int NOT NULL default 0, + `a\\b` inT NOT NULL default 0, + `a\\` int NOT NULL default 0, `name` varchar(32) NOT NULL default '' ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 @@ -25,6 +31,9 @@ CREATE TABLE federated.t1 ( --error 1432 CREATE TABLE federated.t1 ( `id` int(20) NOT NULL, + `group` int NOT NULL default 0, + `a\\b` iNt NOT NULL default 0, + `a\\` int NOT NULL default 0, `name` varchar(32) NOT NULL default '' ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 @@ -34,6 +43,9 @@ CREATE TABLE federated.t1 ( --replace_result $SLAVE_MYPORT SLAVE_PORT eval CREATE TABLE federated.t1 ( `id` int(20) NOT NULL, + `group` int NOT NULL default 0, + `a\\\\b` iNT NOT NULL default 0, + `a\\\\` int NOT NULL default 0, `name` varchar(32) NOT NULL default '' ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 @@ -46,6 +58,9 @@ DROP TABLE federated.t1; --replace_result $SLAVE_MYPORT SLAVE_PORT eval CREATE TABLE federated.t1 ( `id` int(20) NOT NULL, + `group` int NOT NULL default 0, + `a\\\\b` Int NOT NULL default 0, + `a\\\\` int NOT NULL default 0, `name` varchar(32) NOT NULL default '' ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 @@ -58,6 +73,9 @@ DROP TABLE federated.t1; --replace_result $SLAVE_MYPORT SLAVE_PORT eval CREATE TABLE federated.t1 ( `id` int(20) NOT NULL, + `group` int NOT NULL default 0, + `a\\\\b` InT NOT NULL default 0, + `a\\\\` int NOT NULL default 0, `name` varchar(32) NOT NULL default '' ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 @@ -65,6 +83,9 @@ eval CREATE TABLE federated.t1 ( INSERT INTO federated.t1 (id, name) VALUES (1, 'foo'); INSERT INTO federated.t1 (id, name) VALUES (2, 'fee'); +INSERT INTO federated.t1 (id, `group`) VALUES (3, 42); +INSERT INTO federated.t1 (id, `a\\b`) VALUES (4, 23); +INSERT INTO federated.t1 (id, `a\\`) VALUES (5, 1); SELECT * FROM federated.t1; DELETE FROM federated.t1; -- cgit v1.2.1 From 99c0b5e10ff2f64df6b3d90096be0ece31130dcb Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Mar 2008 11:15:49 +0200 Subject: Bug #34909: mysqldump returns a 0 status on error when using --master-data No error code was returned by mysqldump if it detects that binary logging is not enabled on the server. Fixed by returning error code. client/mysqldump.c: Bug #34909: add error code mysql-test/r/mysqldump-no-binlog.result: Bug #34909: test case mysql-test/t/mysqldump-no-binlog-master.opt: Bug #34909: test case mysql-test/t/mysqldump-no-binlog.test: Bug #34909: test case --- mysql-test/t/mysqldump-no-binlog-master.opt | 1 + mysql-test/t/mysqldump-no-binlog.test | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 mysql-test/t/mysqldump-no-binlog-master.opt create mode 100644 mysql-test/t/mysqldump-no-binlog.test (limited to 'mysql-test/t') diff --git a/mysql-test/t/mysqldump-no-binlog-master.opt b/mysql-test/t/mysqldump-no-binlog-master.opt new file mode 100644 index 00000000000..789275fa25e --- /dev/null +++ b/mysql-test/t/mysqldump-no-binlog-master.opt @@ -0,0 +1 @@ +--skip-log-bin diff --git a/mysql-test/t/mysqldump-no-binlog.test b/mysql-test/t/mysqldump-no-binlog.test new file mode 100644 index 00000000000..434b2931792 --- /dev/null +++ b/mysql-test/t/mysqldump-no-binlog.test @@ -0,0 +1,6 @@ +# Embedded server doesn't support external clients +--source include/not_embedded.inc + +--replace_regex /MASTER_LOG_POS=[0-9]+/XX/ +--error 2 +--exec $MYSQL_DUMP --compact --master-data=2 test 2>&1 -- cgit v1.2.1 From 44df0f6e9cece95b914f3f3b0ce3d3baa6f2dbf1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Mar 2008 18:41:50 +0400 Subject: BUG#34656 - KILL a query = Assertion failed: m_status == DA_ERROR || m_status == DA_OK Reading from information_scema.tables or information_schema.columns may cause assertion failure in debug builds. This may happen under rare circumstances when information_schema fails to get information about a table (e.g. when a connection is killed). This happens because open_normal_and_derived_tables() can return an error without setting an error message in THD. But information_schema attempts to get an error message from THD unconditionally. With this fix information_schema attempts to get an error message from THD only in case error message is set in THD. mysql-test/r/information_schema.result: A test case for BUG#34656. mysql-test/t/information_schema.test: A test case for BUG#34656. sql/item_func.cc: Set proc info to "User sleep". sql/sql_show.cc: open_normal_and_derived_tables() can return an error without setting an error message in THD. That means we must access error message conditionally, only in case thd->is_error() is true. --- mysql-test/t/information_schema.test | 44 ++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 6e76a043645..9f99f0fe32b 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -1270,4 +1270,48 @@ show open tables where f1()=0; drop table t1; drop function f1; +# +# BUG#34656 - KILL a query = Assertion failed: m_status == DA_ERROR || +# m_status == DA_OK +# +connect (conn1, localhost, root,,); +connection conn1; +let $ID= `select connection_id()`; +send select * from information_schema.tables where 1=sleep(100000); +connection default; +let $wait_timeout= 10; +let $wait_condition=select count(*)=1 from information_schema.processlist +where state='User sleep' and +info='select * from information_schema.tables where 1=sleep(100000)'; +--source include/wait_condition.inc +disable_query_log; +eval kill $ID; +enable_query_log; +disconnect conn1; +let $wait_timeout= 10; +let $wait_condition=select count(*)=0 from information_schema.processlist +where state='User sleep' and +info='select * from information_schema.tables where 1=sleep(100000)'; +--source include/wait_condition.inc + +connect (conn1, localhost, root,,); +connection conn1; +let $ID= `select connection_id()`; +send select * from information_schema.columns where 1=sleep(100000); +connection default; +let $wait_timeout= 10; +let $wait_condition=select count(*)=1 from information_schema.processlist +where state='User sleep' and +info='select * from information_schema.columns where 1=sleep(100000)'; +--source include/wait_condition.inc +disable_query_log; +eval kill $ID; +enable_query_log; +disconnect conn1; +let $wait_timeout= 10; +let $wait_condition=select count(*)=0 from information_schema.processlist +where state='User sleep' and +info='select * from information_schema.columns where 1=sleep(100000)'; +--source include/wait_condition.inc + --echo End of 5.1 tests. -- cgit v1.2.1 From 0ba100d3031d78631b9d56d439f0845887fc880e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Mar 2008 21:14:34 +0300 Subject: Fix for bug #34650: Test suite without cluster fails on Mac OS X Leopard. The change_user test failed because results of some statements depended on platform and server build flags. subselect_notembedded failure was a result of a bad merge from 5.0. Fixed the corresponding test cases. mysql-test/r/change_user.result: Fixed the test case. mysql-test/r/subselect.result: Fixed the test case. mysql-test/r/subselect_notembedded.result: Fixed the test case. mysql-test/t/change_user.test: Fixed the test case. mysql-test/t/subselect.test: Fixed the test case. mysql-test/t/subselect_notembedded.test: Fixed the test case. --- mysql-test/t/change_user.test | 7 ++ mysql-test/t/subselect.test | 46 ------------ mysql-test/t/subselect_notembedded.test | 126 ++++++++++---------------------- 3 files changed, 46 insertions(+), 133 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/change_user.test b/mysql-test/t/change_user.test index d0cdfc8a741..bc29895eb47 100644 --- a/mysql-test/t/change_user.test +++ b/mysql-test/t/change_user.test @@ -4,17 +4,24 @@ --echo Bug#20023 SELECT @@session.sql_big_selects; +# The exact value depends on the server build flags +--replace_result 4294967295 HA_POS_ERROR 18446744073709551615 HA_POS_ERROR SELECT @@global.max_join_size; --echo change_user --change_user SELECT @@session.sql_big_selects; +# The exact value depends on the server build flags +--replace_result 4294967295 HA_POS_ERROR 18446744073709551615 HA_POS_ERROR SELECT @@global.max_join_size; SET @@global.max_join_size = 10000; SET @@session.max_join_size = default; --echo change_user --change_user SELECT @@session.sql_big_selects; +# May produce a warning depending on server build flags +--disable_warnings SET @@global.max_join_size = -1; +--enable_warnings SET @@session.max_join_size = default; --echo change_user --change_user diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index fb3e59cc9d6..c86b0fefbdc 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -3015,52 +3015,6 @@ INSERT INTO t2 VALUES (103, 203); SELECT ((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL FROM t1; DROP TABLE t1, t2; -# -# Bug31048: Many nested subqueries may cause server crash. -# -create table t1(a int,b int,key(a),key(b)); -insert into t1(a,b) values (1,2),(2,1),(2,3),(3,4),(5,4),(5,5), - (6,7),(7,4),(5,3); - -let $nesting= 26; -let $should_work_nesting= 5; -let $start= select sum(a),a from t1 where a> ( select sum(a) from t1 ; -let $end= )group by a ; -let $start_app= where a> ( select sum(a) from t1 ; -let $end_pre= )group by b limit 1 ; - ---disable_result_log ---disable_query_log -# At least 4 level nesting should work without errors -while ($should_work_nesting) -{ ---echo $should_work_nesting - eval $start $end; - eval explain $start $end; - let $start= $start - $start_app; - let $end= $end_pre - $end; - dec $should_work_nesting; -} -# Other may fail with the 'stack overrun error' -while ($nesting) -{ ---echo $nesting ---error 0,1436 - eval $start $end; ---error 0,1436 - eval explain $start $end; - let $start= $start - $start_app; - let $end= $end_pre - $end; - dec $nesting; -} ---enable_result_log ---enable_query_log -drop table t1; - # # Bug #28076: inconsistent binary/varbinary comparison # diff --git a/mysql-test/t/subselect_notembedded.test b/mysql-test/t/subselect_notembedded.test index 040c90452b9..2f1cc261f56 100644 --- a/mysql-test/t/subselect_notembedded.test +++ b/mysql-test/t/subselect_notembedded.test @@ -14,92 +14,44 @@ purge master logs before adddate(current_timestamp(), interval -4 day); create table t1(a int,b int,key(a),key(b)); insert into t1(a,b) values (1,2),(2,1),(2,3),(3,4),(5,4),(5,5), (6,7),(7,4),(5,3); -# test for the stack overflow bug -select sum(a),a from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 - )group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1) -group by a; ---replace_regex /overrun.*$/overrun detected/ ---error 1436 -select sum(a),a from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1) -group by a; -# test for the memory consumption & subquery slowness bug -explain select sum(a),a from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 - )group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1) -group by a; ---replace_regex /overrun.*$/overrun detected/ ---error 1436 -explain select sum(a),a from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 where a> ( select sum(a) from t1 where a> ( - select sum(a) from t1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1 - )group by b limit 1)group by b limit 1)group by b limit 1) -group by a; -drop table t1; +let $nesting= 26; +let $should_work_nesting= 5; +let $start= select sum(a),a from t1 where a> ( select sum(a) from t1 ; +let $end= )group by a ; +let $start_app= where a> ( select sum(a) from t1 ; +let $end_pre= )group by b limit 1 ; + +--disable_result_log +--disable_query_log +# At least 4 level nesting should work without errors +while ($should_work_nesting) +{ +--echo $should_work_nesting + eval $start $end; + eval explain $start $end; + let $start= $start + $start_app; + let $end= $end_pre + $end; + dec $should_work_nesting; +} +# Other may fail with the 'stack overrun error' +while ($nesting) +{ +--echo $nesting +--error 0,1436 + eval $start $end; +--error 0,1436 + eval explain $start $end; + let $start= $start + $start_app; + let $end= $end_pre + $end; + dec $nesting; +} +--enable_result_log +--enable_query_log +drop table t1; +--echo End of 5.1 tests -- cgit v1.2.1 From ec62aba3f054b6fd3eabe774fac0da825a8baf33 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Mar 2008 11:12:12 +0100 Subject: Bug#34731: highest possible value for INT erroneously filtered by WHERE WHERE f1 < n ignored row if f1 was indexed integer column and f1 = TYPE_MAX ^ n = TYPE_MAX+1. The latter value when treated as TYPE overflowed (obviously). This was not handled, it is now. mysql-test/r/range.result: show that on an index int column, we no longer disregard a field val of TYPE_MAX in SELECT ... WHERE ... < TYPE_MAX+1 mysql-test/t/range.test: show that on an index int column, we no longer disregard a field val of TYPE_MAX in SELECT ... WHERE ... < TYPE_MAX+1 sql/opt_range.cc: Handle overflowing of int-types in range-optimizer. Unfortunately requires re-indentation of entire block. Overflow (err == 1) was handled, but only if field->cmp_type() != value->result_type(), which it just wasn't in our case. --- mysql-test/t/range.test | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 87ba3510326..95e0d31ff8f 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -955,4 +955,51 @@ explain select * from t1 where dateval >= '2007-01-01 00:00:00' and dateval <= ' drop table t1; + +# +# Bug #34731: highest possible value for INT erroneously filtered by WHERE +# + +# test UNSIGNED. only occurs when indexed. +CREATE TABLE t1 (f1 TINYINT(11) UNSIGNED NOT NULL, PRIMARY KEY (f1)); + +INSERT INTO t1 VALUES (127),(254),(0),(1),(255); + +# test upper bound +# count 5 +SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 < 256; +SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 < 256.0; +# count 4 +SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 < 255; + +# show we don't fiddle with lower bound on UNSIGNED +# count 0 +SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 < -1; +# count 5 +SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 > -1; + +DROP TABLE t1; + + +# test signed. only occurs when index. +CREATE TABLE t1 ( f1 TINYINT(11) NOT NULL, PRIMARY KEY (f1)); + +INSERT INTO t1 VALUES (127),(126),(0),(-128),(-127); + +# test upper bound +# count 5 +SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 < 128; +SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 < 128.0; +# count 4 +SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 < 127; + +# test lower bound +# count 5 +SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 > -129; +SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 > -129.0; +# count 4 +SELECT SQL_NO_CACHE COUNT(*) FROM t1 WHERE f1 > -128; + +DROP TABLE t1; + # End of 5.0 tests -- cgit v1.2.1 From 326c4e90589dd87792eacfa6e8746bc486a10ba0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Mar 2008 16:13:33 +0300 Subject: A fix for Bug#34643: TRUNCATE crash if trigger and foreign key. In cases when TRUNCATE was executed by invoking mysql_delete() rather than by table recreation (for example, when TRUNCATE was issued on InnoDB table with is referenced by foreign key) triggers were invoked. In debug builds this also led to crash because of an assertion, which assumes that some preliminary actions take place before trigger invocation, which doesn't happen in case of TRUNCATE. The fix is not to execute triggers in mysql_delete() when this function is used by TRUNCATE. mysql-test/r/trigger-trans.result: Update result file. mysql-test/t/trigger-trans.test: A test case for Bug#34643: TRUNCATE crash if trigger and foreign key. sql/sql_delete.cc: Do not process triggers in TRUNCATE. --- mysql-test/t/trigger-trans.test | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/trigger-trans.test b/mysql-test/t/trigger-trans.test index 8103a1ba0b1..5db5b982773 100644 --- a/mysql-test/t/trigger-trans.test +++ b/mysql-test/t/trigger-trans.test @@ -128,5 +128,37 @@ drop table t1, t2, t3; disconnect connection_update; disconnect connection_aux; +# +# Bug#34643: TRUNCATE crash if trigger and foreign key. +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +--enable_warnings + +CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=innodb; +CREATE TABLE t2(b INT, FOREIGN KEY(b) REFERENCES t1(a)) ENGINE=innodb; + +INSERT INTO t1 VALUES (1); + +CREATE TRIGGER t1_bd BEFORE DELETE ON t1 FOR EACH ROW SET @a = 1; +CREATE TRIGGER t1_ad AFTER DELETE ON t1 FOR EACH ROW SET @b = 1; + +SET @a = 0; +SET @b = 0; + +TRUNCATE t1; + +SELECT @a, @b; + +INSERT INTO t1 VALUES (1); + +DELETE FROM t1; + +SELECT @a, @b; + +DROP TABLE t2, t1; + --echo End of 5.0 tests -- cgit v1.2.1 From b80afe52011ff8edc22298cc96f86eabe8f69a8a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Mar 2008 15:38:57 +0100 Subject: Bug#35247 - rpl_transaction.test produces warnings files The test file tried to use a mysqltest command '--warning' but there is no such command. Changed '--warning' to '#--warning'. mysql-test/t/rpl_transaction.test: Bug#35247 - rpl_transaction.test produces warnings files Changed '--warning' to '#--warning'. --- mysql-test/t/rpl_transaction.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/rpl_transaction.test b/mysql-test/t/rpl_transaction.test index 07ba2ea8281..ee9de3b5a5e 100644 --- a/mysql-test/t/rpl_transaction.test +++ b/mysql-test/t/rpl_transaction.test @@ -39,7 +39,7 @@ COMMIT; BEGIN; INSERT INTO tmyisam VALUES (5); INSERT INTO tmyisam VALUES (6); ---warning 1196 +#--warning 1196 ROLLBACK; SELECT * FROM tmyisam ORDER BY a; -- cgit v1.2.1 From b279be388e1d8208396ada701d3015b9d7cbbc4c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Mar 2008 17:44:40 +0300 Subject: Fix for Bug#33507: Event scheduler creates more threads than max_connections -- which results in user lockout. The problem was that the variable thread_count that contains the number of active threads was interpreted as a number of active connections. The fix is to introduce a new counter for active connections. mysql-test/r/connect.result: A test case for Bug#33507: Event scheduler creates more threads than max_connections -- which results in user lockout. mysql-test/t/connect.test: A test case for Bug#33507: Event scheduler creates more threads than max_connections -- which results in user lockout. sql/mysql_priv.h: 1. Polishing: login_connection() and end_connection() need not to be public. 2. Introduce connection_count -- a variable to contain the number of active connections. It is protected by LOCK_connection_count. sql/mysqld.cc: Use connection_count to count active connections. sql/sql_connect.cc: 1. Use connection_count to count active connections. 2. Make login_connection(), end_connection() private for the module as they had to be. --- mysql-test/t/connect.test | 127 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 126 insertions(+), 1 deletion(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/connect.test b/mysql-test/t/connect.test index 2e66c24d877..9e8f0d9b115 100644 --- a/mysql-test/t/connect.test +++ b/mysql-test/t/connect.test @@ -102,4 +102,129 @@ disconnect con7; connection default; drop table t1; -# End of 4.1 tests +--disconnect con1 +--disconnect con2 +--disconnect con3 +--disconnect con4 +--disconnect con5 +--disconnect con6 +--disconnect con10 + +--echo # ------------------------------------------------------------------ +--echo # -- End of 4.1 tests +--echo # ------------------------------------------------------------------ + +--echo +--echo # -- Bug#33507: Event scheduler creates more threads than max_connections +--echo # -- which results in user lockout. +--echo + +GRANT USAGE ON *.* TO mysqltest_u1@localhost; + +# NOTE: if the test case fails sporadically due to spurious connections, +# consider disabling all users. + +--echo + +let $saved_max_connections = `SELECT @@global.max_connections`; + +SET GLOBAL max_connections = 3; +SET GLOBAL event_scheduler = ON; + +--echo +--echo # -- Waiting for old connections to close... +let $wait_condition = + SELECT COUNT(*) = 1 + FROM information_schema.processlist + WHERE db = 'test'; +--source include/wait_condition.inc + +--echo +let $wait_condition = + SELECT COUNT(*) = 1 + FROM information_schema.processlist + WHERE user = 'event_scheduler'; +--source include/wait_condition.inc +--echo + +--echo # -- Disconnecting default connection... +--disconnect default + +--echo +--echo # -- Check that we allow exactly three user connections, no matter how +--echo # -- many threads are running. +--echo + +--echo # -- Connecting (1)... +--connect (con_1,localhost,mysqltest_u1) + +--echo +--echo # -- Waiting for root connection to close... +let $wait_condition = + SELECT COUNT(*) = 1 + FROM information_schema.processlist + WHERE db = 'test'; +--source include/wait_condition.inc +--echo + +--echo # -- Connecting (2)... +--connect (con_2,localhost,mysqltest_u1) + +--echo # -- Connecting (3)... +--connect (con_3,localhost,mysqltest_u1) + +--echo # -- Connecting (4)... +--disable_query_log +--error ER_CON_COUNT_ERROR +--connect (con_4,localhost,mysqltest_u1) +--enable_query_log + +--echo +--echo # -- Waiting for the last connection to close... +let $wait_condition = + SELECT COUNT(*) = 3 + FROM information_schema.processlist + WHERE db = 'test'; +--source include/wait_condition.inc + +--echo +--echo # -- Check that we allow one extra SUPER-user connection. +--echo + +--echo # -- Connecting super (1)... +--connect (con_super_1,localhost,root) + +--echo # -- Connecting super (2)... +--disable_query_log +--error ER_CON_COUNT_ERROR +--connect (con_super_2,localhost,root) +--enable_query_log + +--echo +# Ensure that we have Event Scheduler thread, 3 ordinary user connections and +# one extra super-user connection. +SELECT user FROM information_schema.processlist ORDER BY id; + +--echo +--echo # -- Resetting variables... + +--eval SET GLOBAL max_connections = $saved_max_connections +SET GLOBAL event_scheduler = OFF; + +--echo +--echo # -- That's it. Closing connections... +--disconnect con_1 +--disconnect con_2 +--disconnect con_super_1 + +--echo +--echo # -- Restoring default connection... +--connect (default,localhost,root,,test) + +--echo +--echo # -- End of Bug#33507. +--echo + +--echo # ------------------------------------------------------------------ +--echo # -- End of 5.1 tests +--echo # ------------------------------------------------------------------ -- cgit v1.2.1 From b5978a9424c6213a8282713feb3734c2f92968c8 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Mar 2008 12:40:12 -0400 Subject: Bug#26703: DROP DATABASE fails if database contains a #mysql50# \ table with backticks (Thanks to Lu Jingdong, though I did not take his patch directly, as it contained a significant flaw.) It wasn't a backtick/parsing problem. We merely didn't anticipate and allocate enough space to handle the optional "#mysql50#" table- name prefix. Now, allocate that extra space in case we need it when we look up a legacy table to get its file's name. mysql-test/r/drop.result: Verify that databases with old-style files can be removed. mysql-test/t/drop.test: Verify that databases with old-style files can be removed. sql/sql_db.cc: Extend the size of the memory that holds the table's name, so that the legacy "mysql50" prefix fits. --- mysql-test/t/drop.test | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/drop.test b/mysql-test/t/drop.test index a79044436eb..ad26287a666 100644 --- a/mysql-test/t/drop.test +++ b/mysql-test/t/drop.test @@ -134,4 +134,19 @@ drop table mysql_test.`#sql-347f_8`; copy_file $MYSQLTEST_VARDIR/master-data/mysql_test/t1.frm $MYSQLTEST_VARDIR/master-data/mysql_test/#sql-347f_6.frm; drop database mysql_test; +# +# Bug#26703: DROP DATABASE fails if database contains a #mysql50# table with backticks +# +create database mysqltestbug26703; +use mysqltestbug26703; +create table `#mysql50#abc``def` ( id int ); +--error ER_WRONG_TABLE_NAME +create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (a int); +create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (a int); +create table `#mysql50#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (a int); +--error ER_WRONG_TABLE_NAME +create table `#mysql50#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (a int); +use test; +drop database mysqltestbug26703; + --echo End of 5.1 tests -- cgit v1.2.1 From c167501bfb10d21a72bdf61ff59dc155280bc45e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Mar 2008 12:02:12 +0300 Subject: Fix for Bug#35074: max_used_connections is not correct. The problem was that number of threads was used to calculate max_used_connections. The fix is to use number of active connections. mysql-test/r/connect.result: Update result file. mysql-test/t/connect.test: - Add a test case for Bug#35074: max_used_connections is not correct; - Make a test case for Bug#33507 more stable. sql/mysqld.cc: Use number of connections insetad of threads to calculate max_used_connections. --- mysql-test/t/connect.test | 75 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/connect.test b/mysql-test/t/connect.test index 9e8f0d9b115..c8b69a050ba 100644 --- a/mysql-test/t/connect.test +++ b/mysql-test/t/connect.test @@ -209,22 +209,97 @@ SELECT user FROM information_schema.processlist ORDER BY id; --echo # -- Resetting variables... --eval SET GLOBAL max_connections = $saved_max_connections + +--echo +--echo # -- Stopping Event Scheduler... SET GLOBAL event_scheduler = OFF; +--echo # -- Waiting for Event Scheduler to stop... +let $wait_condition = + SELECT COUNT(*) = 0 + FROM information_schema.processlist + WHERE user = 'event_scheduler'; +--source include/wait_condition.inc + --echo --echo # -- That's it. Closing connections... --disconnect con_1 --disconnect con_2 +--disconnect con_3 --disconnect con_super_1 --echo --echo # -- Restoring default connection... --connect (default,localhost,root,,test) +--echo +--echo # -- Waiting for connections to close... +let $wait_condition = + SELECT COUNT(*) = 1 + FROM information_schema.processlist + WHERE db = 'test'; +--source include/wait_condition.inc + +--echo +DROP USER mysqltest_u1@localhost; + --echo --echo # -- End of Bug#33507. --echo +########################################################################### + +--echo # -- Bug#35074: max_used_connections is not correct. +--echo + +FLUSH STATUS; + +--echo +SHOW STATUS LIKE 'max_used_connections'; + +--echo +--echo # -- Starting Event Scheduler... +SET GLOBAL event_scheduler = ON; + +--echo # -- Waiting for Event Scheduler to start... +let $wait_condition = + SELECT COUNT(*) = 1 + FROM information_schema.processlist + WHERE user = 'event_scheduler'; +--source include/wait_condition.inc + +# NOTE: We should use a new connection here instead of reconnect in order to +# avoid races (we can not for sure when the connection being disconnected is +# actually disconnected on the server). + +--echo +--echo # -- Opening a new connection to check max_used_connections... +--connect (con_1,localhost,root) + +--echo +--echo # -- Check that max_used_connections hasn't changed. +SHOW STATUS LIKE 'max_used_connections'; + +--echo +--echo # -- Closing new connection... +--disconnect con_1 +--connection default + +--echo +--echo # -- Stopping Event Scheduler... +SET GLOBAL event_scheduler = OFF; + +--echo # -- Waiting for Event Scheduler to stop... +let $wait_condition = + SELECT COUNT(*) = 0 + FROM information_schema.processlist + WHERE user = 'event_scheduler'; +--source include/wait_condition.inc + +--echo +--echo # -- End of Bug#35074. +--echo + --echo # ------------------------------------------------------------------ --echo # -- End of 5.1 tests --echo # ------------------------------------------------------------------ -- cgit v1.2.1 From e85d6a915d242e8d39f021f4933c450323cec953 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Mar 2008 16:39:27 +0100 Subject: Bug#33756 - query cache with concurrent_insert=0 appears broken When concurrent inserts were disabled, statements after an INSERT were not put into the query cache. This happened because we do not save the current data file length at statement start when concurrent inserts are disabled. But we checked the always zero local length against the real file length anyway. Fixed by doing the check only if concurrent inserts are not diabled. mysql-test/r/query_cache.result: Bug#33756 - query cache with concurrent_insert=0 appears broken Added test result. mysql-test/t/query_cache.test: Bug#33756 - query cache with concurrent_insert=0 appears broken Added test. sql/ha_myisam.cc: Bug#33756 - query cache with concurrent_insert=0 appears broken Changed code so that file length check is done only when concurrent inserts are possible. --- mysql-test/t/query_cache.test | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index 44b63df9739..ebd24bf2b89 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -1255,5 +1255,25 @@ set GLOBAL query_cache_type=default; set GLOBAL query_cache_limit=default; set GLOBAL query_cache_min_res_unit=default; set GLOBAL query_cache_size=default; +use test; + +# +# Bug#33756 - query cache with concurrent_insert=0 appears broken +# +FLUSH STATUS; +SET GLOBAL query_cache_size=10*1024*1024; +SET @save_concurrent_insert= @@concurrent_insert; +SET GLOBAL concurrent_insert= 0; +CREATE TABLE t1 (c1 INT NOT NULL) ENGINE=MyISAM; +INSERT INTO t1 (c1) VALUES (1), (2); +# +SHOW GLOBAL VARIABLES LIKE 'concurrent_insert'; +SHOW STATUS LIKE 'Qcache_hits'; +SELECT * FROM t1; +SELECT * FROM t1; +SHOW STATUS LIKE 'Qcache_hits'; +DROP TABLE t1; +SET GLOBAL concurrent_insert= @save_concurrent_insert; +SET GLOBAL query_cache_size= default; # End of 5.0 tests -- cgit v1.2.1 From 416ab8532e6ee39de48c75aca49aa665cc8d2a2a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Mar 2008 14:54:29 -0300 Subject: Bug#34891 sp_notembedded.test fails sporadically The problem is that since MyISAM's concurrent_insert is on by default some concurrent SELECT statements might not see changes made by INSERT statements in other connections, even if the INSERT statement has returned. The solution is to disable concurrent_insert so that INSERT statements returns after the data is actually visible to other statements. mysql-test/r/flush_read_lock_kill.result: Restore old value of @@global.concurrent_insert mysql-test/r/kill.result: Restore old value of @@global.concurrent_insert mysql-test/r/sp_notembedded.result: Update test case result mysql-test/t/flush_read_lock_kill.test: Restore old value of @@global.concurrent_insert so it doesn't affect other tests. mysql-test/t/kill.test: Restore old value of @@global.concurrent_insert so it doesn't affect other tests. mysql-test/t/sp_notembedded.test: Disable and restore concurrent_insert value at the end of the test case. The test case for Bug 29936 requires that the inserted rows need to be visible before a SELECT statement is queued in another connection. Remove sleep at the start of the test, it's not necessary to log the result of the processlist command, showing the warnings has the same end result. --- mysql-test/t/flush_read_lock_kill.test | 5 ++ mysql-test/t/kill.test | 7 ++ mysql-test/t/sp_notembedded.test | 141 ++++++++++++++++++--------------- 3 files changed, 87 insertions(+), 66 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/flush_read_lock_kill.test b/mysql-test/t/flush_read_lock_kill.test index c3926d09205..c03f3be2534 100644 --- a/mysql-test/t/flush_read_lock_kill.test +++ b/mysql-test/t/flush_read_lock_kill.test @@ -14,6 +14,7 @@ # Disable concurrent inserts to avoid test failures when reading the # connection id which was inserted into a table by another thread. +set @old_concurrent_insert= @@global.concurrent_insert; set @@global.concurrent_insert= 0; connect (con1,localhost,root,,); @@ -58,3 +59,7 @@ reap; connection con2; drop table t1; +connection default; + +# Restore global concurrent_insert value +set @@global.concurrent_insert= @old_concurrent_insert; diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test index b7e1e82fe5d..8ef668f542b 100644 --- a/mysql-test/t/kill.test +++ b/mysql-test/t/kill.test @@ -8,6 +8,7 @@ # Disable concurrent inserts to avoid test failures when reading the # connection id which was inserted into a table by another thread. +set @old_concurrent_insert= @@global.concurrent_insert; set @@global.concurrent_insert= 0; connect (con1, localhost, root,,); @@ -326,3 +327,9 @@ KILL CONNECTION_ID(); --echo # of close of the connection socket --error 2013, 2006 SELECT 1; +--connection default + +########################################################################### + +# Restore global concurrent_insert value. Keep in the end of the test file. +set @@global.concurrent_insert= @old_concurrent_insert; diff --git a/mysql-test/t/sp_notembedded.test b/mysql-test/t/sp_notembedded.test index 4e298b2076a..16ebb710f25 100644 --- a/mysql-test/t/sp_notembedded.test +++ b/mysql-test/t/sp_notembedded.test @@ -1,7 +1,9 @@ # Can't test with embedded server -- source include/not_embedded.inc +# Disable concurrent inserts to avoid test failures +set @old_concurrent_insert= @@global.concurrent_insert; +set @@global.concurrent_insert= 0; ---sleep 2 --disable_warnings drop table if exists t1,t3; --enable_warnings @@ -39,10 +41,14 @@ create procedure bug4902_2() begin show processlist; end| ---replace_column 1 # 6 # 3 localhost +--disable_result_log call bug4902_2()| ---replace_column 1 # 6 # 3 localhost +--enable_result_log +show warnings| +--disable_result_log call bug4902_2()| +--enable_result_log +show warnings| drop procedure bug4902_2| # @@ -268,69 +274,72 @@ drop procedure 15298_1; drop procedure 15298_2; # -# Test case disabled due to Bug#34891: sp_notembedded.test fails sporadically. +# Bug#29936 Stored Procedure DML ignores low_priority_updates setting # -# # -# # Bug#29936 Stored Procedure DML ignores low_priority_updates setting -# # -# -# --disable_warnings -# drop table if exists t1; -# drop procedure if exists p1; -# --enable_warnings -# -# create table t1 (value varchar(15)); -# create procedure p1() update t1 set value='updated' where value='old'; -# -# # load the procedure into sp cache and execute once -# call p1(); -# -# insert into t1 (value) values ("old"); -# -# connect (rl_holder, localhost, root,,); -# connect (rl_acquirer, localhost, root,,); -# connect (rl_contender, localhost, root,,); -# connect (rl_wait, localhost, root,,); -# -# connection rl_holder; -# select get_lock('b26162',120); -# -# connection rl_acquirer; -# --send select 'rl_acquirer', value from t1 where get_lock('b26162',120); -# -# # we must wait till this select opens and locks the tables -# connection rl_wait; -# let $wait_condition= -# select count(*) = 1 from information_schema.processlist -# where state = "User lock" and -# info = "select 'rl_acquirer', value from t1 where get_lock('b26162',120)"; -# --source include/wait_condition.inc -# -# connection default; -# set session low_priority_updates=on; -# --send call p1(); -# -# connection rl_wait; -# let $wait_condition= -# select count(*) = 1 from information_schema.processlist -# where state = "Locked" and -# info = "update t1 set value='updated' where value='old'"; -# --source include/wait_condition.inc -# -# connection rl_contender; -# select 'rl_contender', value from t1; -# -# connection rl_holder; -# select release_lock('b26162'); + +--disable_warnings +drop table if exists t1; +drop procedure if exists p1; +--enable_warnings + +create table t1 (value varchar(15)); +create procedure p1() update t1 set value='updated' where value='old'; + +# load the procedure into sp cache and execute once +call p1(); + +insert into t1 (value) values ("old"); + +connect (rl_holder, localhost, root,,); +connect (rl_acquirer, localhost, root,,); +connect (rl_contender, localhost, root,,); +connect (rl_wait, localhost, root,,); + +connection rl_holder; +select get_lock('b26162',120); + +connection rl_acquirer; +--send select 'rl_acquirer', value from t1 where get_lock('b26162',120); + +# we must wait till this select opens and locks the tables +connection rl_wait; +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "User lock" and + info = "select 'rl_acquirer', value from t1 where get_lock('b26162',120)"; +--source include/wait_condition.inc + +connection default; +set session low_priority_updates=on; +--send call p1(); + +connection rl_wait; +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Locked" and + info = "update t1 set value='updated' where value='old'"; +--source include/wait_condition.inc + +connection rl_contender; +select 'rl_contender', value from t1; + +connection rl_holder; +select release_lock('b26162'); + +connection rl_acquirer; +--reap +connection default; +--reap + +disconnect rl_holder; +disconnect rl_acquirer; +disconnect rl_wait; +drop procedure p1; +drop table t1; +set session low_priority_updates=default; + # -# connection rl_acquirer; -# --reap -# connection default; -# --reap +# Restore global concurrent_insert value. Keep in the end of the test file. # -# disconnect rl_holder; -# disconnect rl_acquirer; -# disconnect rl_wait; -# drop procedure p1; -# drop table t1; -# set session low_priority_updates=default; + +set @@global.concurrent_insert= @old_concurrent_insert; -- cgit v1.2.1 From d5f09a13def2462127a1b3c3f268866136f748d5 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Mar 2008 10:03:01 +0800 Subject: BUG#33029 5.0 to 5.1 replication fails on dup key when inserting using a trig in SP For all 5.0 and up to 5.1.12 exclusive, when a stored routine or trigger caused an INSERT into an AUTO_INCREMENT column, the generated AUTO_INCREMENT value should not be written into the binary log, which means if a statement does not generate AUTO_INCREMENT value itself, there will be no Intvar event (SET INSERT_ID) associated with it even if one of the stored routine or trigger caused generation of such a value. And meanwhile, when executing a stored routine or trigger, it would ignore the INSERT_ID value even if there is a INSERT_ID value available set by a SET INSERT_ID statement. Starting from MySQL 5.1.12, the generated AUTO_INCREMENT value is written into the binary log, and the value will be used if available when executing the stored routine or trigger. Prior fix of this bug in MySQL 5.0 and prior MySQL 5.1.12 (referenced as the buggy versions in the text below), when a statement that generates AUTO_INCREMENT value by the top statement was executed in the body of a SP, all statements in the SP after this statement would be treated as if they had generated AUTO_INCREMENT by the top statement. When a statement that did not generate AUTO_INCREMENT value by the top statement but by a function/trigger called by it, an erroneous Intvar event would be associated with the statement, this erroneous INSERT_ID value wouldn't cause problem when replicating between masters and slaves of 5.0.x or prior 5.1.12, because the erroneous INSERT_ID value was not used when executing functions/triggers. But when replicating from buggy versions to 5.1.12 or newer, which will use the INSERT_ID value in functions/triggers, the erroneous value will be used, which would cause duplicate entry error and cause the slave to stop. The patch for 5.0 fixed it not to generate the erroneous Intvar event, another patch for 5.1 fixed it to ignore the SET INSERT_ID value when executing functions/triggers if it is replicating from a master of buggy versions. mysql-test/include/show_binlog_events.inc: add $binlog_start parameter to set the start position when show binlog events, if not set a default value will be used. mask out column 2(Pos), 4(Server_id), table_id, and file_id sql/sql_class.cc: Reset insert_id_used after each query in SP mysql-test/r/rpl_auto_increment_bug33029.result: Add test for bug33029, test if the master generate the erroneous event or not mysql-test/t/rpl_auto_increment_bug33029.test: Add test for bug33029, test if the master generate the erroneous event or not --- mysql-test/t/rpl_auto_increment_bug33029.test | 107 ++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 mysql-test/t/rpl_auto_increment_bug33029.test (limited to 'mysql-test/t') diff --git a/mysql-test/t/rpl_auto_increment_bug33029.test b/mysql-test/t/rpl_auto_increment_bug33029.test new file mode 100644 index 00000000000..a4f716d8411 --- /dev/null +++ b/mysql-test/t/rpl_auto_increment_bug33029.test @@ -0,0 +1,107 @@ +# BUG#33029 5.0 to 5.1 replication fails on dup key when inserting +# using a trig in SP + +# For all 5.0 up to 5.0.58 exclusive, and 5.1 up to 5.1.12 exclusive, +# if one statement in a SP generated AUTO_INCREMENT value by the top +# statement, all statements after it would be considered generated +# AUTO_INCREMENT value by the top statement, and a erroneous INSERT_ID +# value might be associated with these statement, which could cause +# duplicate entry error and stop the slave. + +source include/master-slave.inc; + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +DROP PROCEDURE IF EXISTS p1; +DROP PROCEDURE IF EXISTS p2; +DROP TRIGGER IF EXISTS tr1; +DROP FUNCTION IF EXISTS f1; +--enable_warnings + +CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY); +CREATE TABLE t2 (id INT AUTO_INCREMENT PRIMARY KEY); + +delimiter //; + +CREATE PROCEDURE p1() +BEGIN + DECLARE ins_count INT DEFAULT 10; + + WHILE ins_count > 0 DO + INSERT INTO t1 VALUES (NULL); + SET ins_count = ins_count - 1; + END WHILE; + + DELETE FROM t1 WHERE id = 1; + DELETE FROM t1 WHERE id = 2; + DELETE FROM t2 WHERE id = 1; + DELETE FROM t2 WHERE id = 2; +END// + +CREATE PROCEDURE p2() +BEGIN + INSERT INTO t1 VALUES (NULL); + DELETE FROM t1 WHERE id = f1(3); + DELETE FROM t1 WHERE id = f1(4); + DELETE FROM t2 WHERE id = 3; + DELETE FROM t2 WHERE id = 4; +END// + +CREATE TRIGGER tr1 BEFORE DELETE + ON t1 FOR EACH ROW + BEGIN + INSERT INTO t2 VALUES (NULL); + END// + +CREATE FUNCTION f1 (i int) RETURNS int + BEGIN + INSERT INTO t2 VALUES (NULL); + RETURN i; + END// + +delimiter ;// + +# the $binlog_start will be used by the show_binlog_events.inc, so +# that we can skip binlog events we don't care +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +CALL p1(); +source include/show_binlog_events.inc; + +echo # Result on master; +SELECT * FROM t1; +SELECT * FROM t2; + +sync_slave_with_master; + +echo # Result on slave; +SELECT * FROM t1; +SELECT * FROM t2; + +connection master; + +DROP TRIGGER tr1; + +# the $binlog_start will be used by the show_binlog_events.inc, so +# that we can skip binlog events we don't care +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +CALL p2(); +source include/show_binlog_events.inc; + +echo # Result on master; +SELECT * FROM t1; +SELECT * FROM t2; + +sync_slave_with_master; + +echo # Result on slave; +SELECT * FROM t1; +SELECT * FROM t2; + +# clean up +connection master; +DROP TABLE IF EXISTS t1, t2; +DROP PROCEDURE IF EXISTS p1; +DROP PROCEDURE IF EXISTS p2; +DROP FUNCTION IF EXISTS f1; +DROP TRIGGER IF EXISTS tr1; +sync_slave_with_master; -- cgit v1.2.1 From 45b4d937c6bb7e1483c1fdbaf15bcb20a08ae683 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Mar 2008 14:12:39 +0400 Subject: Bug#35108 SELECT FROM REFERENTIAL_CONSTRAINTS crashes referenced_key_name field can be uninitialized in the case when referenced table is dropped. Added codition which allows to handle this situation. mysql-test/r/information_schema_inno.result: test result mysql-test/t/information_schema_inno.test: test result sql/sql_show.cc: referenced_key_name field can be uninitialized in the case when referenced table is dropped. Added codition which allows to handle this situation. --- mysql-test/t/information_schema_inno.test | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/information_schema_inno.test b/mysql-test/t/information_schema_inno.test index e73f4ba2792..1a537d740b7 100644 --- a/mysql-test/t/information_schema_inno.test +++ b/mysql-test/t/information_schema_inno.test @@ -76,3 +76,16 @@ select referenced_table_schema, referenced_table_name from information_schema.key_column_usage where constraint_schema = 'db-1'; drop database `db-1`; + +# +# Bug#35108 SELECT FROM REFERENTIAL_CONSTRAINTS crashes +# +create table t1(id int primary key) engine = Innodb; +create table t2(pid int, foreign key (pid) references t1(id)) engine = Innodb; +set foreign_key_checks = 0; +drop table t1; +select UNIQUE_CONSTRAINT_NAME +from information_schema.referential_constraints +where constraint_schema = schema(); +drop table t2; +set foreign_key_checks = 1; -- cgit v1.2.1 From 9fa2d50559383785c72656dcdffa878cc3563da9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Mar 2008 14:03:47 +0100 Subject: Post-merge fix. Moved the symlink handling from sql_parse.cc here. mysql-test/r/symlink.result: Post-merge fix mysql-test/t/symlink.test: Post-merge fix --- mysql-test/t/symlink.test | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test index 5802e65df1e..1323451d984 100644 --- a/mysql-test/t/symlink.test +++ b/mysql-test/t/symlink.test @@ -126,6 +126,9 @@ drop table t1; --write_file $MYSQLTEST_VARDIR/tmp/t1.MYI EOF --replace_result $MYSQLTEST_VARDIR TEST_DIR +# If $MYSQLTEST_VARDIR is a symbolic link, the low level MyISAm error +# message contains the real path of $MYSQLTEST_VARDIR. Try to catch this. +--replace_regex /write to file '\/.*\/tmp/write to file 'TEST_DIR\/tmp/ --error 1 eval CREATE TABLE t1(a INT) DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp' @@ -209,13 +212,13 @@ INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data/mysql'; eval CREATE TABLE t1(a INT) DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/test'; --replace_result $MYSQLTEST_VARDIR TEST_DIR +--error 1210 eval CREATE TABLE t1(a INT) DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/'; -DROP TABLE t1; --replace_result $MYSQLTEST_VARDIR TEST_DIR +--error 1210 eval CREATE TABLE t1(a INT) INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data'; -DROP TABLE t1; --replace_result $MYSQLTEST_VARDIR TEST_DIR --error 1 eval CREATE TABLE t1(a INT) -- cgit v1.2.1 From 3ec867679a12e6a14bed745bc76752d5e2691774 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Mar 2008 17:17:03 +0400 Subject: BUG#13861 - START SLAVE UNTIL may stop 1 evnt too late if log-slave-updates and circul repl This is a test case fix for BUG#13861. mysql-test/r/rpl_dual_pos_advance.result: Fix for a test case for BUG#13861. mysql-test/t/rpl_dual_pos_advance.test: Fix for a test case for BUG#13861. master_pos_wait() requires slave sql thread running. But it is not guaranteed for this test case. As we use start slave until it may execute all events and shutdown before master_pos_wait() is started. On the other hand it is safe just to wait for slave to stop here, as start slave returns _after_ sql thread is started. --- mysql-test/t/rpl_dual_pos_advance.test | 6 ------ 1 file changed, 6 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/rpl_dual_pos_advance.test b/mysql-test/t/rpl_dual_pos_advance.test index 5e08284a2f2..6a3cf9e4f97 100644 --- a/mysql-test/t/rpl_dual_pos_advance.test +++ b/mysql-test/t/rpl_dual_pos_advance.test @@ -65,12 +65,6 @@ connection master; # asking it to stop before creation of t3. start slave until master_log_file="slave-bin.000001",master_log_pos=195; - -# wait until it's started (the position below is the start of "CREATE -# TABLE t2") (otherwise wait_for_slave_to_stop may return at once) - -select master_pos_wait("slave-bin.000001",137); - wait_for_slave_to_stop; # then BUG#13861 causes t3 to show up below (because stopped too -- cgit v1.2.1 From 196b616accbc73d212f21e2ec84353931a2f286b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Mar 2008 19:38:22 +0400 Subject: BUG#28248 - mysqldump results with MERGE ... UNION=() cannot be executed When there are no underlying tables specified for a merge table, SHOW CREATE TABLE outputs a statement that cannot be executed. The same is true for mysqldump (it generates dumps that cannot be executed). This happens because SQL parser does not accept empty UNION() clause. This patch changes the following: - it is now possible to execute CREATE/ALTER statement with empty UNION() clause. - the same as above, but still worth noting: it is now possible to remove underlying tables mapping using ALTER TABLE ... UNION=(). - SHOW CREATE TABLE does not output UNION() clause if there are no underlying tables specified for a merge table. This makes mysqldump slightly smaller. mysql-test/r/merge.result: A test case for BUG#28248. mysql-test/t/merge.test: A test case for BUG#28248. sql/ha_myisammrg.cc: Do not output UNION clause in SHOW CREATE TABLE, when there are no underlying tables defined. sql/sql_yacc.yy: Make underlying table list for MERGE engine optional. As for MERGE engine empty underlying tables list is valid, it should be valid for the parser as well. This change is mostly needed to restore dumps made by earlier MySQL versions. Also with this fix it is possible to remove underlying tables mapping by using ALTER TABLE ... UNION=(). --- mysql-test/t/merge.test | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 35443987858..e5cc4d703f2 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -542,5 +542,18 @@ SELECT * FROM t3; DROP TABLE t1, t2, t3; +# +# BUG#28248 - mysqldump results with MERGE ... UNION=() cannot be executed +# +CREATE TABLE t1(a INT); +CREATE TABLE m1(a INT) ENGINE=MERGE; +SHOW CREATE TABLE m1; +DROP TABLE m1; +CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(); +SHOW CREATE TABLE m1; +ALTER TABLE m1 UNION=(t1); +ALTER TABLE m1 UNION=(); +SHOW CREATE TABLE m1; +DROP TABLE t1, m1; --echo End of 5.0 tests -- cgit v1.2.1 From 0c9946bcfdc869053576b049d5f407021a8449d9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Mar 2008 17:45:14 +0100 Subject: Post-merge fixes mysql-test/r/partition_not_windows.result: Post-merge fixes New warnings mysql-test/r/symlink.result: Post-merge fixes Typo mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction.test: Post-merge fixes Defeated creation of a warnings file. mysql-test/t/partition_symlink.test: Post-merge fixes Fixed directory to an allowed one. mysql-test/t/type_set.test: Post-merge fixes Defeated creation of a warnings file. --- mysql-test/t/partition_symlink.test | 4 ++-- mysql-test/t/type_set.test | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/partition_symlink.test b/mysql-test/t/partition_symlink.test index cf8ba2d2a5f..ea6d4f214bd 100644 --- a/mysql-test/t/partition_symlink.test +++ b/mysql-test/t/partition_symlink.test @@ -134,8 +134,8 @@ eval create table t2 (i int ) partition by range (i) ( partition p01 values less than (1000) - data directory="$MYSQLTEST_VARDIR/master-data/test/" - index directory="$MYSQLTEST_VARDIR/master-data/test/" + data directory="$MYSQLTEST_VARDIR/tmp/" + index directory="$MYSQLTEST_VARDIR/tmp/" ); enable_query_log; diff --git a/mysql-test/t/type_set.test b/mysql-test/t/type_set.test index c7f8c59de28..9586c87571d 100644 --- a/mysql-test/t/type_set.test +++ b/mysql-test/t/type_set.test @@ -75,4 +75,4 @@ INSERT INTO t1 VALUES(9223372036854775808); SELECT * FROM t1; DROP TABLE t1; ---# echo End of 5.0 tests +-- echo End of 5.0 tests -- cgit v1.2.1 From 9699767c952bf30ab4b18a15e131ba417745f855 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Mar 2008 23:11:59 +0400 Subject: Fixed bug #34763. Queries like: SELECT ROW(1, 2) IN (SELECT t1.a, 2) FROM t1 GROUP BY t1.a or SELECT ROW(1, 2) IN (SELECT t1.a, 2 FROM t2) FROM t1 GROUP BY t1.a lead to assertion failure in the Item_in_subselect::row_value_transformer method in debugging build, or to unexpected error message in release build: ERROR 1247 (42S22): Reference '' not supported (forward reference in item list) Unexpected error message and assertion failure have been eliminated. mysql-test/r/subselect3.result: Added test case for bug #34763. mysql-test/t/subselect3.test: Added test case for bug #34763. sql/item.cc: Fixed bug #34763. The Item_ref::fix_fields method has been modified to silently ignore not fixed outer references: by the definition, those references should be fixed later by the call to the fix_inner_refs function. sql/item_subselect.cc: Fixed bug #34763. The Item_in_subselect::row_value_transformer method has been modified to eliminate assertion failure on not fixed outer references: by the definition those references are allowed in this context and should be fixed later by the call to the fix_inner_refs function. --- mysql-test/t/subselect3.test | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/subselect3.test b/mysql-test/t/subselect3.test index 2f844c9cc21..cfbde8c29cd 100644 --- a/mysql-test/t/subselect3.test +++ b/mysql-test/t/subselect3.test @@ -586,6 +586,23 @@ SELECT a FROM t1 WHERE a NOT IN (65,66); SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2); EXPLAIN SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2); -DROP TABLE t1; +DROP TABLE t1, t2; + +# +# Bug #34763: item_subselect.cc:1235:Item_in_subselect::row_value_transformer: +# Assertion failed, unexpected error message: +# ERROR 1247 (42S22): Reference '' not supported (forward +# reference in item list) +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES(1); + +CREATE TABLE t2 (placeholder CHAR(11)); +INSERT INTO t2 VALUES("placeholder"); + +SELECT ROW(1, 2) IN (SELECT t1.a, 2) FROM t1 GROUP BY t1.a; +SELECT ROW(1, 2) IN (SELECT t1.a, 2 FROM t2) FROM t1 GROUP BY t1.a; + +DROP TABLE t1, t2; --echo End of 5.0 tests -- cgit v1.2.1 From 451de554fcf32a7a7d42f0496b701fe4237403c6 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Mar 2008 20:51:32 +0100 Subject: Post-merge fix --- mysql-test/t/type_set.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/type_set.test b/mysql-test/t/type_set.test index c7f8c59de28..e98555e137b 100644 --- a/mysql-test/t/type_set.test +++ b/mysql-test/t/type_set.test @@ -75,4 +75,4 @@ INSERT INTO t1 VALUES(9223372036854775808); SELECT * FROM t1; DROP TABLE t1; ---# echo End of 5.0 tests +--echo End of 5.0 tests -- cgit v1.2.1 From 6bc335e697064b860c8805bfa05e5e6fd1d40f6e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Mar 2008 18:45:50 -0700 Subject: fix results after merge mysql-test/r/partition_not_windows.result: fix results from merge mysql-test/t/disabled.def: disable test partition_symlink --- mysql-test/t/disabled.def | 1 + 1 file changed, 1 insertion(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 9e0b681528b..d1ef92441aa 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -21,3 +21,4 @@ ctype_create : Bug#32965 main.ctype_create fails status : Bug#32966 main.status fails ps_ddl : Bug#12093 2007-12-14 pending WL#4165 / WL#4166 csv_alter_table : Bug#33696 2008-01-21 pcrews no .result file - bug allows NULL columns in CSV tables +partition_symlink : Make pushbuild green -- cgit v1.2.1 From 6bceb154a2bb89733f5bd52410c53a9f0f183131 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Mar 2008 23:01:46 -0700 Subject: make pushbuild green --- mysql-test/t/disabled.def | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index d1ef92441aa..eabdb8be650 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -21,4 +21,6 @@ ctype_create : Bug#32965 main.ctype_create fails status : Bug#32966 main.status fails ps_ddl : Bug#12093 2007-12-14 pending WL#4165 / WL#4166 csv_alter_table : Bug#33696 2008-01-21 pcrews no .result file - bug allows NULL columns in CSV tables -partition_symlink : Make pushbuild green +partition_symlink : Bug#35305 Make pushbuild green +partition_basic_symlink_innodb : Bug#35306 Make pushbuild green +partition_basic_symlink_myisam : Bug#35306 Make pushbuild green -- cgit v1.2.1 From d3a0f85227e8a699d7eca6f59c74a772e8df3554 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 Mar 2008 01:08:35 -0700 Subject: make pushbuild green mysql-test/t/disabled.def: make pushbuild green, entry added to wrong disabled.def file. --- mysql-test/t/disabled.def | 2 -- 1 file changed, 2 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index eabdb8be650..2d73395cd18 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -22,5 +22,3 @@ status : Bug#32966 main.status fails ps_ddl : Bug#12093 2007-12-14 pending WL#4165 / WL#4166 csv_alter_table : Bug#33696 2008-01-21 pcrews no .result file - bug allows NULL columns in CSV tables partition_symlink : Bug#35305 Make pushbuild green -partition_basic_symlink_innodb : Bug#35306 Make pushbuild green -partition_basic_symlink_myisam : Bug#35306 Make pushbuild green -- cgit v1.2.1 From c1e69a77a6f6563214b5f5e8813db423c4f3a04c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Mar 2008 14:26:00 +0300 Subject: Avoid races in connect.test. The problem was in a test case for Bug33507: - when the number of active connections reaches the limit, the server accepts only root connections. That's achieved by accepting a connection, negotiating with the client and checking user credentials. If it is not SUPER, the connection is dropped. - when the server accepts connection, it increases the counter; - when the server drops connection, it decreases the counter; - the race was in between of decreasing the counter and accepting new connection: - max_user_connections = 2; - 2 oridinary user connections accepted; - extra user connection is establishing; - server checked user credentials, and sent 'Too many connections' error; - the client receives the error and establishes extra SUPER user connection; - the server however didn't decrease the counter (the extra user connection still is "alive" in the server) -- so, the new SUPER-user connection, will be dropped, because it exceeds (max_user_connections + 1). The fix is to implement "safe connect", which makes several attempts to connect and use it in the test script. mysql-test/r/connect.result: Update test file. mysql-test/t/connect.test: Avoid races in connect.test. mysql-test/include/connect2.inc: Auxiliary routine to establish a connection reliably. --- mysql-test/t/connect.test | 80 ++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 46 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/connect.test b/mysql-test/t/connect.test index c8b69a050ba..0893bf9ad18 100644 --- a/mysql-test/t/connect.test +++ b/mysql-test/t/connect.test @@ -114,106 +114,94 @@ drop table t1; --echo # -- End of 4.1 tests --echo # ------------------------------------------------------------------ +########################################################################### + --echo --echo # -- Bug#33507: Event scheduler creates more threads than max_connections --echo # -- which results in user lockout. ---echo +--echo GRANT USAGE ON *.* TO mysqltest_u1@localhost; # NOTE: if the test case fails sporadically due to spurious connections, # consider disabling all users. --echo - let $saved_max_connections = `SELECT @@global.max_connections`; - SET GLOBAL max_connections = 3; SET GLOBAL event_scheduler = ON; --echo ---echo # -- Waiting for old connections to close... -let $wait_condition = - SELECT COUNT(*) = 1 - FROM information_schema.processlist - WHERE db = 'test'; ---source include/wait_condition.inc - ---echo +--echo # -- Waiting for Event Scheduler to start... let $wait_condition = SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE user = 'event_scheduler'; --source include/wait_condition.inc ---echo +--echo --echo # -- Disconnecting default connection... --disconnect default --echo --echo # -- Check that we allow exactly three user connections, no matter how --echo # -- many threads are running. ---echo +--echo --echo # -- Connecting (1)... ---connect (con_1,localhost,mysqltest_u1) +let $con_name = con_1; +let $con_user_name = mysqltest_u1; +--source include/connect2.inc --echo ---echo # -- Waiting for root connection to close... -let $wait_condition = - SELECT COUNT(*) = 1 - FROM information_schema.processlist - WHERE db = 'test'; ---source include/wait_condition.inc ---echo - --echo # -- Connecting (2)... ---connect (con_2,localhost,mysqltest_u1) +let $con_name = con_2; +let $con_user_name = mysqltest_u1; +--source include/connect2.inc +--echo --echo # -- Connecting (3)... ---connect (con_3,localhost,mysqltest_u1) - ---echo # -- Connecting (4)... ---disable_query_log ---error ER_CON_COUNT_ERROR ---connect (con_4,localhost,mysqltest_u1) ---enable_query_log +let $con_name = con_3; +let $con_user_name = mysqltest_u1; +--source include/connect2.inc --echo ---echo # -- Waiting for the last connection to close... -let $wait_condition = - SELECT COUNT(*) = 3 - FROM information_schema.processlist - WHERE db = 'test'; ---source include/wait_condition.inc +--echo # -- Connecting (4) [should fail]... +let $con_name = con_4; +let $con_user_name = mysqltest_u1; +let $wait_timeout = 5; +--source include/connect2.inc --echo --echo # -- Check that we allow one extra SUPER-user connection. ---echo +--echo --echo # -- Connecting super (1)... ---connect (con_super_1,localhost,root) +let $con_name = con_super_1; +let $con_user_name = root; +--source include/connect2.inc ---echo # -- Connecting super (2)... ---disable_query_log ---error ER_CON_COUNT_ERROR ---connect (con_super_2,localhost,root) ---enable_query_log +--echo +--echo # -- Connecting super (2) [should fail]... +let $con_name = con_super_2; +let $con_user_name = root; +let $wait_timeout = 5; +--source include/connect2.inc --echo -# Ensure that we have Event Scheduler thread, 3 ordinary user connections and -# one extra super-user connection. +--echo # -- Ensure that we have Event Scheduler thread, 3 ordinary user +--echo # -- connections and one extra super-user connection. SELECT user FROM information_schema.processlist ORDER BY id; --echo --echo # -- Resetting variables... - --eval SET GLOBAL max_connections = $saved_max_connections --echo --echo # -- Stopping Event Scheduler... SET GLOBAL event_scheduler = OFF; +--echo --echo # -- Waiting for Event Scheduler to stop... let $wait_condition = SELECT COUNT(*) = 0 -- cgit v1.2.1 From 166357b552fe777bc509ffcaeafeeeb5f0e3deed Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Mar 2008 16:11:26 +0100 Subject: Bug#35305: partition_symlink test failures Updated the test due to bug 32167 Corrected spelling of error message mysql-test/r/partition_not_windows.result: Updated test result due to test case changes and corrected spelling error mysql-test/r/partition_symlink.result: Bug#35305: partition_symlink test failure Updated test result due to test case changes mysql-test/r/symlink.result: Updated test result due to test case changes and corrected spelling error mysql-test/t/disabled.def: Bug#35305: partition_symlink test failure Enable the test after it has been fixed mysql-test/t/partition_not_windows.test: Removed disable/enable_query_log for better result files mysql-test/t/partition_symlink.test: Bug#35305: partition_symlink test failure Changes due to bug 32167 mysql-test/t/symlink.test: using replace_result instead of disable_query_log sql/partition_info.cc: corrected spelling sql/sql_parse.cc: corrected spelling --- mysql-test/t/disabled.def | 1 - mysql-test/t/partition_not_windows.test | 84 +++++++++++++++++++++++++-------- mysql-test/t/partition_symlink.test | 14 ++---- mysql-test/t/symlink.test | 27 +++++------ 4 files changed, 80 insertions(+), 46 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 2d73395cd18..9e0b681528b 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -21,4 +21,3 @@ ctype_create : Bug#32965 main.ctype_create fails status : Bug#32966 main.status fails ps_ddl : Bug#12093 2007-12-14 pending WL#4165 / WL#4166 csv_alter_table : Bug#33696 2008-01-21 pcrews no .result file - bug allows NULL columns in CSV tables -partition_symlink : Bug#35305 Make pushbuild green diff --git a/mysql-test/t/partition_not_windows.test b/mysql-test/t/partition_not_windows.test index 103fb05029e..d7108d5af98 100644 --- a/mysql-test/t/partition_not_windows.test +++ b/mysql-test/t/partition_not_windows.test @@ -11,13 +11,9 @@ # Bug 20770 Partitions: DATA DIRECTORY clause change in reorganize # doesn't remove old directory ---disable_query_log -eval SET @data_dir = 'DATA DIRECTORY = ''$MYSQLTEST_VARDIR/tmp'''; -let $data_directory = `select @data_dir`; +let $data_directory = DATA DIRECTORY = '$MYSQLTEST_VARDIR/tmp'; -eval SET @inx_dir = 'INDEX DIRECTORY = ''$MYSQLTEST_VARDIR/tmp'''; -let $inx_directory = `select @inx_dir`; ---enable_query_log +let $inx_directory = INDEX DIRECTORY = '$MYSQLTEST_VARDIR/tmp'; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval create table t1 (a int) engine myisam @@ -26,7 +22,7 @@ subpartition by hash (a) (partition p0 VALUES LESS THAN (1) $data_directory $inx_directory (SUBPARTITION subpart00, SUBPARTITION subpart01)); ---echo Checking if file exists before alter +--echo # Checking if file exists before alter --file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm --file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par --file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0#SP#subpart00.MYD @@ -45,7 +41,7 @@ eval ALTER TABLE t1 REORGANIZE PARTITION p0 INTO partition p2 VALUES LESS THAN (2) $data_directory $inx_directory (SUBPARTITION subpart20, SUBPARTITION subpart21)); ---echo Checking if file exists after alter +--echo # Checking if file exists after alter --file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm --file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par --file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1#SP#subpart10.MYD @@ -98,18 +94,18 @@ set @@sql_mode=@org_mode; # Bug#32167: another privilege bypass with DATA/INDEX DIRECTORY # --replace_result $MYSQLTEST_VARDIR TEST_DIR ---error 1210 +--error ER_WRONG_ARGUMENTS eval CREATE TABLE t1(a INT) PARTITION BY KEY (a) (PARTITION p0 DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'); --replace_result $MYSQLTEST_VARDIR TEST_DIR ---error 1210 +--error ER_WRONG_ARGUMENTS eval CREATE TABLE t1(a INT) PARTITION BY KEY (a) (PARTITION p0 INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'); --replace_result $MYSQLTEST_VARDIR TEST_DIR ---error 1210 +--error ER_WRONG_ARGUMENTS eval CREATE TABLE ts (id INT, purchased DATE) PARTITION BY RANGE(YEAR(purchased)) SUBPARTITION BY HASH(TO_DAYS(purchased)) ( @@ -121,7 +117,7 @@ SUBPARTITION s0b )); --replace_result $MYSQLTEST_VARDIR TEST_DIR ---error 1210 +--error ER_WRONG_ARGUMENTS eval CREATE TABLE ts (id INT, purchased DATE) PARTITION BY RANGE(YEAR(purchased)) SUBPARTITION BY HASH(TO_DAYS(purchased)) ( @@ -144,7 +140,59 @@ SUBPARTITION s0b DROP TABLE IF EXISTS `example`; --enable_warnings ---disable_abort_on_error +--mkdir $MYSQLTEST_VARDIR/p0Data +--mkdir $MYSQLTEST_VARDIR/p1Data +--mkdir $MYSQLTEST_VARDIR/p2Data +--mkdir $MYSQLTEST_VARDIR/p3Data +--mkdir $MYSQLTEST_VARDIR/p0Index +--mkdir $MYSQLTEST_VARDIR/p1Index +--mkdir $MYSQLTEST_VARDIR/p2Index +--mkdir $MYSQLTEST_VARDIR/p3Index +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval CREATE TABLE `example` ( + `ID_EXAMPLE` int(10) unsigned NOT NULL AUTO_INCREMENT, + `DESCRIPTION` varchar(30) NOT NULL, + `LEVEL` smallint(5) unsigned DEFAULT NULL, + PRIMARY KEY (`ID_EXAMPLE`) +) ENGINE = MYISAM +PARTITION BY HASH(ID_EXAMPLE)( +PARTITION p0 DATA DIRECTORY = '$MYSQLTEST_VARDIR/p0Data' +INDEX DIRECTORY = '$MYSQLTEST_VARDIR/p0Index', +PARTITION p1 DATA DIRECTORY = '$MYSQLTEST_VARDIR/p1Data' +INDEX DIRECTORY = '$MYSQLTEST_VARDIR/p1Index', +PARTITION p2 DATA DIRECTORY = '$MYSQLTEST_VARDIR/p2Data' +INDEX DIRECTORY = '$MYSQLTEST_VARDIR/p2Index', +PARTITION p3 DATA DIRECTORY = '$MYSQLTEST_VARDIR/p3Data' +INDEX DIRECTORY = '$MYSQLTEST_VARDIR/p3Index' +); +--echo # Checking that MyISAM .MYD and .MYI are in test db and data/idx dir +--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p0.MYI +--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p0.MYD +--file_exists $MYSQLTEST_VARDIR/p0Data/example#P#p0.MYD +--file_exists $MYSQLTEST_VARDIR/p0Index/example#P#p0.MYI +--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p1.MYI +--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p1.MYD +--file_exists $MYSQLTEST_VARDIR/p1Data/example#P#p1.MYD +--file_exists $MYSQLTEST_VARDIR/p1Index/example#P#p1.MYI +--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p2.MYI +--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p2.MYD +--file_exists $MYSQLTEST_VARDIR/p2Data/example#P#p2.MYD +--file_exists $MYSQLTEST_VARDIR/p2Index/example#P#p2.MYI +--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p3.MYI +--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p3.MYD +--file_exists $MYSQLTEST_VARDIR/p3Data/example#P#p3.MYD +--file_exists $MYSQLTEST_VARDIR/p3Index/example#P#p3.MYI +DROP TABLE example; +--rmdir $MYSQLTEST_VARDIR/p0Data +--rmdir $MYSQLTEST_VARDIR/p1Data +--rmdir $MYSQLTEST_VARDIR/p2Data +--rmdir $MYSQLTEST_VARDIR/p3Data +--rmdir $MYSQLTEST_VARDIR/p0Index +--rmdir $MYSQLTEST_VARDIR/p1Index +--rmdir $MYSQLTEST_VARDIR/p2Index +--rmdir $MYSQLTEST_VARDIR/p3Index + +--error ER_CANT_CREATE_TABLE,1 CREATE TABLE `example` ( `ID_EXAMPLE` int(10) unsigned NOT NULL AUTO_INCREMENT, `DESCRIPTION` varchar(30) NOT NULL, @@ -152,10 +200,8 @@ CREATE TABLE `example` ( PRIMARY KEY (`ID_EXAMPLE`) ) ENGINE = MYISAM PARTITION BY HASH(ID_EXAMPLE)( -PARTITION p0 DATA DIRECTORY = '/build/5.1/data/partitiontest/p0Data', -PARTITION p1 DATA DIRECTORY = '/build/5.1/data/partitiontest/p1Data', -PARTITION p2 DATA DIRECTORY = '/build/5.1/data/partitiontest/p2Data', -PARTITION p3 DATA DIRECTORY = '/build/5.1/data/partitiontest/p3Data' +PARTITION p0 DATA DIRECTORY = '/not/existent/p0Data', +PARTITION p1 DATA DIRECTORY = '/not/existent/p1Data', +PARTITION p2 DATA DIRECTORY = '/not/existent/p2Data', +PARTITION p3 DATA DIRECTORY = '/not/existent/p3Data' ); ---enable_abort_on_error - diff --git a/mysql-test/t/partition_symlink.test b/mysql-test/t/partition_symlink.test index dcb725b1cb6..e36e335c0dd 100644 --- a/mysql-test/t/partition_symlink.test +++ b/mysql-test/t/partition_symlink.test @@ -27,9 +27,6 @@ DROP DATABASE IF EXISTS mysqltest2; # directory or file that the mysqld-process can use, via DATA/INDEX DIR) # this is the security flaw that was used in bug#32091 and bug#32111 -#--exec mkdir $MYSQLTEST_VARDIR/tmp/test || true -#--exec mkdir $MYSQLTEST_VARDIR/tmp/mysqltest2 || true - -- echo # Creating two non colliding tables mysqltest2.t1 and test.t1 -- echo # test.t1 have partitions in mysqltest2-directory! -- echo # user root: @@ -125,22 +122,18 @@ connection default; DROP USER mysqltest_1@localhost; disconnect con1; -#--exec rmdir $MYSQLTEST_VARDIR/tmp/test || true -#--exec rmdir $MYSQLTEST_VARDIR/tmp/mysqltest2 || true - # # Bug #24633 SQL MODE "NO_DIR_IN_CREATE" does not work with partitioned tables # -disable_query_log; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval create table t2 (i int ) partition by range (i) ( partition p01 values less than (1000) - data directory="$MYSQLTEST_VARDIR/master-data/test/" - index directory="$MYSQLTEST_VARDIR/master-data/test/" + data directory="$MYSQLTEST_VARDIR/tmp" + index directory="$MYSQLTEST_VARDIR/tmp" ); -enable_query_log; set @org_mode=@@sql_mode; set @@sql_mode='NO_DIR_IN_CREATE'; @@ -153,6 +146,7 @@ partition by range (i) index directory='/not/existing' ); +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR show create table t2; DROP TABLE t1, t2; set @@sql_mode=@org_mode; diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test index 5802e65df1e..05d64f9104d 100644 --- a/mysql-test/t/symlink.test +++ b/mysql-test/t/symlink.test @@ -38,9 +38,8 @@ drop table t2; # We use t9 here to not crash with tables generated by the backup test # -disable_query_log; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval create table t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="$MYSQLTEST_VARDIR/tmp" index directory="$MYSQLTEST_VARDIR/run"; -enable_query_log; insert into t9 select * from t1; check table t9; @@ -66,7 +65,6 @@ drop table t1; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR SHOW CREATE TABLE t9; -disable_query_log; --error 1103,1103 create table t1 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="tmp"; @@ -81,13 +79,14 @@ create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, p create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="not-hard-path"; # Should fail becasue the file t9.MYI already exist in 'run' +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --error 1,1,1105 eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="$MYSQLTEST_VARDIR/run"; # Should fail becasue the file t9.MYD already exist in 'tmp' +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --error 1,1 eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="$MYSQLTEST_VARDIR/tmp"; -enable_query_log; # Check moving table t9 from default database to mysqltest; # In this case the symlinks should be removed. @@ -103,20 +102,17 @@ drop database mysqltest; # create table t1 (a int not null) engine=myisam; -disable_query_log; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval alter table t1 data directory="$MYSQLTEST_VARDIR/tmp"; -enable_query_log; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR show create table t1; alter table t1 add b int; -disable_query_log; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval alter table t1 data directory="$MYSQLTEST_VARDIR/log"; -enable_query_log; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR show create table t1; -disable_query_log; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval alter table t1 index directory="$MYSQLTEST_VARDIR/log"; -enable_query_log; show create table t1; drop table t1; @@ -125,8 +121,9 @@ drop table t1; # --write_file $MYSQLTEST_VARDIR/tmp/t1.MYI EOF ---replace_result $MYSQLTEST_VARDIR TEST_DIR ---error 1 + +--replace_result $MYSQLTEST_VARDIR TEST_DIR $MYSQLTEST_VARDIR TEST_DIR +--error 1,1 eval CREATE TABLE t1(a INT) DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY='$MYSQLTEST_VARDIR/tmp'; @@ -147,18 +144,16 @@ connect (session1,localhost,root,,); connect (session2,localhost,root,,); connection session1; -disable_query_log; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval create temporary table t1 (a int) engine=myisam data directory="$MYSQLTEST_VARDIR/log" select 9 a; -enable_query_log; # If running test suite with a non standard tmp dir, the "show create table" # will print "DATA_DIRECTORY=". Use replace_result to mask it out --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR show create table t1; connection session2; -disable_query_log; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval create temporary table t1 (a int) engine=myisam data directory="$MYSQLTEST_VARDIR/log" select 99 a; -enable_query_log; # If running test suite with a non standard tmp dir, the "show create table" # will print "DATA_DIRECTORY=". Use replace_result to mask it out --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -- cgit v1.2.1 From 6cf64b26d8eedae3e744335736aee44975899c19 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Mar 2008 20:19:04 +0200 Subject: Bug #18199 PURGE BINARY LOGS fails silently with missing logs; Bug #18453 Warning/error message if there is a mismatch between ... There were three problems: 1. the reported lack of warnings for the BEFORE syntax of PURGE; 2. the similar lack of warnings for the TO syntax; 3. incompatible behaviour between the two in that the latter blanked out regardlessly of presence or lack the actual file corresponding to an index record; the former version gave up at the first mismatch. fixed with deploying the warning's generation and synronizing logics of purge_logs() and purge_logs_before_date(). my_stat() is called in either of two branches of purge_logs() (responsible for the TO syntax of PURGE) similarly to how it has behaved in the BEFORE syntax. If there is no actual binlog file, my_stat returns NULL and my_delete is not invoked. A critical error is reported to the user if a file from the index could not be retrieved info about or deleted with a system error code different than ENOENT. sql/log.cc: generating warning in two functions. refining logics to call my_stat() by purge_logs() as it happens in purge_logs_before_date(). my_delete() is called only if my_stat() ensured existance of the file. A critical error is reported to the user if a file from the index could not be my_stat():ed or my_delete():d with an error different than ENOENT. sql/share/errmsg.txt: new error message mysql-test/include/show_binary_logs.inc: a new macro - shortcut of show binary logs mysql-test/r/binlog_index.result: new results mysql-test/t/binlog_index.test: a regression test for the bugs --- mysql-test/t/binlog_index.test | 69 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 mysql-test/t/binlog_index.test (limited to 'mysql-test/t') diff --git a/mysql-test/t/binlog_index.test b/mysql-test/t/binlog_index.test new file mode 100644 index 00000000000..1e44a9b02e2 --- /dev/null +++ b/mysql-test/t/binlog_index.test @@ -0,0 +1,69 @@ +# +# testing of purging of binary log files bug#18199/Bug#18453 +# +source include/have_log_bin.inc; +source include/not_embedded.inc; + +# +# testing purge binary logs TO +# + +flush logs; +flush logs; +flush logs; + +source include/show_binary_logs.inc; + +remove_file $MYSQLTEST_VARDIR/log/master-bin.000001; + +# there must be a warning with file names +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +purge binary logs TO 'master-bin.000004'; + +--echo *** must show a list starting from the 'TO' argument of PURGE *** +source include/show_binary_logs.inc; + +# +# testing purge binary logs BEFORE +# + +reset master; + +flush logs; +flush logs; +flush logs; +remove_file $MYSQLTEST_VARDIR/log/master-bin.000001; + +--echo *** must be a warning master-bin.000001 was not found *** +let $date=`select NOW() + INTERVAL 1 MINUTE`; +--disable_query_log +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval purge binary logs BEFORE '$date'; +--enable_query_log + +--echo *** must show one record, of the active binlog, left in the index file after PURGE *** +source include/show_binary_logs.inc; + +# +# testing a fatal error +# Turning a binlog file into a directory must be a portable setup +# + +reset master; + +flush logs; +flush logs; +flush logs; + +remove_file $MYSQLTEST_VARDIR/log/master-bin.000001; +mkdir $MYSQLTEST_VARDIR/log/master-bin.000001; + +--error ER_BINLOG_PURGE_FATAL_ERR +purge binary logs TO 'master-bin.000002'; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +show warnings; +rmdir $MYSQLTEST_VARDIR/log/master-bin.000001; +--disable_warnings +reset master; +--enable_warnings +--echo End of tests -- cgit v1.2.1 From 4018b13915c2fa972cf4da90ab1b2272b855a490 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Mar 2008 15:51:22 +0400 Subject: Bug #33334 mysqltest_embedded crashes when disconnecting before reap. Before breaking the connection we have to check that there's no query executing at the moment. Otherwise it can lead to crash in embedded server. client/mysqltest.c: Bug #33334 mysqltest_embedded crashes when disconnecting before reap. Wait until the query thread is finished before we break the connection. Waiting part moved to a separate wait_query_thread_end() function mysql-test/r/flush.result: Bug #33334 mysqltest_embedded crashes when disconnecting before reap. test result mysql-test/t/flush.test: Bug #33334 mysqltest_embedded crashes when disconnecting before reap. test case --- mysql-test/t/flush.test | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test index 72efa8a2ee6..4c6d4265600 100644 --- a/mysql-test/t/flush.test +++ b/mysql-test/t/flush.test @@ -164,4 +164,13 @@ drop table t1, t2; set session low_priority_updates=default; +# +# Bug #33334 mysqltest_embedded crashes when disconnecting before reap +# + +connect (con1,localhost,root,,); +send select benchmark(200, (select sin(1))) > 1000; +disconnect con1; +connection default; + # End of 5.0 tests -- cgit v1.2.1 From 3c5894baaa9dcc2d910d504ef073facfcd329f8e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Mar 2008 14:32:28 +0100 Subject: Bug#34529: Crash on complex Falcon I_S select after ALTER .. PARTITION BY When swapping out heap I_S tables to disk, this is done after plan refinement. Thus, READ_RECORD::file will still point to the (deleted) heap handler at start of execution. This causes segmentation fault if join buffering is used and the query is a star query where the result is found to be empty before accessing some table. In this case that table has not been initialized (i.e. had its READ_RECORD re-initialized) before the cleanup routine tries to close the handler. Fixed by updating READ_RECORD::file when changing handler. mysql-test/r/information_schema.result: Bug#34529: Test result. mysql-test/t/information_schema.test: Bug#34529: Test case. sql/sql_show.cc: Bug#34529: The fix. --- mysql-test/t/information_schema.test | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 3d3310e389e..09005a4b145 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -1118,3 +1118,24 @@ show fields from information_schema.table_names; --error 1109 show keys from information_schema.table_names; +# +# Bug#34529: Crash on complex Falcon I_S select after ALTER .. PARTITION BY +# +USE information_schema; +SET max_heap_table_size = 16384; + +CREATE TABLE test.t1( a INT ); + +# What we need to create here is a bit of a corner case: +# We need a star query with information_schema tables, where the first +# branch of the star join produces zero rows, so that reading of the +# second branch never happens. At the same time we have to make sure +# that data for at least the last table is swapped from MEMORY/HEAP to +# MyISAM. This and only this triggers the bug. +SELECT * +FROM tables ta +JOIN collations co ON ( co.collation_name = ta.table_catalog ) +JOIN character_sets cs ON ( cs.character_set_name = ta.table_catalog ); + +DROP TABLE test.t1; +SET max_heap_table_size = DEFAULT; -- cgit v1.2.1 From 5a6996dbcde4ca833f7936413cfa090cba060af5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Mar 2008 18:44:50 +0200 Subject: Bug #35178 INSERT_ID not written to binary log for inserts against BLACKHOLE backed tables binlogging of insert into a autoincrement blackhole table ignored an explicit set insert_id. Fixed with refining of the blackhole's insert method to call update_auto_increment() that prepares binlogging the insert query with the preceeding set insert_id. Note, as the engine does not store any actual data one has to explicitly provide to the server with the value of the autoincrement column via set insert_id. Otherwise binlogging will happend with the default set insert_id=1. mysql-test/r/blackhole.result: results changed mysql-test/t/blackhole.test: a regression test for the bug added sql/ha_blackhole.cc: blackhole's insert method is refined to call update_auto_increment() that prepares binlogging the insert query with the preceeding set insert_id. --- mysql-test/t/blackhole.test | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/blackhole.test b/mysql-test/t/blackhole.test index ba77b7b7f6a..cb8010d7967 100644 --- a/mysql-test/t/blackhole.test +++ b/mysql-test/t/blackhole.test @@ -142,7 +142,6 @@ CREATE TABLE t1(a INT) ENGINE=BLACKHOLE; INSERT DELAYED INTO t1 VALUES(1); DROP TABLE t1; -# End of 4.1 tests # #Bug#19717: DELETE Query Error on BLACKHOLE when using WHERE on column with UNIQUE INDEX @@ -159,4 +158,27 @@ ALTER TABLE t1 ADD PRIMARY KEY(a); DELETE FROM t1 WHERE a=10; DROP TABLE t1; -# End of 5.0 tests +# +# Bug#35178 INSERT_ID not written to binary log for inserts against BLACKHOLE backed tables +# +# +# the test checks that explicitly prescribed with set insert_id= value +# preceeds the following autoincrement insert in a blachhole +# + +reset master; +create table t1 (a int auto_increment, primary key (a)) engine=blackhole; + +# not insert_id prescribed insert binlogs with the default set insert_id 1 +insert into t1 values (11), (NULL), (NULL), (NULL); +set insert_id= 3; +insert into t1 values (NULL), (33), (NULL); +set insert_id= 5; +insert into t1 values (55), (NULL); +source include/show_binlog_events2.inc; + +# cleanup +drop table t1; + + +# End of tests -- cgit v1.2.1 From 1975532945bd1e719cf88e646907e22002635e51 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 Mar 2008 11:36:35 +0300 Subject: A test case for Bug#29958: Weird message on DROP DATABASE if mysql.proc does not exist. mysql-test/r/drop.result: Update result file. mysql-test/t/drop.test: Add a test case for Bug#29958: Weird message on DROP DATABASE if mysql.proc does not exist. --- mysql-test/t/drop.test | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/drop.test b/mysql-test/t/drop.test index a79044436eb..1668d2f3d09 100644 --- a/mysql-test/t/drop.test +++ b/mysql-test/t/drop.test @@ -134,4 +134,38 @@ drop table mysql_test.`#sql-347f_8`; copy_file $MYSQLTEST_VARDIR/master-data/mysql_test/t1.frm $MYSQLTEST_VARDIR/master-data/mysql_test/#sql-347f_6.frm; drop database mysql_test; +########################################################################### + +--echo +--echo # -- +--echo # -- Bug#29958: Weird message on DROP DATABASE if mysql.proc does not +--echo # -- exist. +--echo # -- + +--disable_warnings +DROP DATABASE IF EXISTS mysql_test; +--enable_warnings + +CREATE DATABASE mysql_test; + +--copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm $MYSQLTEST_VARDIR/master-data/mysql/backup.proc.frm +--copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD $MYSQLTEST_VARDIR/master-data/mysql/backup.proc.MYD +--copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI $MYSQLTEST_VARDIR/master-data/mysql/backup.proc.MYI + +DROP TABLE mysql.proc; + +DROP DATABASE mysql_test; + +--copy_file $MYSQLTEST_VARDIR/master-data/mysql/backup.proc.frm $MYSQLTEST_VARDIR/master-data/mysql/proc.frm +--copy_file $MYSQLTEST_VARDIR/master-data/mysql/backup.proc.MYD $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD +--copy_file $MYSQLTEST_VARDIR/master-data/mysql/backup.proc.MYI $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI + +--echo +--echo # -- +--echo # -- End of Bug#29958. +--echo # -- + +########################################################################### + +--echo --echo End of 5.1 tests -- cgit v1.2.1 From 8030bdfc16a647c15e0de5e07b5f53d263ef5ca2 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 Mar 2008 19:07:17 +0400 Subject: BUG#34788 - malformed federated connection url is not handled correctly - crashes server ! Creating federated table with connect string containing empty (zero-length) host name and port is evaluated as 0 (port is incorrect, omitted or 0) crashes server. This happens because federated calls strcmp() with NULL pointer. Fixed by avoiding strcmp() call if hostname is set to NULL. mysql-test/r/federated.result: A test case for BUG#34788. mysql-test/t/federated.test: A test case for BUG#34788. sql/ha_federated.cc: Fixed that parse_url() may call strcmp() with NULL pointer. --- mysql-test/t/federated.test | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index 934db5cd68b..f33dfa3a1b8 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -1738,4 +1738,11 @@ DROP TABLE t1; connection slave; DROP TABLE t1; +# +# BUG#34788 - malformed federated connection url is not handled correctly - +# crashes server ! +# +CREATE TABLE t1 (a INT) ENGINE=federated CONNECTION='mysql://@:://'; +DROP TABLE t1; + source include/federated_cleanup.inc; -- cgit v1.2.1 From 8eb0166801e33d9db1b17c25d4fabbde68ed4852 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Mar 2008 10:52:00 +0300 Subject: Fix tree. --- mysql-test/t/drop.test | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/drop.test b/mysql-test/t/drop.test index 1668d2f3d09..7c60c7daf69 100644 --- a/mysql-test/t/drop.test +++ b/mysql-test/t/drop.test @@ -148,17 +148,17 @@ DROP DATABASE IF EXISTS mysql_test; CREATE DATABASE mysql_test; ---copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm $MYSQLTEST_VARDIR/master-data/mysql/backup.proc.frm ---copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD $MYSQLTEST_VARDIR/master-data/mysql/backup.proc.MYD ---copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI $MYSQLTEST_VARDIR/master-data/mysql/backup.proc.MYI +--copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm $MYSQLTEST_VARDIR/tmp/bug29958.proc.frm +--copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYD +--copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYI DROP TABLE mysql.proc; DROP DATABASE mysql_test; ---copy_file $MYSQLTEST_VARDIR/master-data/mysql/backup.proc.frm $MYSQLTEST_VARDIR/master-data/mysql/proc.frm ---copy_file $MYSQLTEST_VARDIR/master-data/mysql/backup.proc.MYD $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD ---copy_file $MYSQLTEST_VARDIR/master-data/mysql/backup.proc.MYI $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI +--copy_file $MYSQLTEST_VARDIR/tmp/bug29958.proc.frm $MYSQLTEST_VARDIR/master-data/mysql/proc.frm +--copy_file $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYD $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD +--copy_file $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYI $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI --echo --echo # -- -- cgit v1.2.1 From 194e43ee68e9f1acb9d1ef380894c4fc4c27f22e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Mar 2008 12:08:04 -0600 Subject: Bug#8759 (Stored Procedures: SQLSTATE '00000' should be illegal) Fixed the parser to reject SQLSTATE '00000', since '00000' is the successful completion condition, and can not be caught by an exception handler in SQL. mysql-test/r/sp-error.result: Bug#8759 (Stored Procedures: SQLSTATE '00000' should be illegal) mysql-test/t/sp-error.test: Bug#8759 (Stored Procedures: SQLSTATE '00000' should be illegal) sql/sp_pcontext.cc: Bug#8759 (Stored Procedures: SQLSTATE '00000' should be illegal) --- mysql-test/t/sp-error.test | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index 23bce3805af..6896a1ab832 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -2386,6 +2386,32 @@ call p1(); call p1(); drop procedure p1; +# +# Bug#8759 (Stored Procedures: SQLSTATE '00000' should be illegal) +# + +--disable_warnings +drop procedure if exists proc_8759; +--enable_warnings + +delimiter $$; + +--error ER_SP_BAD_SQLSTATE +create procedure proc_8759() +begin + declare should_be_illegal condition for sqlstate '00000'; + declare continue handler for should_be_illegal set @x=0; +end$$ + +--error ER_SP_BAD_SQLSTATE +create procedure proc_8759() +begin + declare continue handler for sqlstate '00000' set @x=0; +end$$ + +delimiter ;$$ + + # # BUG#NNNN: New bug synopsis # -- cgit v1.2.1 From 28cd75fec42e327950056617c7dea8ae4d2f6395 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 22 Mar 2008 11:32:24 +0300 Subject: Fix for Bug#34274: Invalid handling of 'DEFAULT 0' for YEAR data type. The problem was that for some unknown reason 0 was not allowed as a default value for YEAR data type. That was coded before BK. However the Manual does not say a word about such a limitation. Also, it looks inconsistent with other data types. The fix is to allow 0 as a default value. mysql-test/r/create.result: Update result file. mysql-test/t/create.test: Add a test case for Bug#34274: Invalid handling of 'DEFAULT 0' for YEAR data type. sql/unireg.cc: Allow 0 as a default value for YEAR data type. --- mysql-test/t/create.test | 50 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 28ae38d943a..9cf38742289 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -1365,6 +1365,8 @@ create table t1 like information_schema.character_sets; show create table t1; drop table t1; +########################################################################### + --echo --echo # -- --echo # -- Bug#21380: DEFAULT definition not always transfered by CREATE @@ -1407,8 +1409,10 @@ DROP TABLE t2; --echo --echo # -- End of test case for Bug#21380. ---echo +########################################################################### + +--echo --echo # -- --echo # -- Bug#18834: ALTER TABLE ADD INDEX on table with two timestamp fields --echo # -- @@ -1471,6 +1475,50 @@ DROP TABLE t3; --echo --echo # -- End of Bug#18834. + +########################################################################### + +--echo +--echo # -- +--echo # -- Bug#34274: Invalid handling of 'DEFAULT 0' for YEAR data type. +--echo # -- +--echo + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--echo +CREATE TABLE t1(c1 YEAR DEFAULT 2008, c2 YEAR DEFAULT 0); + +--echo +SHOW CREATE TABLE t1; + +--echo +INSERT INTO t1 VALUES(); + +--echo +SELECT * FROM t1; + +--echo +ALTER TABLE t1 MODIFY c1 YEAR DEFAULT 0; + +--echo +SHOW CREATE TABLE t1; + --echo +INSERT INTO t1 VALUES(); +--echo +SELECT * FROM t1; + +--echo +DROP TABLE t1; + +--echo +--echo # -- End of Bug#34274 + +########################################################################### + +--echo --echo End of 5.1 tests -- cgit v1.2.1 From 5ad505dda2d8ae019f6abfbf6eb9091cea1a5c55 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Mar 2008 12:47:57 +0400 Subject: BUG#35509 - Federated leaks memory when connecting to localhost/default port When creating federated table that points to unspecified host or localhost on unspecified port or port is 0, small memory leak occurs. This happens because we make a copy of unix socket path, which is never freed. With this fix we do not make a copy of unix socket path, instead share->socket points to MYSQL_UNIX_ADDR constant directly. This fix is covered by a test case for BUG34788. Affects 5.0 only. mysql-test/t/federated.test: A test case for BUG#35509. sql/ha_federated.cc: When creating federated table we call parse_url() to check if connect string is correct. parse_url() may make a copy of unix socket path if port is not specified or 0 and host is not specified or 'localhost'. This copy is never freed. As there is no need to make a copy of unix socket path, let share->socket point to MYSQL_UNIX_ADDR directly. --- mysql-test/t/federated.test | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index f33dfa3a1b8..9e7548a21ed 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -1742,6 +1742,11 @@ DROP TABLE t1; # BUG#34788 - malformed federated connection url is not handled correctly - # crashes server ! # +# also tests +# +# BUG#35509 - Federated leaks memory when connecting to localhost/default +# port +# CREATE TABLE t1 (a INT) ENGINE=federated CONNECTION='mysql://@:://'; DROP TABLE t1; -- cgit v1.2.1 From 811fb145eaf694485395934c81c7576a000e2cc7 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Mar 2008 17:37:53 +0400 Subject: BUG#34789 - drop server/create server leaks memory ! BUG#34790 - 'create server' doesn't handle out of memory scenario well enough This is an addition to fixes for these bugs, which makes gcov happy. mysql-test/r/federated.result: CREATE SERVER is only tested by federated_server.test, which requires big-test option. Added dummy test case to make gcov happy. mysql-test/t/federated.test: CREATE SERVER is only tested by federated_server.test, which requires big-test option. Added dummy test case to make gcov happy. sql/sql_parse.cc: Make gcov happy. --- mysql-test/t/federated.test | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index 0fd2290d619..6540cf8648e 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -1823,5 +1823,11 @@ DROP TABLE t1; CREATE TABLE t1 (a INT) ENGINE=federated CONNECTION='mysql://@:://'; DROP TABLE t1; +# +# Coverage testing of CREATE SERVER. +# +create server 's1' foreign data wrapper 'mysql' options (port 3306); +drop server 's1'; + --echo End of 5.1 tests source include/federated_cleanup.inc; -- cgit v1.2.1 From d62c9e33ca09125a66f226bf7817dc466a547e91 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Mar 2008 19:44:27 +0400 Subject: information_schema.test, information_schema.result: Minor test case cleanup after bug#34529. mysql-test/r/information_schema.result: Minor test case cleanup after bug#34529. mysql-test/t/information_schema.test: Minor test case cleanup after bug#34529. --- mysql-test/t/information_schema.test | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 09005a4b145..caf38945cbc 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -1108,8 +1108,6 @@ select * from `information_schema`.`TRIGGERS` where `EVENT_OBJECT_TABLE` = NULL; select * from `information_schema`.`VIEWS` where `TABLE_SCHEMA` = NULL; select * from `information_schema`.`VIEWS` where `TABLE_NAME` = NULL; ---echo End of 5.0 tests. - # # Bug#30079 A check for "hidden" I_S tables is flawed # @@ -1139,3 +1137,7 @@ JOIN character_sets cs ON ( cs.character_set_name = ta.table_catalog ); DROP TABLE test.t1; SET max_heap_table_size = DEFAULT; +USE test; + +--echo End of 5.0 tests. + -- cgit v1.2.1 From 18801aa8298bfe20a397ec36dd3d72fda694fece Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Mar 2008 11:20:11 -0600 Subject: Bug#20906 (Multiple assignments in SET in stored routine produce incorrect instructions) This bug can not be reproduced in the current version, adding the test case to the test suite for coverage, no code change. mysql-test/r/sp-code.result: Bug#20906 (Multiple assignments in SET in stored routine produce incorrect instructions) mysql-test/t/sp-code.test: Bug#20906 (Multiple assignments in SET in stored routine produce incorrect instructions) --- mysql-test/t/sp-code.test | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/sp-code.test b/mysql-test/t/sp-code.test index 751282c895a..a76863dd5fa 100644 --- a/mysql-test/t/sp-code.test +++ b/mysql-test/t/sp-code.test @@ -598,4 +598,36 @@ show procedure code proc_33618_c; drop procedure proc_33618_h; drop procedure proc_33618_c; +# +# Bug#20906 (Multiple assignments in SET in stored routine produce incorrect +# instructions) +# + +--disable_warnings +drop procedure if exists p_20906_a; +drop procedure if exists p_20906_b; +--enable_warnings + +create procedure p_20906_a() SET @a=@a+1, @b=@b+1; +show procedure code p_20906_a; + +set @a=1; +set @b=1; + +call p_20906_a(); +select @a, @b; + +create procedure p_20906_b() SET @a=@a+1, @b=@b+1, @c=@c+1; +show procedure code p_20906_b; + +set @a=1; +set @b=1; +set @c=1; + +call p_20906_b(); +select @a, @b, @c; + +drop procedure p_20906_a; +drop procedure p_20906_b; + --echo End of 5.0 tests. -- cgit v1.2.1 From c3641cd5136f7bb0b79475b0bcb0b97f20150e14 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Mar 2008 15:53:57 -0300 Subject: Bug#35272: @@global.key_buffer_size = 4294967295 let the server crash When trying to get the requested amount of memory for the keybuffer, the out of memory could be signaled if one of the tentative allocations fail. Later the server would crash (debug assert) when trying to send a ok packet with a error set. The solution is only to signal the error if all tentative allocations for the keybuffer fail. mysql-test/r/key_cache.result: Add test case result for Bug#35272 mysql-test/t/key_cache.test: Add test case for Bug#35272 mysys/mf_keycache.c: Don't set error on my_large_malloc if allocation fails. Set the error if all tentative allocations failed. --- mysql-test/t/key_cache.test | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test index 4c14dc96aaa..f588a964584 100644 --- a/mysql-test/t/key_cache.test +++ b/mysql-test/t/key_cache.test @@ -247,3 +247,28 @@ SET GLOBAL key_cache_block_size= @bug28478_key_cache_block_size; DROP TABLE t1; # End of 4.1 tests + +# +# Bug#35272: @@global.key_buffer_size = 4294967295 let the server crash +# + +SET @save_key_buffer = @@global.key_buffer_size; + +# Wee try to force Out Of Memory here. key_buffer_size is ULL, so +# on a 32 bit machine, 4GB is the most we can ask for before the +# server complains about value/variable mismatch. At the off chance +# of one of our 64-bit machines actually offering us 4GB, we also +# accept "no error" (in addition to the expected "out of memory"). +--error 0,ER_OUTOFMEMORY +SET @@global.key_buffer_size = 4294967295; + +# on 32-bit, we get "out of range", on 64-bit, "out of memory". +--error 0,ER_WRONG_ARGUMENTS,ER_OUTOFMEMORY +--disable_warnings +SET @@global.key_buffer_size = 9223372036854775807; +--enable_warnings + +# restore normal value, just in case we got the 4GB or something. +SET @@global.key_buffer_size = @save_key_buffer; + +--echo End of 5.1 tests -- cgit v1.2.1 From b4b72fb306a1f816c0a39fe4a1eb70fa894ed70b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 26 Mar 2008 19:37:36 +0300 Subject: Fix for bug #34928: Confusion by having Primary Key and Index The bug is a regression introduced in 5.1 by the patch for bug28404. Under some circumstances test_if_skip_sort_order() could leave some data structures in an inconsistent state so that some parts of code could assume the selected execution strategy for GROUP BY/DISTINCT as a loose index scan (e.g. JOIN_TAB::is_using_loose_index_scan()), while the actual strategy chosen was an ordered index scan, which led to wrong data being returned. Fixed test_if_skip_sort_order() so that when changing the type for a join table, select->quick is reset not only for EXPLAIN, but for the actual join execution as well, to not confuse code that depends on its value to determine the chosen GROUP BY/DISTINCT strategy. mysql-test/r/distinct.result: Added a test case for bug #34928. mysql-test/t/distinct.test: Added a test case for bug #34928. sql/sql_select.cc: When changing the table's join type to JT_NEXT in test_if_skip_sort_order(), also reset select->quick because other code may depend on its value to determine the GROUP BY/DISTINCT execution strategy. --- mysql-test/t/distinct.test | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test index bfdb5f8b9f8..559dde44b81 100644 --- a/mysql-test/t/distinct.test +++ b/mysql-test/t/distinct.test @@ -553,3 +553,26 @@ SELECT DISTINCT a, a, b FROM t1; DROP TABLE t1; --echo End of 5.0 tests + +# +# Bug #34928: Confusion by having Primary Key and Index +# +CREATE TABLE t1(a INT, b INT, c INT, d INT, e INT, + PRIMARY KEY(a,b,c,d,e), + KEY(a,b,d,c) +); + +INSERT INTO t1(a, b, c) VALUES (1, 1, 1), + (1, 1, 2), + (1, 1, 3), + (1, 2, 1), + (1, 2, 2), + (1, 2, 3); + +EXPLAIN SELECT DISTINCT a, b, d, c FROM t1; + +SELECT DISTINCT a, b, d, c FROM t1; + +DROP TABLE t1; + +--echo End of 5.1 tests -- cgit v1.2.1 From 0b8342ba4e3c0426569f3256a8d951e168a7d52d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 26 Mar 2008 22:43:12 +0400 Subject: Fixed bug #35193. View definition as SELECT ... FROM DUAL WHERE ... has valid syntax, but use of such view in SELECT or SHOW CREATE VIEW syntax causes unexpected syntax error. Server omits FROM DUAL clause when storing view body string in a .frm file for further evaluation. However, syntax of SELECT-witout-FROM query is more restrictive than SELECT FROM DUAL syntax, and doesn't allow the WHERE clause. NOTE: this syntax difference is not documented. View registration procedure has been modified to preserve original structure of view's body. mysql-test/r/view.result: Added test case for bug #35193. mysql-test/t/view.test: Added test case for bug #35193. sql/sql_select.cc: Fixed bug #35193. The st_select_lex::print function always omits FROM DUAL clause, even if original SELECT query has the WHERE clause. The mysql_register_view function uses this function to reconstruct a body of view's AS clause for further evaluation and stores that reconstructed clause in a .frm file. SELECT without FROM syntax is more restrictive than SELECT FROM DUAL syntax: second one allows the WHERE clause, but first one is not. Use of this view in SELECT or SHOW CREATE VIEW queries causes unexpected syntax errors. The st_select_lex::print function has been modified to reconstruct FROM DUAL clause in queries when needed. TODO: Syntax difference is not documented and should be eliminated, however improvement of the SELECT-without-FROM syntax is not trivial and leads to significant modification of grammar file because of additional shift/reduce conflicts. --- mysql-test/t/view.test | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 23e64b0546f..9fa981ccb9a 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -3537,6 +3537,29 @@ DROP TABLE t1; ########################################################################### +--echo # ----------------------------------------------------------------- +--echo # -- Bug#35193: VIEW query is rewritten without "FROM DUAL", +--echo # -- causing syntax error +--echo # ----------------------------------------------------------------- +--echo + +CREATE VIEW v1 AS SELECT 1 FROM DUAL WHERE 1; + +--echo + +SELECT * FROM v1; +SHOW CREATE TABLE v1; + +--echo + +DROP VIEW v1; + +--echo +--echo # -- End of test case for Bug#35193. +--echo + +########################################################################### + --echo # ----------------------------------------------------------------- --echo # -- End of 5.0 tests. --echo # ----------------------------------------------------------------- -- cgit v1.2.1 From 9aaab69ab104a9c6d72a66d2de66833f36e6042e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 27 Mar 2008 02:40:45 +0100 Subject: Apply innodb-5.1-ss2360 snapshot Fixes: - Bug #34920: auto_increment resets to 1 on foreign key creation We need to use/inherit the passed in autoinc counter for ALTER TABLE statements too. mysql-test/r/innodb.result: Apply innodb-5.1-ss2360 snapshot Revision r2345: branches/5.1: Fix Bug# 34920. We need to use/inherit the passed in autoinc counter for ALTER TABLE statements too. mysql-test/t/innodb.test: Apply innodb-5.1-ss2360 snapshot Revision r2345: branches/5.1: Fix Bug# 34920. We need to use/inherit the passed in autoinc counter for ALTER TABLE statements too. storage/innobase/dict/dict0dict.c: Apply innodb-5.1-ss2360 snapshot Revision r2353: branches/5.1: Change the InnoDB autoinc type to ulint64. For this added a new typedef to univ.i (ib_ulonglong). Added checks for overflow and removed the assertion where it crashed previously, since the type has now changed to unsigned, it doesn't make sense to check for < 0. Added new tests, to check for overflow, for the different INT types supported for both signed and unsigned. storage/innobase/handler/ha_innodb.cc: Apply innodb-5.1-ss2360 snapshot Revision r2353: branches/5.1: Change the InnoDB autoinc type to ulint64. For this added a new typedef to univ.i (ib_ulonglong). Added checks for overflow and removed the assertion where it crashed previously, since the type has now changed to unsigned, it doesn't make sense to check for < 0. Added new tests, to check for overflow, for the different INT types supported for both signed and unsigned. Revision r2345: branches/5.1: Fix Bug# 34920. We need to use/inherit the passed in autoinc counter for ALTER TABLE statements too. storage/innobase/handler/ha_innodb.h: Apply innodb-5.1-ss2360 snapshot Revision r2353: branches/5.1: Change the InnoDB autoinc type to ulint64. For this added a new typedef to univ.i (ib_ulonglong). Added checks for overflow and removed the assertion where it crashed previously, since the type has now changed to unsigned, it doesn't make sense to check for < 0. Added new tests, to check for overflow, for the different INT types supported for both signed and unsigned. storage/innobase/include/dict0dict.h: Apply innodb-5.1-ss2360 snapshot Revision r2353: branches/5.1: Change the InnoDB autoinc type to ulint64. For this added a new typedef to univ.i (ib_ulonglong). Added checks for overflow and removed the assertion where it crashed previously, since the type has now changed to unsigned, it doesn't make sense to check for < 0. Added new tests, to check for overflow, for the different INT types supported for both signed and unsigned. storage/innobase/include/dict0mem.h: Apply innodb-5.1-ss2360 snapshot Revision r2353: branches/5.1: Change the InnoDB autoinc type to ulint64. For this added a new typedef to univ.i (ib_ulonglong). Added checks for overflow and removed the assertion where it crashed previously, since the type has now changed to unsigned, it doesn't make sense to check for < 0. Added new tests, to check for overflow, for the different INT types supported for both signed and unsigned. storage/innobase/include/row0sel.h: Apply innodb-5.1-ss2360 snapshot Revision r2353: branches/5.1: Change the InnoDB autoinc type to ulint64. For this added a new typedef to univ.i (ib_ulonglong). Added checks for overflow and removed the assertion where it crashed previously, since the type has now changed to unsigned, it doesn't make sense to check for < 0. Added new tests, to check for overflow, for the different INT types supported for both signed and unsigned. storage/innobase/include/univ.i: Apply innodb-5.1-ss2360 snapshot Revision r2353: branches/5.1: Change the InnoDB autoinc type to ulint64. For this added a new typedef to univ.i (ib_ulonglong). Added checks for overflow and removed the assertion where it crashed previously, since the type has now changed to unsigned, it doesn't make sense to check for < 0. Added new tests, to check for overflow, for the different INT types supported for both signed and unsigned. storage/innobase/row/row0sel.c: Apply innodb-5.1-ss2360 snapshot Revision r2353: branches/5.1: Change the InnoDB autoinc type to ulint64. For this added a new typedef to univ.i (ib_ulonglong). Added checks for overflow and removed the assertion where it crashed previously, since the type has now changed to unsigned, it doesn't make sense to check for < 0. Added new tests, to check for overflow, for the different INT types supported for both signed and unsigned. --- mysql-test/t/innodb.test | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 54d4ca94f84..d7c5f00564d 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -2436,6 +2436,29 @@ select table_comment, data_free > 0 as data_free_is_set where table_schema='test' and table_name = 't1'; drop table t1; +# +# Bug 34920 test +# +CONNECTION default; +CREATE TABLE t1 ( + c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + c2 VARCHAR(128) NOT NULL, + PRIMARY KEY(c1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=100; + +CREATE TABLE t2 ( + c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + c2 INT(10) UNSIGNED DEFAULT NULL, + PRIMARY KEY(c1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=200; + +SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2'; +ALTER TABLE t2 ADD CONSTRAINT t1_t2_1 FOREIGN KEY(c1) REFERENCES t1(c1); +SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2'; +DROP TABLE t2; +DROP TABLE t1; +# End 34920 test + ####################################################################### # # # Please, DO NOT TOUCH this file as well as the innodb.result file. # -- cgit v1.2.1 From 4020e6a2d7910be74c0f22e884c6f4ee8ba7865b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 27 Mar 2008 13:42:34 +0800 Subject: post fix after push of BUG#33029 mysql-test/r/binlog_killed_simulate.result: Update test result after push of bug#33029 mysql-test/r/mix_innodb_myisam_binlog.result: Update test result after push of bug#33029 mysql-test/r/multi_update.result: Update test result after push of bug#33029 mysql-test/r/rpl_auto_increment_bug33029.result: disable warning messages mysql-test/r/rpl_user.result: Update test result after push of bug#33029 mysql-test/t/rpl_auto_increment_bug33029.test: disable warning messages --- mysql-test/t/rpl_auto_increment_bug33029.test | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/rpl_auto_increment_bug33029.test b/mysql-test/t/rpl_auto_increment_bug33029.test index a4f716d8411..db548945c7f 100644 --- a/mysql-test/t/rpl_auto_increment_bug33029.test +++ b/mysql-test/t/rpl_auto_increment_bug33029.test @@ -99,9 +99,11 @@ SELECT * FROM t2; # clean up connection master; +disable_warnings; DROP TABLE IF EXISTS t1, t2; DROP PROCEDURE IF EXISTS p1; DROP PROCEDURE IF EXISTS p2; DROP FUNCTION IF EXISTS f1; DROP TRIGGER IF EXISTS tr1; +enable_warnings; sync_slave_with_master; -- cgit v1.2.1 From f8653a79e96dc1e553b5c73b733a34fef343e15b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 27 Mar 2008 09:37:20 -0300 Subject: Patch clean up. Fixed interference between tests: Users were added but not properly removed. This caused later tests to fail. mysql-test/r/grant.result: Fixed interference between tests: Users were added but not properly removed. This caused later tests to fail. mysql-test/t/grant.test: Fixed interference between tests: Users were added but not properly removed. This caused later tests to fail. --- mysql-test/t/grant.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 43548094a33..e4b95502143 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -1169,8 +1169,8 @@ begin end| delimiter ;| create view v1 as select test.* from test where test.col1=test_function(); -grant update (col1) on v1 to 'greg'; -revoke all privileges on v1 from 'greg'; +grant update (col1) on v1 to 'greg'@'localhost'; +drop user 'greg'@'localhost'; drop view v1; drop table test; drop function test_function; -- cgit v1.2.1 From f6013e63b8d286a5f29cd4973c7bfe9ca4053fe8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 27 Mar 2008 17:43:17 +0100 Subject: Bug#35272: @@global.key_buffer_size = 4294967295 let the server crash reverting test that has been obsoleted by changes to the code mysql-test/r/key_cache.result: reverting test that has been obsoleted by changes to the code mysql-test/t/key_cache.test: reverting test that has been obsoleted by changes to the code --- mysql-test/t/key_cache.test | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test index f588a964584..4c14dc96aaa 100644 --- a/mysql-test/t/key_cache.test +++ b/mysql-test/t/key_cache.test @@ -247,28 +247,3 @@ SET GLOBAL key_cache_block_size= @bug28478_key_cache_block_size; DROP TABLE t1; # End of 4.1 tests - -# -# Bug#35272: @@global.key_buffer_size = 4294967295 let the server crash -# - -SET @save_key_buffer = @@global.key_buffer_size; - -# Wee try to force Out Of Memory here. key_buffer_size is ULL, so -# on a 32 bit machine, 4GB is the most we can ask for before the -# server complains about value/variable mismatch. At the off chance -# of one of our 64-bit machines actually offering us 4GB, we also -# accept "no error" (in addition to the expected "out of memory"). ---error 0,ER_OUTOFMEMORY -SET @@global.key_buffer_size = 4294967295; - -# on 32-bit, we get "out of range", on 64-bit, "out of memory". ---error 0,ER_WRONG_ARGUMENTS,ER_OUTOFMEMORY ---disable_warnings -SET @@global.key_buffer_size = 9223372036854775807; ---enable_warnings - -# restore normal value, just in case we got the 4GB or something. -SET @@global.key_buffer_size = @save_key_buffer; - ---echo End of 5.1 tests -- cgit v1.2.1 From 9d661efd7f85b4208b9220434a0d5b5f21ac5070 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 27 Mar 2008 19:49:32 +0300 Subject: Bug#27219: Aggregate functions in ORDER BY. Mixing aggregate functions and non-grouping columns is not allowed in the ONLY_FULL_GROUP_BY mode. However in some cases the error wasn't thrown because of insufficient check. In order to check more thoroughly the new algorithm employs a list of outer fields used in a sum function and a SELECT_LEX::full_group_by_flag. Each non-outer field checked to find out whether it's aggregated or not and the current select is marked accordingly. All outer fields that are used under an aggregate function are added to the Item_sum::outer_fields list and later checked by the Item_sum::check_sum_func function. mysql-test/t/group_by.test: Added a test case for the bug#27219: Aggregate functions in ORDER BY. mysql-test/r/group_by.result: Added a test case for the bug#27219: Aggregate functions in ORDER BY. sql/sql_select.cc: Bug#27219: Aggregate functions in ORDER BY. Implementation of new check for mixing non aggregated fields and aggregation function in the ONLY_FULL_GROUP_BY mode. sql/sql_lex.cc: Bug#27219: Aggregate functions in ORDER BY. Initialization of the full_group_by_flag bitmap. SELECT_LEX::test_limit function doesn't reset ORDER BY clause anymore. sql/sql_lex.h: Bug#27219: Aggregate functions in ORDER BY. The full_group_by_flag is added to the SELECT_LEX class. sql/item_sum.h: Bug#27219: Aggregate functions in ORDER BY. The outer_fields list is added to the Item_sum class. sql/mysql_priv.h: Bug#27219: Aggregate functions in ORDER BY. Defined a set of constants used in the new check for mixing non aggregated fields and sum functions in the ONLY_FULL_GROUP_BY_MODE. sql/item_subselect.cc: Bug#27219: Aggregate functions in ORDER BY. The Item_in_subselect::select_in_like_transformer function now drops ORDER BY clause in all selects in a subquery. sql/item_sum.cc: Bug#27219: Aggregate functions in ORDER BY. Now the Item_sum::check_sum_func function now checks whether fields in the outer_fields list are aggregated or not and marks selects accordingly. sql/item.cc: Bug#27219: Aggregate functions in ORDER BY. Now the Item_field::fix_fields function checks whether the field is aggregated or not and marks its select_lex accordingly. --- mysql-test/t/group_by.test | 117 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 636544f7854..82bb8a45faa 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -893,4 +893,121 @@ FROM t1; DROP TABLE t1; SET @@sql_mode = @old_sql_mode; +--echo # +--echo # Bug#27219: Aggregate functions in ORDER BY. +--echo # +SET @save_sql_mode=@@sql_mode; +SET @@sql_mode='ONLY_FULL_GROUP_BY'; + +CREATE TABLE t1 (a INT, b INT, c INT DEFAULT 0); +INSERT INTO t1 (a, b) VALUES (3,3), (2,2), (3,3), (2,2), (3,3), (4,4); +CREATE TABLE t2 SELECT * FROM t1; + +SELECT 1 FROM t1 ORDER BY COUNT(*); +SELECT 1 FROM t1 ORDER BY COUNT(*) + 1; +--error 1140 +SELECT 1 FROM t1 ORDER BY COUNT(*) + a; +SELECT 1 FROM t1 ORDER BY COUNT(*), 1; +--error 1140 +SELECT 1 FROM t1 ORDER BY COUNT(*), a; + +SELECT 1 FROM t1 ORDER BY SUM(a); +SELECT 1 FROM t1 ORDER BY SUM(a + 1); +SELECT 1 FROM t1 ORDER BY SUM(a) + 1; +--error 1140 +SELECT 1 FROM t1 ORDER BY SUM(a), b; + +--error 1140 +SELECT a FROM t1 ORDER BY COUNT(b); + +SELECT t1.a FROM t1 ORDER BY (SELECT SUM(t2.a) FROM t2); + +--error 1140 +SELECT t1.a FROM t1 ORDER BY (SELECT SUM(t2.a), t2.a FROM t2); +--error 1140 +SELECT t1.a FROM t1 ORDER BY (SELECT SUM(t2.a) FROM t2 ORDER BY t2.a); +--error 1140 +SELECT t1.a FROM t1 ORDER BY (SELECT t2.a FROM t2 ORDER BY SUM(t2.b) LIMIT 1); + +--error 1140 +SELECT t1.a FROM t1 + WHERE t1.a = (SELECT t2.a FROM t2 ORDER BY SUM(t2.b) LIMIT 1); +--error 1140 +SELECT t1.a FROM t1 GROUP BY t1.a + HAVING t1.a = (SELECT t2.a FROM t2 ORDER BY SUM(t2.a) LIMIT 1); + +SELECT t1.a FROM t1 GROUP BY t1.a + HAVING t1.a IN (SELECT t2.a FROM t2 ORDER BY SUM(t1.b)); +--error 1140 +SELECT t1.a FROM t1 GROUP BY t1.a + HAVING t1.a IN (SELECT t2.a FROM t2 ORDER BY t2.a, SUM(t2.b)); +--error 1140 +SELECT t1.a FROM t1 GROUP BY t1.a + HAVING t1.a > ANY (SELECT t2.a FROM t2 ORDER BY t2.a, SUM(t2.b)); + +--error 1140 +SELECT t1.a FROM t1 + WHERE t1.a = (SELECT t2.a FROM t2 ORDER BY SUM(t1.b)); + +SELECT 1 FROM t1 GROUP BY t1.a + HAVING (SELECT AVG(SUM(t1.b) + 1) FROM t2 ORDER BY SUM(t2.a) LIMIT 1); +SELECT 1 FROM t1 GROUP BY t1.a + HAVING (SELECT AVG(SUM(t1.b) + t2.b) FROM t2 ORDER BY SUM(t2.a) LIMIT 1); +SELECT 1 FROM t1 GROUP BY t1.a + HAVING (SELECT AVG(t1.b + t2.b) FROM t2 ORDER BY SUM(t2.a) LIMIT 1); + +--error 1140 +SELECT 1 FROM t1 GROUP BY t1.a + HAVING (SELECT AVG(SUM(t1.b) + 1) FROM t2 ORDER BY t2.a LIMIT 1); +--error 1140 +SELECT 1 FROM t1 GROUP BY t1.a + HAVING (SELECT AVG(SUM(t1.b) + t2.b) FROM t2 ORDER BY t2.a LIMIT 1); +--error 1140 +SELECT 1 FROM t1 GROUP BY t1.a + HAVING (SELECT AVG(t1.b + t2.b) FROM t2 ORDER BY t2.a LIMIT 1); + +# Both SUMs are aggregated in the subquery, no mixture: +SELECT t1.a FROM t1 + WHERE t1.a = (SELECT t2.a FROM t2 GROUP BY t2.a + ORDER BY SUM(t2.b), SUM(t1.b) LIMIT 1); + +# SUM(t1.b) is aggregated in the subquery, no mixture: +SELECT t1.a, SUM(t1.b) FROM t1 + WHERE t1.a = (SELECT SUM(t2.b) FROM t2 GROUP BY t2.a + ORDER BY SUM(t2.b), SUM(t1.b) LIMIT 1) + GROUP BY t1.a; + +# 2nd SUM(t1.b) is aggregated in the subquery, no mixture: +SELECT t1.a, SUM(t1.b) FROM t1 + WHERE t1.a = (SELECT SUM(t2.b) FROM t2 + ORDER BY SUM(t2.b) + SUM(t1.b) LIMIT 1) + GROUP BY t1.a; + +# SUM(t2.b + t1.a) is aggregated in the subquery, no mixture: +SELECT t1.a, SUM(t1.b) FROM t1 + WHERE t1.a = (SELECT SUM(t2.b) FROM t2 + ORDER BY SUM(t2.b + t1.a) LIMIT 1) + GROUP BY t1.a; + +SELECT t1.a FROM t1 GROUP BY t1.a + HAVING (1, 1) = (SELECT SUM(t1.a), t1.a FROM t2 LIMIT 1); + +select avg ( + (select + (select sum(outr.a + innr.a) from t1 as innr limit 1) as tt + from t1 as outr order by outr.a limit 1)) +from t1 as most_outer; + +--error 1140 +select avg ( + (select ( + (select sum(outr.a + innr.a) from t1 as innr limit 1)) as tt + from t1 as outr order by count(outr.a) limit 1)) as tt +from t1 as most_outer; + +select (select sum(outr.a + t1.a) from t1 limit 1) as tt from t1 as outr order by outr.a; + +SET sql_mode=@save_sql_mode; +DROP TABLE t1, t2; + --echo End of 5.0 tests -- cgit v1.2.1 From 77fbeeab2464d5f035a7393eb11953604a4ac3f8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 27 Mar 2008 19:39:21 +0200 Subject: Bug #35206: select query result different if the key is indexed or not The code for executing indexed ORDER BY was not setting all the internal fields correctly when selecting to execute ORDER BY over and index. Fixed by change the access method to one that will use the quick indexed access if one is selected while selecting indexed ORDER BY. mysql-test/r/order_by.result: Bug #35206: test case mysql-test/t/order_by.test: Bug #35206: test case sql/sql_select.cc: Bug #35206: Change the access method when selecting a quick indexed access. --- mysql-test/t/order_by.test | 462 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 462 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test index 898742c2682..64665c6b5bd 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -847,3 +847,465 @@ set session max_sort_length= 2180; select * from t1 order by b; drop table t1; +# +# Bug #35206: select query result different if the key is indexed or not +# + +CREATE TABLE t2 (a varchar(32), b int(11), c float, d double, + UNIQUE KEY a (a,b,c), KEY b (b), KEY c (c)); + +CREATE TABLE t1 (a varchar(32), b char(3), UNIQUE KEY a (a,b), KEY b (b)); +CREATE TABLE t3 (a varchar(32), b char(3), UNIQUE KEY a (a,b)); + +--disable_query_log +INSERT INTO t1 (a, b) VALUES +('domestic', 'CH'), ('domestic', 'LI'), ('plfcz1', 'FR'), ('all', 'AD'), +('all', 'AE'), ('all', 'AF'), ('all', 'AG'), ('all', 'AI'), ('all', 'AL'), +('all', 'AM'), ('all', 'AN'), ('all', 'AO'), ('all', 'AP'), ('all', 'AQ'), +('all', 'AR'), ('all', 'AS'), ('all', 'AT'), ('all', 'AU'), ('all', 'AW'), +('all', 'AZ'), ('all', 'BA'), ('all', 'BB'), ('all', 'BD'), ('all', 'BE'), +('all', 'BF'), ('all', 'BG'), ('all', 'BH'), ('all', 'BI'), ('all', 'BJ'), +('all', 'BM'), ('all', 'BN'), ('all', 'BO'), ('all', 'BR'), ('all', 'BS'), +('all', 'BT'), ('all', 'BV'), ('all', 'BW'), ('all', 'BY'), ('all', 'BZ'), +('all', 'CA'), ('all', 'CC'), ('all', 'CD'), ('all', 'CF'), ('all', 'CG'), +('all', 'CH'), ('all', 'CI'), ('all', 'CK'), ('all', 'CL'), ('all', 'CM'), +('all', 'CN'), ('all', 'CO'), ('all', 'CR'), ('all', 'CU'), ('all', 'CV'), +('all', 'CX'), ('all', 'CY'), ('all', 'CZ'), ('all', 'DE'), ('all', 'DJ'), +('all', 'DK'), ('all', 'DM'), ('all', 'DO'), ('all', 'DZ'), ('all', 'EC'), +('all', 'EE'), ('all', 'EG'), ('all', 'EH'), ('all', 'EI'), ('all', 'ER'), +('all', 'ES'), ('all', 'ET'), ('all', 'FI'), ('all', 'FJ'), ('all', 'FK'), +('all', 'FM'), ('all', 'FO'), ('all', 'FR'), ('all', 'FX'), ('all', 'GA'), +('all', 'GB'), ('all', 'GD'), ('all', 'GE'), ('all', 'GF'), ('all', 'GH'), +('all', 'GI'), ('all', 'GL'), ('all', 'GM'), ('all', 'GN'), ('all', 'GP'), +('all', 'GQ'), ('all', 'GR'), ('all', 'GS'), ('all', 'GT'), ('all', 'GU'), +('all', 'GW'), ('all', 'GY'), ('all', 'HK'), ('all', 'HM'), ('all', 'HN'), +( 'all', 'HR'), ( 'all', 'HT'), ( 'all', 'HU'), ( 'all', 'ID'), ( 'all', 'IE'), +( 'all', 'IL'), ( 'all', 'IN'), ( 'all', 'IO'), ( 'all', 'IQ'), ( 'all', 'IR'), +( 'all', 'IS'), ( 'all', 'IT'), ( 'all', 'JM'), ( 'all', 'JO'), ( 'all', 'JP'), +( 'all', 'KE'), ( 'all', 'KG'), ( 'all', 'KH'), ( 'all', 'KI'), ( 'all', 'KM'), +( 'all', 'KN'), ( 'all', 'KP'), ( 'all', 'KR'), ( 'all', 'KW'), ( 'all', 'KY'), +( 'all', 'KZ'), ( 'all', 'LA'), ( 'all', 'LB'), ( 'all', 'LC'), ( 'all', 'LI'), +( 'all', 'LK'), ( 'all', 'LR'), ( 'all', 'LS'), ( 'all', 'LT'), ( 'all', 'LU'), +( 'all', 'LV'), ( 'all', 'LY'), ( 'all', 'MA'), ( 'all', 'MC'), ( 'all', 'MD'), +( 'all', 'ME'), ( 'all', 'MG'), ( 'all', 'MH'), ( 'all', 'MK'), ( 'all', 'ML'), +( 'all', 'MM'), ( 'all', 'MN'), ( 'all', 'MO'), ( 'all', 'MP'), ( 'all', 'MQ'), +( 'all', 'MR'), ( 'all', 'MS'), ( 'all', 'MT'), ( 'all', 'MU'), ( 'all', 'MV'), +( 'all', 'MW'), ( 'all', 'MX'), ( 'all', 'MY'), ( 'all', 'MZ'), ( 'all', 'NA'), +( 'all', 'NC'), ( 'all', 'NE'), ( 'all', 'NF'), ( 'all', 'NG'), ( 'all', 'NI'), +( 'all', 'NL'), ( 'all', 'NO'), ( 'all', 'NP'), ( 'all', 'NR'), ( 'all', 'NU'), +( 'all', 'NV'), ( 'all', 'NZ'), ( 'all', 'OM'), ( 'all', 'PA'), ( 'all', 'PE'), +( 'all', 'PF'), ( 'all', 'PG'), ( 'all', 'PH'), ( 'all', 'PK'), ( 'all', 'PL'), +( 'all', 'PM'), ( 'all', 'PN'), ( 'all', 'PR'), ( 'all', 'PS'), ( 'all', 'PT'), +( 'all', 'PW'), ( 'all', 'PY'), ( 'all', 'QA'), ( 'all', 'RE'), ( 'all', 'RO'), +( 'all', 'RU'), ( 'all', 'RW'), ( 'all', 'SA'), ( 'all', 'SB'), ( 'all', 'SC'), +( 'all', 'SD'), ( 'all', 'SE'), ( 'all', 'SG'), ( 'all', 'SH'), ( 'all', 'SI'), +( 'all', 'SJ'), ( 'all', 'SK'), ( 'all', 'SL'), ( 'all', 'SM'), ( 'all', 'SN'), +( 'all', 'SO'), ( 'all', 'SR'), ( 'all', 'ST'), ( 'all', 'SV'), ( 'all', 'SY'), +( 'all', 'SZ'), ( 'all', 'TA'), ( 'all', 'TC'), ( 'all', 'TD'), ( 'all', 'TF'), +( 'all', 'TG'), ( 'all', 'TH'), ( 'all', 'TJ'), ( 'all', 'TK'), ( 'all', 'TM'), +( 'all', 'TN'), ( 'all', 'TO'), ( 'all', 'TP'), ( 'all', 'TR'), ( 'all', 'TT'), +( 'all', 'TV'), ( 'all', 'TW'), ( 'all', 'TZ'), ( 'all', 'UA'), ( 'all', 'UG'), +( 'all', 'UM'), ( 'all', 'US'), ( 'all', 'UY'), ( 'all', 'UZ'), ( 'all', 'VA'), +( 'all', 'VC'), ( 'all', 'VE'), ( 'all', 'VG'), ( 'all', 'VI'), ( 'all', 'VN'), +( 'all', 'VU'), ( 'all', 'WF'), ( 'all', 'WS'), ( 'plfcz1', 'FI'), +( 'all', 'XE'), ( 'all', 'XS'), ( 'all', 'XU'), ( 'plfcz1', 'XE'), +( 'all', 'YE'), ( 'all', 'YT'), ( 'all', 'YU'), ( 'all', 'ZA'), ( 'all', 'ZM'), +( 'all', 'ZR'), ( 'all', 'ZW'), ( 'foreign', 'AD'), ( 'foreign', 'AE'), +( 'foreign', 'AF'), ( 'foreign', 'AG'), ( 'foreign', 'AI'), +( 'foreign', 'AL'), ( 'foreign', 'AM'), ( 'foreign', 'AN'), ( 'foreign', 'AO'), +( 'foreign', 'AP'), ( 'foreign', 'AQ'), ( 'foreign', 'AR'), ( 'foreign', 'AS'), +( 'foreign', 'AT'), ( 'foreign', 'AU'), ( 'foreign', 'AW'), ( 'foreign', 'AZ'), +( 'foreign', 'BA'), ( 'foreign', 'BB'), ( 'foreign', 'BD'), ( 'foreign', 'BE'), +( 'foreign', 'BF'), ( 'foreign', 'BG'), ( 'foreign', 'BH'), ( 'foreign', 'BI'), +( 'foreign', 'BJ'), ( 'foreign', 'BM'), ( 'foreign', 'BN'), ( 'foreign', 'BO'), +( 'foreign', 'BR'), ( 'foreign', 'BS'), ( 'foreign', 'BT'), ( 'foreign', 'BV'), +( 'foreign', 'BW'), ( 'foreign', 'BY'), ( 'foreign', 'BZ'), ( 'foreign', 'CA'), +( 'foreign', 'CC'), ( 'foreign', 'CD'), ( 'foreign', 'CF'), ( 'foreign', 'CG'), +( 'foreign', 'CI'), ( 'foreign', 'CK'), ( 'foreign', 'CL'), ( 'foreign', 'CM'), +( 'foreign', 'CN'), ( 'foreign', 'CO'), ( 'foreign', 'CR'), ( 'foreign', 'CU'), +( 'foreign', 'CV'), ( 'foreign', 'CX'), ( 'foreign', 'CY'), ( 'foreign', 'CZ'), +( 'foreign', 'DE'), ( 'foreign', 'DJ'), ( 'foreign', 'DK'), ( 'foreign', 'DM'), +( 'foreign', 'DO'), ( 'foreign', 'DZ'), ( 'foreign', 'EC'), ( 'foreign', 'EE'), +( 'foreign', 'EG'), ( 'foreign', 'EH'), ( 'foreign', 'EI'), ( 'foreign', 'ER'), +( 'foreign', 'ES'), ( 'foreign', 'ET'), ( 'foreign', 'FI'), ( 'foreign', 'FJ'), +( 'foreign', 'FK'), ( 'foreign', 'FM'), ( 'foreign', 'FO'), ( 'foreign', 'FR'), +( 'foreign', 'FX'), ( 'foreign', 'GA'), ( 'foreign', 'GB'), ( 'foreign', 'GD'), +( 'foreign', 'GE'), ( 'foreign', 'GF'), ( 'foreign', 'GH'), ( 'foreign', 'GI'), +( 'foreign', 'GL'), ( 'foreign', 'GM'), ( 'foreign', 'GN'), ( 'foreign', 'GP'), +( 'foreign', 'GQ'), ( 'foreign', 'GR'), ( 'foreign', 'GS'), ( 'foreign', 'GT'), +( 'foreign', 'GU'), ( 'foreign', 'GW'), ( 'foreign', 'GY'), ( 'foreign', 'HK'), +( 'foreign', 'HM'), ( 'foreign', 'HN'), ( 'foreign', 'HR'), ( 'foreign', 'HT'), +( 'foreign', 'HU'), ( 'foreign', 'ID'), ( 'foreign', 'IE'), ( 'foreign', 'IL'), +( 'foreign', 'IN'), ( 'foreign', 'IO'), ( 'foreign', 'IQ'), ( 'foreign', 'IR'), +( 'foreign', 'IS'), ( 'foreign', 'IT'), ( 'foreign', 'JM'), ( 'foreign', 'JO'), +( 'foreign', 'JP'), ( 'foreign', 'KE'), ( 'foreign', 'KG'), ( 'foreign', 'KH'), +( 'foreign', 'KI'), ( 'foreign', 'KM'), ( 'foreign', 'KN'), ( 'foreign', 'KP'), +( 'foreign', 'KR'), ( 'foreign', 'KW'), ( 'foreign', 'KY'), ( 'foreign', 'KZ'), +( 'foreign', 'LA'), ( 'foreign', 'LB'), ( 'foreign', 'LC'), ( 'foreign', 'LK'), +( 'foreign', 'LR'), ( 'foreign', 'LS'), ( 'foreign', 'LT'), ( 'foreign', 'LU'), +( 'foreign', 'LV'), ( 'foreign', 'LY'), ( 'foreign', 'MA'), ( 'foreign', 'MC'), +( 'foreign', 'MD'), ( 'foreign', 'ME'), ( 'foreign', 'MG'), ( 'foreign', 'MH'), +( 'foreign', 'MK'), ( 'foreign', 'ML'), ( 'foreign', 'MM'), ( 'foreign', 'MN'), +( 'foreign', 'MO'), ( 'foreign', 'MP'), ( 'foreign', 'MQ'), ( 'foreign', 'MR'), +( 'foreign', 'MS'), ( 'foreign', 'MT'), ( 'foreign', 'MU'), ( 'foreign', 'MV'), +( 'foreign', 'MW'), ( 'foreign', 'MX'), ( 'foreign', 'MY'), ( 'foreign', 'MZ'), +( 'foreign', 'NA'), ( 'foreign', 'NC'), ( 'foreign', 'NE'), ( 'foreign', 'NF'), +( 'foreign', 'NG'), ( 'foreign', 'NI'), ( 'foreign', 'NL'), ( 'foreign', 'NO'), +( 'foreign', 'NP'), ( 'foreign', 'NR'), ( 'foreign', 'NU'), ( 'foreign', 'NV'), +( 'foreign', 'NZ'), ( 'foreign', 'OM'), ( 'foreign', 'PA'), ( 'foreign', 'PE'), +( 'foreign', 'PF'), ( 'foreign', 'PG'), ( 'foreign', 'PH'), ( 'foreign', 'PK'), +( 'foreign', 'PL'), ( 'foreign', 'PM'), ( 'foreign', 'PN'), ( 'foreign', 'PR'), +( 'foreign', 'PS'), ( 'foreign', 'PT'), ( 'foreign', 'PW'), ( 'foreign', 'PY'), +( 'foreign', 'QA'), ( 'foreign', 'RE'), ( 'foreign', 'RO'), ( 'foreign', 'RU'), +( 'foreign', 'RW'), ( 'foreign', 'SA'), ( 'foreign', 'SB'), ( 'foreign', 'SC'), +( 'foreign', 'SD'), ( 'foreign', 'SE'), ( 'foreign', 'SG'), ( 'foreign', 'SH'), +( 'foreign', 'SI'), ( 'foreign', 'SJ'), ( 'foreign', 'SK'), ( 'foreign', 'SL'), +( 'foreign', 'SM'), ( 'foreign', 'SN'), ( 'foreign', 'SO'), ( 'foreign', 'SR'), +( 'foreign', 'ST'), ( 'foreign', 'SV'), ( 'foreign', 'SY'), ( 'foreign', 'SZ'), +( 'foreign', 'TA'), ( 'foreign', 'TC'), ( 'foreign', 'TD'), ( 'foreign', 'TF'), +( 'foreign', 'TG'), ( 'foreign', 'TH'), ( 'foreign', 'TJ'), ( 'foreign', 'TK'), +( 'foreign', 'TM'), ( 'foreign', 'TN'), ( 'foreign', 'TO'), ( 'foreign', 'TP'), +( 'foreign', 'TR'), ( 'foreign', 'TT'), ( 'foreign', 'TV'), ( 'foreign', 'TW'), +( 'foreign', 'TZ'), ( 'foreign', 'UA'), ( 'foreign', 'UG'), ( 'foreign', 'UM'), +( 'foreign', 'US'), ( 'foreign', 'UY'), ( 'foreign', 'UZ'), ( 'foreign', 'VA'), +( 'foreign', 'VC'), ( 'foreign', 'VE'), ( 'foreign', 'VG'), ( 'foreign', 'VI'), +( 'foreign', 'VN'), ( 'foreign', 'VU'), ( 'foreign', 'WF'), ( 'foreign', 'WS'), +( 'plfcz1', 'DK'), ( 'foreign', 'XE'), ( 'foreign', 'XS'), ( 'foreign', 'XU'), +( 'plfcz1', 'BE'), ( 'foreign', 'YE'), ( 'foreign', 'YT'), ( 'foreign', 'YU'), +( 'foreign', 'ZA'), ( 'foreign', 'ZM'), ( 'foreign', 'ZR'), ( 'foreign', 'ZW'), +( 'plfcz1', 'DE'), ( 'plfcz1', 'GI'), ( 'plfcz1', 'GR'), ( 'plfcz1', 'IS'), +( 'plfcz1', 'EI'), ( 'plfcz1', 'IT'), ( 'plfcz1', 'LU'), ( 'plfcz1', 'NL'), +( 'plfcz1', 'NO'), ( 'plfcz1', 'ES'), ( 'plfcz1', 'SE'), ( 'plfcz1', 'AL'), +( 'plfcz1', 'AD'), ( 'plfcz1', 'BY'), ( 'plfcz1', 'BA'), ( 'plfcz1', 'BG'), +( 'plfcz1', 'EE'), ( 'plfcz1', 'FO'), ( 'plfcz1', 'GL'), ( 'plfcz1', 'GB'), +( 'plfcz1', 'HR'), ( 'plfcz1', 'LV'), ( 'plfcz1', 'LT'), ( 'plfcz1', 'MT'), +( 'plfcz1', 'MK'), ( 'plfcz1', 'MD'), ( 'plfcz1', 'MC'), ( 'plfcz1', 'AT'), +( 'plfcz1', 'PL'), ( 'plfcz1', 'PT'), ( 'plfcz1', 'RO'), ( 'plfcz1', 'RU'), +( 'plfcz1', 'SM'), ( 'plfcz1', 'XS'), ( 'plfcz1', 'SK'), ( 'plfcz1', 'SI'), +( 'plfcz1', 'CZ'), ( 'plfcz1', 'TR'), ( 'plfcz1', 'UA'), ( 'plfcz1', 'HU'), +( 'plfcz1', 'VA'), ( 'plfcz1', 'CY'), ( 'plfcz2', 'AF'), ( 'plfcz2', 'DZ'), +( 'plfcz2', 'AS'), ( 'plfcz2', 'AO'), ( 'plfcz2', 'AI'), ( 'plfcz2', 'AQ'), +( 'plfcz2', 'AG'), ( 'plfcz2', 'AR'), ( 'plfcz2', 'AM'), ( 'plfcz2', 'AW'), +( 'plfcz2', 'AU'), ( 'plfcz2', 'AZ'), ( 'plfcz2', 'AP'), ( 'plfcz2', 'BS'), +( 'plfcz2', 'BH'), ( 'plfcz2', 'BD'), ( 'plfcz2', 'BB'), ( 'plfcz2', 'BZ'), +( 'plfcz2', 'BJ'), ( 'plfcz2', 'BM'), ( 'plfcz2', 'BT'), ( 'plfcz2', 'BO'), +( 'plfcz2', 'BW'), ( 'plfcz2', 'BV'), ( 'plfcz2', 'BR'), ( 'plfcz2', 'IO'), +( 'plfcz2', 'VG'), ( 'plfcz2', 'BN'), ( 'plfcz2', 'BF'), ( 'plfcz2', 'BI'), +( 'plfcz2', 'KH'), ( 'plfcz2', 'CM'), ( 'plfcz2', 'CA'), ( 'plfcz2', 'CV'), +( 'plfcz2', 'KY'), ( 'plfcz2', 'CF'), ( 'plfcz2', 'TD'), ( 'plfcz2', 'CL'), +( 'plfcz2', 'CN'), ( 'plfcz2', 'CX'), ( 'plfcz2', 'CC'), ( 'plfcz2', 'CO'), +( 'plfcz2', 'KM'), ( 'plfcz2', 'CG'), ( 'plfcz2', 'CD'), ( 'plfcz2', 'CK'), +( 'plfcz2', 'CR'), ( 'plfcz2', 'CI'), ( 'plfcz2', 'CU'), ( 'plfcz2', 'DJ'), +( 'plfcz2', 'DM'), ( 'plfcz2', 'DO'), ( 'plfcz2', 'TP'), ( 'plfcz2', 'EC'), +( 'plfcz2', 'EG'), ( 'plfcz2', 'SV'), ( 'plfcz2', 'GQ'), ( 'plfcz2', 'ER'), +( 'plfcz2', 'ET'), ( 'plfcz2', 'FK'), ( 'plfcz2', 'FJ'), ( 'plfcz2', 'FX'), +( 'plfcz2', 'GF'), ( 'plfcz2', 'PF'), ( 'plfcz2', 'TA'), ( 'plfcz2', 'TF'), +( 'plfcz2', 'GA'), ( 'plfcz2', 'GM'), ( 'plfcz2', 'GE'), ( 'plfcz2', 'GH'), +( 'plfcz2', 'GD'), ( 'plfcz2', 'GP'), ( 'plfcz2', 'GU'), ( 'plfcz2', 'GT'), +( 'plfcz2', 'GN'), ( 'plfcz2', 'GW'), ( 'plfcz2', 'GY'), ( 'plfcz2', 'HT'), +( 'plfcz2', 'HM'), ( 'plfcz2', 'HN'), ( 'plfcz2', 'HK'), ( 'plfcz2', 'IN'), +( 'plfcz2', 'ID'), ( 'plfcz2', 'IR'), ( 'plfcz2', 'IQ'), ( 'plfcz2', 'IE'), +( 'plfcz2', 'IL'), ( 'plfcz2', 'JM'), ( 'plfcz2', 'JP'), ( 'plfcz2', 'JO'), +( 'plfcz2', 'KZ'), ( 'plfcz2', 'KE'), ( 'plfcz2', 'KI'), ( 'plfcz2', 'KP'), +( 'plfcz2', 'KW'), ( 'plfcz2', 'KG'), ( 'plfcz2', 'LA'), ( 'plfcz2', 'LB'), +( 'plfcz2', 'LS'), ( 'plfcz2', 'LR'), ( 'plfcz2', 'LY'), ( 'plfcz2', 'MO'), +( 'plfcz2', 'MG'), ( 'plfcz2', 'ME'), ( 'plfcz2', 'MW'), ( 'plfcz2', 'MY'), +( 'plfcz2', 'MV'), ( 'plfcz2', 'ML'), ( 'plfcz2', 'MH'), ( 'plfcz2', 'MQ'), +( 'plfcz2', 'MR'), ( 'plfcz2', 'MU'), ( 'plfcz2', 'YT'), ( 'plfcz2', 'MX'), +( 'plfcz2', 'FM'), ( 'plfcz2', 'MN'), ( 'plfcz2', 'MS'), ( 'plfcz2', 'MA'), +( 'plfcz2', 'MZ'), ( 'plfcz2', 'MM'), ( 'plfcz2', 'NA'), ( 'plfcz2', 'NR'), +( 'plfcz2', 'NP'), ( 'plfcz2', 'AN'), ( 'plfcz2', 'NC'), ( 'plfcz2', 'NZ'), +( 'plfcz2', 'NI'), ( 'plfcz2', 'NE'), ( 'plfcz2', 'NG'), ( 'plfcz2', 'NU'), +( 'plfcz2', 'NF'), ( 'plfcz2', 'MP'), ( 'plfcz2', 'OM'), ( 'plfcz2', 'PK'), +( 'plfcz2', 'PW'), ( 'plfcz2', 'PS'), ( 'plfcz2', 'PA'), ( 'plfcz2', 'PG'), +( 'plfcz2', 'PY'), ( 'plfcz2', 'PE'), ( 'plfcz2', 'PH'), ( 'plfcz2', 'PN'), +( 'plfcz2', 'PR'), ( 'plfcz2', 'QA'), ( 'plfcz2', 'RE'), ( 'plfcz2', 'RW'), +( 'plfcz2', 'KN'), ( 'plfcz2', 'ST'), ( 'plfcz2', 'SA'), ( 'plfcz2', 'SN'), +( 'plfcz2', 'SC'), ( 'plfcz2', 'SL'), ( 'plfcz2', 'SG'), ( 'plfcz2', 'SB'), +( 'plfcz2', 'SO'), ( 'plfcz2', 'ZA'), ( 'plfcz2', 'GS'), ( 'plfcz2', 'KR'), +( 'plfcz2', 'LK'), ( 'plfcz2', 'NV'), ( 'plfcz2', 'SH'), ( 'plfcz2', 'LC'), +( 'plfcz2', 'PM'), ( 'plfcz2', 'VC'), ( 'plfcz2', 'SD'), ( 'plfcz2', 'SR'), +( 'plfcz2', 'SJ'), ( 'plfcz2', 'SZ'), ( 'plfcz2', 'SY'), ( 'plfcz2', 'TW'), +( 'plfcz2', 'TJ'), ( 'plfcz2', 'TZ'), ( 'plfcz2', 'TH'), ( 'plfcz2', 'TG'), +( 'plfcz2', 'TK'), ( 'plfcz2', 'TO'), ( 'plfcz2', 'TT'), ( 'plfcz2', 'XU'), +( 'plfcz2', 'TN'), ( 'plfcz2', 'TM'), ( 'plfcz2', 'TC'), ( 'plfcz2', 'TV'), +( 'plfcz2', 'UG'), ( 'plfcz2', 'AE'), ( 'plfcz2', 'US'), ( 'plfcz2', 'UM'), +( 'plfcz2', 'UY'), ( 'plfcz2', 'UZ'), ( 'plfcz2', 'VU'), ( 'plfcz2', 'VE'), +( 'plfcz2', 'VN'), ( 'plfcz2', 'VI'), ( 'plfcz2', 'WF'), ( 'plfcz2', 'EH'), +( 'plfcz2', 'WS'), ( 'plfcz2', 'YE'), ( 'plfcz2', 'YU'), ( 'plfcz2', 'ZR'), +( 'plfcz2', 'ZM'), ( 'plfcz2', 'ZW'), ( 'ppfcz1', 'AT'), ( 'ppfcz1', 'BE'), +( 'ppfcz1', 'DE'), ( 'ppfcz1', 'FR'), ( 'ppfcz1', 'FX'), ( 'ppfcz1', 'IT'), +( 'ppfcz1', 'LU'), ( 'ppfcz1', 'MC'), ( 'ppfcz1', 'NL'), ( 'ppfcz1', 'SM'), +( 'ppfcz1', 'VA'), ( 'ppfcz1', 'XE'), ( 'ppfcz2', 'AD'), ( 'ppfcz2', 'AL'), +( 'ppfcz2', 'BA'), ( 'ppfcz2', 'BG'), ( 'ppfcz2', 'BY'), ( 'ppfcz2', 'CY'), +( 'ppfcz2', 'CZ'), ( 'ppfcz2', 'DK'), ( 'ppfcz2', 'EE'), ( 'ppfcz2', 'EI'), +( 'ppfcz2', 'ES'), ( 'ppfcz2', 'FI'), ( 'ppfcz2', 'FO'), ( 'ppfcz2', 'GB'), +( 'ppfcz2', 'GI'), ( 'ppfcz2', 'GL'), ( 'ppfcz2', 'GR'), ( 'ppfcz2', 'HR'), +( 'ppfcz2', 'HU'), ( 'ppfcz2', 'IE'), ( 'ppfcz2', 'IS'), ( 'ppfcz2', 'LT'), +( 'ppfcz2', 'LV'), ( 'ppfcz2', 'MD'), ( 'ppfcz2', 'MK'), ( 'ppfcz2', 'MT'), +( 'ppfcz2', 'NO'), ( 'ppfcz2', 'PL'), ( 'ppfcz2', 'PT'), ( 'ppfcz2', 'RO'), +( 'ppfcz2', 'RU'), ( 'ppfcz2', 'SE'), ( 'ppfcz2', 'SI'), ( 'ppfcz2', 'SK'), +( 'ppfcz2', 'TR'), ( 'ppfcz2', 'UA'), ( 'ppfcz2', 'XS'), ( 'ppfcz2', 'YU'), +( 'ppfcz3', 'CA'), ( 'ppfcz3', 'DZ'), ( 'ppfcz3', 'EG'), ( 'ppfcz3', 'IL'), +( 'ppfcz3', 'JO'), ( 'ppfcz3', 'LB'), ( 'ppfcz3', 'LY'), ( 'ppfcz3', 'MA'), +( 'ppfcz3', 'MX'), ( 'ppfcz3', 'PM'), ( 'ppfcz3', 'SY'), ( 'ppfcz3', 'TN'), +( 'ppfcz3', 'US'), ( 'ppfcz4', 'AE'), ( 'ppfcz4', 'AF'), ( 'ppfcz4', 'AM'), +( 'ppfcz4', 'AO'), ( 'ppfcz4', 'AZ'), ( 'ppfcz4', 'BD'), ( 'ppfcz4', 'BF'), +( 'ppfcz4', 'BH'), ( 'ppfcz4', 'BI'), ( 'ppfcz4', 'BJ'), ( 'ppfcz4', 'BT'), +( 'ppfcz4', 'BV'), ( 'ppfcz4', 'BW'), ( 'ppfcz4', 'CF'), ( 'ppfcz4', 'CG'), +( 'ppfcz4', 'CI'), ( 'ppfcz4', 'CM'), ( 'ppfcz4', 'CN'), ( 'ppfcz4', 'DJ'), +( 'ppfcz4', 'DO'), ( 'ppfcz4', 'ER'), ( 'ppfcz4', 'ET'), ( 'ppfcz4', 'GA'), +( 'ppfcz4', 'GE'), ( 'ppfcz4', 'GH'), ( 'ppfcz4', 'GM'), ( 'ppfcz4', 'GN'), +( 'ppfcz4', 'GQ'), ( 'ppfcz4', 'GW'), ( 'ppfcz4', 'HK'), ( 'ppfcz4', 'IN'), +( 'ppfcz4', 'IQ'), ( 'ppfcz4', 'IR'), ( 'ppfcz4', 'JP'), ( 'ppfcz4', 'KE'), +( 'ppfcz4', 'KG'), ( 'ppfcz4', 'KH'), ( 'ppfcz4', 'KP'), ( 'ppfcz4', 'KW'), +( 'ppfcz4', 'KZ'), ( 'ppfcz4', 'LA'), ( 'ppfcz4', 'LK'), ( 'ppfcz4', 'LR'), +( 'ppfcz4', 'LS'), ( 'ppfcz4', 'MG'), ( 'ppfcz4', 'ML'), ( 'ppfcz4', 'MM'), +( 'ppfcz4', 'MN'), ( 'ppfcz4', 'MO'), ( 'ppfcz4', 'MR'), ( 'ppfcz4', 'MU'), +( 'ppfcz4', 'MV'), ( 'ppfcz4', 'MW'), ( 'ppfcz4', 'MY'), ( 'ppfcz4', 'MZ'), +( 'ppfcz4', 'NA'), ( 'ppfcz4', 'NE'), ( 'ppfcz4', 'NG'), ( 'ppfcz4', 'NP'), +( 'ppfcz4', 'OM'), ( 'ppfcz4', 'PK'), ( 'ppfcz4', 'QA'), ( 'ppfcz4', 'RE'), +( 'ppfcz4', 'RW'), ( 'ppfcz4', 'SA'), ( 'ppfcz4', 'SC'), ( 'ppfcz4', 'SD'), +( 'ppfcz4', 'SG'), ( 'ppfcz4', 'SH'), ( 'ppfcz4', 'SL'), ( 'ppfcz4', 'SN'), +( 'ppfcz4', 'SO'), ( 'ppfcz4', 'SZ'), ( 'ppfcz4', 'TD'), ( 'ppfcz4', 'TG'), +( 'ppfcz4', 'TH'), ( 'ppfcz4', 'TJ'), ( 'ppfcz4', 'TM'), ( 'ppfcz4', 'TW'), +( 'ppfcz4', 'TZ'), ( 'ppfcz4', 'UG'), ( 'ppfcz4', 'UZ'), ( 'ppfcz4', 'VN'), +( 'ppfcz4', 'XU'), ( 'ppfcz4', 'YT'), ( 'ppfcz4', 'ZA'), ( 'ppfcz4', 'ZW'), +( 'ppfcz5', 'AG'), ( 'ppfcz5', 'AI'), ( 'ppfcz5', 'AN'), ( 'ppfcz5', 'AP'), +( 'ppfcz5', 'AQ'), ( 'ppfcz5', 'AR'), ( 'ppfcz5', 'AS'), ( 'ppfcz5', 'AU'), +( 'ppfcz5', 'AW'), ( 'ppfcz5', 'BB'), ( 'ppfcz5', 'BM'), ( 'ppfcz5', 'BN'), +( 'ppfcz5', 'BO'), ( 'ppfcz5', 'BR'), ( 'ppfcz5', 'BS'), ( 'ppfcz5', 'BZ'), +( 'ppfcz5', 'CC'), ( 'ppfcz5', 'CD'), ( 'ppfcz5', 'CK'), ( 'ppfcz5', 'CL'), +( 'ppfcz5', 'CO'), ( 'ppfcz5', 'CR'), ( 'ppfcz5', 'CU'), ( 'ppfcz5', 'CV'), +( 'ppfcz5', 'CX'), ( 'ppfcz5', 'DM'), ( 'ppfcz5', 'EC'), ( 'ppfcz5', 'EH'), +( 'ppfcz5', 'FJ'), ( 'ppfcz5', 'FK'), ( 'ppfcz5', 'FM'), ( 'ppfcz5', 'GD'), +( 'ppfcz5', 'GF'), ( 'ppfcz5', 'GP'), ( 'ppfcz5', 'GS'), ( 'ppfcz5', 'GT'), +( 'ppfcz5', 'GU'), ( 'ppfcz5', 'GY'), ( 'ppfcz5', 'HM'), ( 'ppfcz5', 'HN'), +( 'ppfcz5', 'HT'), ( 'ppfcz5', 'ID'), ( 'ppfcz5', 'IO'), ( 'ppfcz5', 'JM'), +( 'ppfcz5', 'KI'), ( 'ppfcz5', 'KM'), ( 'ppfcz5', 'KN'), ( 'ppfcz5', 'KR'), +( 'ppfcz5', 'KY'), ( 'ppfcz5', 'LC'), ( 'ppfcz5', 'ME'), ( 'ppfcz5', 'MH'), +( 'ppfcz5', 'MP'), ( 'ppfcz5', 'MQ'), ( 'ppfcz5', 'MS'), ( 'ppfcz5', 'NC'), +( 'ppfcz5', 'NF'), ( 'ppfcz5', 'NI'), ( 'ppfcz5', 'NR'), ( 'ppfcz5', 'NU'), +( 'ppfcz5', 'NZ'), ( 'ppfcz5', 'PA'), ( 'ppfcz5', 'PE'), ( 'ppfcz5', 'PF'), +( 'ppfcz5', 'PG'), ( 'ppfcz5', 'PH'), ( 'ppfcz5', 'PN'), ( 'ppfcz5', 'PR'), +( 'ppfcz5', 'PS'), ( 'ppfcz5', 'PW'), ( 'ppfcz5', 'PY'), ( 'ppfcz5', 'SB'), +( 'ppfcz5', 'SJ'), ( 'ppfcz5', 'SR'), ( 'ppfcz5', 'ST'), ( 'ppfcz5', 'SV'), +( 'ppfcz5', 'TA'), ( 'ppfcz5', 'TC'), ( 'ppfcz5', 'TF'), ( 'ppfcz5', 'TK'), +( 'ppfcz5', 'TO'), ( 'ppfcz5', 'TP'), ( 'ppfcz5', 'TT'), ( 'ppfcz5', 'TV'), +( 'ppfcz5', 'UM'), ( 'ppfcz5', 'UY'), ( 'ppfcz5', 'VC'), ( 'ppfcz5', 'VE'), +( 'ppfcz5', 'VG'), ( 'ppfcz5', 'VI'), ( 'ppfcz5', 'VU'), ( 'ppfcz5', 'WF'), +( 'ppfcz5', 'WS'), ( 'ppfcz5', 'YE'), ( 'ppfcz5', 'ZM'), ( 'ppfcz5', 'ZR'); + +INSERT INTO t2 (a, b, c, d) VALUES +('domestic', 26, 0.25, 4.7), ('domestic', 27, 0.25, 6), +('domestic', 19, 2, 6.3), ('domestic', 19, 5, 7.77), +('domestic', 19, 10, 10.3), ('domestic', 19, 20, 14.83), +('domestic', 19, 30, 20.88), ('domestic', 20, 2, 7.3), +('domestic', 20, 5, 8.77), ('domestic', 20, 10, 11.3), +('domestic', 20, 20, 15.83), ('domestic', 20, 30, 21.88), +('domestic', 23, 2, 18.8), ('domestic', 23, 5, 20.8), +('domestic', 23, 10, 24.8), ('domestic', 23, 20, 27.8), +('domestic', 23, 30, 30.8), ('domestic', 24, 2, 21.1405), +('domestic', 24, 5, 22.3705), ('domestic', 24, 10, 25.0905), +('domestic', 24, 20, 29.7705), ('domestic', 24, 30, 35.9605), +('domestic', 17, 2, 7.2), ('domestic', 17, 5, 8.43), +('domestic', 17, 10, 11.15), ('domestic', 17, 20, 15.83), +('domestic', 17, 30, 22.02), ('domestic', 18, 2, 8.2), +('domestic', 18, 5, 9.43), ('domestic', 18, 10, 12.15), +('domestic', 18, 20, 16.83), ('domestic', 18, 30, 23.02), +('domestic', 28, 2, 17), ('domestic', 28, 5, 19), +('domestic', 28, 10, 22), ('domestic', 28, 20, 28), +('domestic', 28, 30, 35), ('domestic', 29, 30, 29.5), +('foreign', 25, 200, 0), ('domestic', 3, 100, 59), +('foreign', 10, 30, 0), ('foreign', 22, 0, 0), +('foreign', 11, 30, 0), ('foreign', 12, 30, 0), +('all', 1, 10000, 0), ('all', 2, 10000, 0), +('domestic', 9, 10000, 0), ('domestic', 4, 500, 0), +('domestic', 5, 500, 0), ('domestic', 6, 500, 0), +('domestic', 7, 500, 0), ('domestic', 8, 500, 0), +('domestic', 21, 3.9, 10.8), ('domestic', 21, 4.9, 12.2), +('domestic', 21, 9.9, 15.3), ('domestic', 21, 19.9, 20.6), +('domestic', 21, 30, 28.1), ('plfcz1', 16, 0.5, 19), +('plfcz2', 16, 0.5, 25), ( 'ppfcz2', 15, 16, 76.5), +( 'ppfcz2', 15, 15, 75.5), ( 'ppfcz2', 15, 14, 73.5), +( 'ppfcz2', 15, 13, 71.5), ( 'ppfcz2', 15, 12, 69.5), +( 'ppfcz2', 15, 11, 67.5), ( 'ppfcz2', 15, 10, 65.5), +( 'ppfcz2', 15, 9, 62.5), ( 'ppfcz2', 15, 8, 59.5), +( 'ppfcz2', 15, 7, 56.5), ( 'ppfcz2', 15, 6, 53.5), +( 'ppfcz2', 15, 5, 50.5), ( 'ppfcz2', 15, 4, 46.5), +( 'ppfcz2', 15, 3, 42.5), ( 'ppfcz2', 15, 2, 38.5), +('ppfcz1', 15, 2, 33.5), ('ppfcz1', 15, 3, 36.5), +('ppfcz1', 15, 4, 39.5), ('ppfcz1', 15, 5, 41.5), +('ppfcz1', 15, 6, 42.5), ('ppfcz1', 15, 7, 43.5), +('ppfcz1', 15, 8, 44.5), ('ppfcz1', 15, 9, 45.5), +('ppfcz1', 15, 10, 46.5), ('ppfcz1', 15, 11, 47.5), +( 'ppfcz1', 15, 12, 48.5), ( 'ppfcz1', 15, 13, 49.5), ( 'ppfcz1', 15, 14, 50.5), +( 'ppfcz1', 15, 15, 51.5), ( 'ppfcz1', 15, 16, 52.5), ( 'ppfcz1', 15, 17, 53.5), +( 'ppfcz1', 15, 18, 54.5), ( 'ppfcz1', 15, 19, 55.5), ( 'ppfcz1', 15, 20, 56.5), +( 'ppfcz1', 15, 21, 57.5), ( 'ppfcz1', 15, 22, 58.5), ( 'ppfcz1', 15, 23, 59.5), +( 'ppfcz1', 15, 24, 60.5), ( 'ppfcz1', 15, 25, 61.5), ( 'ppfcz1', 15, 26, 62.5), +( 'ppfcz1', 15, 27, 63.5), ( 'ppfcz1', 15, 28, 64.5), ( 'ppfcz1', 15, 29, 65.5), +( 'ppfcz1', 15, 30, 66.5), ( 'ppfcz2', 15, 17, 77.5), ( 'ppfcz2', 15, 18, 78.5), +( 'ppfcz2', 15, 19, 79.5), ( 'ppfcz2', 15, 20, 80.5), ( 'ppfcz2', 15, 21, 81.5), +( 'ppfcz2', 15, 22, 82.5), ( 'ppfcz2', 15, 23, 83.5), ( 'ppfcz2', 15, 24, 84.5), +( 'ppfcz2', 15, 25, 85.5), ( 'ppfcz2', 15, 26, 86.5), ( 'ppfcz2', 15, 27, 87.5), +( 'ppfcz2', 15, 28, 88.5), ( 'ppfcz2', 15, 29, 89.5), ( 'ppfcz2', 15, 30, 90.5), +( 'ppfcz3', 15, 2, 39.5), ( 'ppfcz3', 15, 3, 45.5), ( 'ppfcz3', 15, 4, 51.5), +( 'ppfcz3', 15, 5, 57.5), ( 'ppfcz3', 15, 6, 63.5), ( 'ppfcz3', 15, 7, 69.5), +( 'ppfcz3', 15, 8, 75.5), ( 'ppfcz3', 15, 9, 81.5), ( 'ppfcz3', 15, 10, 87.5), +( 'ppfcz3', 15, 11, 93.5), ( 'ppfcz3', 15, 12, 99.5), ( 'ppfcz3', 15, 13, 105.5), +( 'ppfcz3', 15, 14, 111.5), ( 'ppfcz3', 15, 15, 117.5), ( 'ppfcz3', 15, 16, 122.5), +( 'ppfcz3', 15, 17, 127.5), ( 'ppfcz3', 15, 18, 132.5), ( 'ppfcz3', 15, 19, 137.5), +( 'ppfcz3', 15, 20, 142.5), ( 'ppfcz3', 15, 21, 146.5), ( 'ppfcz3', 15, 22, 150.5), +( 'ppfcz3', 15, 23, 154.5), ( 'ppfcz3', 15, 24, 158.5), ( 'ppfcz3', 15, 25, 162.5), +( 'ppfcz3', 15, 26, 166.5), ( 'ppfcz3', 15, 27, 170.5), ( 'ppfcz3', 15, 28, 174.5), +( 'ppfcz3', 15, 29, 178.5), ( 'ppfcz3', 15, 30, 182.5), ( 'ppfcz4', 15, 2, 44.5), +( 'ppfcz4', 15, 3, 51.5), ( 'ppfcz4', 15, 4, 58.5), ( 'ppfcz4', 15, 5, 65.5), +( 'ppfcz4', 15, 6, 72.5), ( 'ppfcz4', 15, 7, 79.5), ( 'ppfcz4', 15, 8, 86.5), +( 'ppfcz4', 15, 9, 93.5), ( 'ppfcz4', 15, 10, 100.5), ( 'ppfcz4', 15, 11, 105.5), +( 'ppfcz4', 15, 12, 110.5), ( 'ppfcz4', 15, 13, 115.5), ( 'ppfcz4', 15, 14, 120.5), +( 'ppfcz4', 15, 15, 125.5), ( 'ppfcz4', 15, 16, 130.5), ( 'ppfcz4', 15, 17, 135.5), +( 'ppfcz4', 15, 18, 140.5), ( 'ppfcz4', 15, 19, 145.5), ( 'ppfcz4', 15, 20, 150.5), +( 'ppfcz4', 15, 21, 154.5), ( 'ppfcz4', 15, 22, 158.5), ( 'ppfcz4', 15, 23, 162.5), +( 'ppfcz4', 15, 24, 166.5), ( 'ppfcz4', 15, 25, 170.5), ( 'ppfcz4', 15, 26, 174.5), +( 'ppfcz4', 15, 27, 178.5), ( 'ppfcz4', 15, 28, 182.5), ( 'ppfcz4', 15, 29, 186.5), +( 'ppfcz4', 15, 30, 190.5), ( 'ppfcz5', 15, 2, 48.5), ( 'ppfcz5', 15, 3, 56.5), +( 'ppfcz5', 15, 4, 64.5), ( 'ppfcz5', 15, 5, 72.5), ( 'ppfcz5', 15, 6, 80.5), +( 'ppfcz5', 15, 7, 88.5), ( 'ppfcz5', 15, 8, 96.5), ( 'ppfcz5', 15, 9, 104.5), +( 'ppfcz5', 15, 10, 112.5), ( 'ppfcz5', 15, 11, 119.5), ( 'ppfcz5', 15, 12, 126.5), +( 'ppfcz5', 15, 13, 133.5), ( 'ppfcz5', 15, 14, 140.5), ( 'ppfcz5', 15, 15, 147.5), +( 'ppfcz5', 15, 16, 153.5), ( 'ppfcz5', 15, 17, 161.5), ( 'ppfcz5', 15, 18, 167.5), +( 'ppfcz5', 15, 19, 173.5), ( 'ppfcz5', 15, 20, 179.5), ( 'ppfcz5', 15, 21, 185.5), +( 'ppfcz5', 15, 22, 191.5), ( 'ppfcz5', 15, 23, 197.5), ( 'ppfcz5', 15, 24, 203.5), +( 'ppfcz5', 15, 25, 207.5), ( 'ppfcz5', 15, 26, 212.5), ( 'ppfcz5', 15, 27, 217.5), +( 'ppfcz5', 15, 28, 222.5), ( 'ppfcz5', 15, 29, 227.5), ( 'ppfcz5', 15, 30, 232.5), +( 'ppfcz1', 14, 2, 37.5), ( 'ppfcz1', 14, 3, 41.5), ( 'ppfcz1', 14, 4, 45.5), +( 'ppfcz1', 14, 5, 48.5), ( 'ppfcz1', 14, 6, 52.5), ( 'ppfcz1', 14, 7, 55.5), +( 'ppfcz1', 14, 8, 57.5), ( 'ppfcz1', 14, 9, 59.5), ( 'ppfcz1', 14, 10, 61.5), +( 'ppfcz1', 14, 11, 62.5), ( 'ppfcz1', 14, 12, 63.5), ( 'ppfcz1', 14, 13, 64.5), +( 'ppfcz1', 14, 14, 65.5), ( 'ppfcz1', 14, 15, 66.5), ( 'ppfcz1', 14, 16, 67.5), +( 'ppfcz1', 14, 17, 68.5), ( 'ppfcz1', 14, 18, 69.5), ( 'ppfcz1', 14, 19, 70.5), +( 'ppfcz1', 14, 20, 71.5), ( 'ppfcz1', 14, 21, 72.5), ( 'ppfcz1', 14, 22, 73.5), +( 'ppfcz1', 14, 23, 74.5), ( 'ppfcz1', 14, 24, 75.5), ( 'ppfcz1', 14, 25, 76.5), +( 'ppfcz1', 14, 26, 77.5), ( 'ppfcz1', 14, 27, 78.5), ( 'ppfcz1', 14, 28, 79.5), +( 'ppfcz1', 14, 29, 80.5), ( 'ppfcz1', 14, 30, 81.5), ( 'ppfcz2', 14, 2, 43.5), +( 'ppfcz2', 14, 3, 48.5), ( 'ppfcz2', 14, 4, 53.5), ( 'ppfcz2', 14, 5, 57.5), +( 'ppfcz2', 14, 6, 61.5), ( 'ppfcz2', 14, 7, 65.5), ( 'ppfcz2', 14, 8, 69.5), +( 'ppfcz2', 14, 9, 73.5), ( 'ppfcz2', 14, 10, 77.5), ( 'ppfcz2', 14, 11, 80.5), +( 'ppfcz2', 14, 12, 83.5), ( 'ppfcz2', 14, 13, 86.5), ( 'ppfcz2', 14, 14, 89.5), +( 'ppfcz2', 14, 15, 92.5), ( 'ppfcz2', 14, 16, 94.5), ( 'ppfcz2', 14, 17, 96.5), +( 'ppfcz2', 14, 18, 98.5), ( 'ppfcz2', 14, 19, 99.5), ( 'ppfcz2', 14, 20, 100.5), +( 'ppfcz2', 14, 21, 101.5), ( 'ppfcz2', 14, 22, 102.5), ( 'ppfcz2', 14, 23, 103.5), +( 'ppfcz2', 14, 24, 104.5), ( 'ppfcz2', 14, 25, 105.5), ( 'ppfcz2', 14, 26, 106.5), +( 'ppfcz2', 14, 27, 107.5), ( 'ppfcz2', 14, 28, 108.5), ( 'ppfcz2', 14, 29, 109.5), +( 'ppfcz2', 14, 30, 110.5), ( 'ppfcz3', 14, 2, 47.5), ( 'ppfcz3', 14, 3, 56.5), +( 'ppfcz3', 14, 4, 67.5), ( 'ppfcz3', 14, 5, 78.5), ( 'ppfcz3', 14, 6, 87.5), +( 'ppfcz3', 14, 7, 96.5), ( 'ppfcz3', 14, 8, 105.5), ( 'ppfcz3', 14, 9, 114.5), +( 'ppfcz3', 14, 10, 123.5), ( 'ppfcz3', 14, 11, 131.5), ( 'ppfcz3', 14, 12, 139.5), +( 'ppfcz3', 14, 13, 147.5), ( 'ppfcz3', 14, 14, 155.5), ( 'ppfcz3', 14, 15, 163.5), +( 'ppfcz3', 14, 16, 171.5), ( 'ppfcz3', 14, 17, 179.5), ( 'ppfcz3', 14, 18, 187.5), +( 'ppfcz3', 14, 19, 195.5), ( 'ppfcz3', 14, 20, 203.5), ( 'ppfcz3', 14, 21, 210.5), +( 'ppfcz3', 14, 22, 217.5), ( 'ppfcz3', 14, 23, 224.5), ( 'ppfcz3', 14, 24, 231.5), +( 'ppfcz3', 14, 25, 238.5), ( 'ppfcz3', 14, 26, 245.5), ( 'ppfcz3', 14, 27, 252.5), +( 'ppfcz3', 14, 28, 259.5), ( 'ppfcz3', 14, 29, 266.5), ( 'ppfcz3', 14, 30, 273.5), +( 'ppfcz4', 14, 2, 54.5), ( 'ppfcz4', 14, 3, 68.5), ( 'ppfcz4', 14, 4, 81.5), +( 'ppfcz4', 14, 5, 95.5), ( 'ppfcz4', 14, 6, 108.5), ( 'ppfcz4', 14, 7, 121.5), +( 'ppfcz4', 14, 8, 134.5), ( 'ppfcz4', 14, 9, 147.5), ( 'ppfcz4', 14, 10, 160.5), +( 'ppfcz4', 14, 11, 168.5), ( 'ppfcz4', 14, 12, 178.5), ( 'ppfcz4', 14, 13, 188.5), +( 'ppfcz4', 14, 14, 198.5), ( 'ppfcz4', 14, 15, 208.5), ( 'ppfcz4', 14, 16, 216.5), +( 'ppfcz4', 14, 17, 224.5), ( 'ppfcz4', 14, 18, 232.5), ( 'ppfcz4', 14, 19, 240.5), +( 'ppfcz4', 14, 20, 248.5), ( 'ppfcz4', 14, 21, 256.5), ( 'ppfcz4', 14, 22, 264.5), +( 'ppfcz4', 14, 23, 272.5), ( 'ppfcz4', 14, 24, 280.5), ( 'ppfcz4', 14, 25, 288.5), +( 'ppfcz4', 14, 26, 296.5), ( 'ppfcz4', 14, 27, 304.5), ( 'ppfcz4', 14, 28, 312.5), +( 'ppfcz4', 14, 29, 320.5), ( 'ppfcz4', 14, 30, 328.5), ( 'ppfcz5', 14, 2, 66.5), +( 'ppfcz5', 14, 3, 84.5), ( 'ppfcz5', 14, 4, 102.5), ( 'ppfcz5', 14, 5, 120.5), +( 'ppfcz5', 14, 6, 137.5), ( 'ppfcz5', 14, 7, 154.5), ( 'ppfcz5', 14, 8, 171.5), +( 'ppfcz5', 14, 9, 188.5), ( 'ppfcz5', 14, 10, 205.5), ( 'ppfcz5', 14, 11, 220.5), +( 'ppfcz5', 14, 12, 235.5), ( 'ppfcz5', 14, 13, 250.5), ( 'ppfcz5', 14, 14, 265.5), +( 'ppfcz5', 14, 15, 280.5), ( 'ppfcz5', 14, 16, 295.5), ( 'ppfcz5', 14, 17, 310.5), +( 'ppfcz5', 14, 18, 325.5), ( 'ppfcz5', 14, 19, 340.5), ( 'ppfcz5', 14, 20, 355.5), +( 'ppfcz5', 14, 21, 368.5), ( 'ppfcz5', 14, 22, 381.5), ( 'ppfcz5', 14, 23, 394.5), +( 'ppfcz5', 14, 24, 407.5), ( 'ppfcz5', 14, 25, 420.5), ( 'ppfcz5', 14, 26, 433.5), +( 'ppfcz5', 14, 27, 446.5), ( 'ppfcz5', 14, 28, 459.5), ( 'ppfcz5', 14, 29, 472.5), +( 'ppfcz5', 14, 30, 485.5), ( 'ppfcz1', 30, 0.5, 56.5), ( 'ppfcz1', 30, 1, 63.5), +( 'ppfcz1', 30, 1.5, 69.5), ( 'ppfcz1', 30, 2, 75.5), ( 'ppfcz1', 30, 2.5, 80.5), +( 'ppfcz1', 30, 3, 86.5), ( 'ppfcz1', 30, 3.5, 92.5), ( 'ppfcz1', 30, 4, 99.5), +( 'ppfcz1', 30, 4.5, 105.5), ( 'ppfcz1', 30, 5, 111.5), ( 'ppfcz1', 30, 6, 118.5), +( 'ppfcz1', 30, 7, 126.5), ( 'ppfcz1', 30, 8, 133.5), ( 'ppfcz1', 30, 9, 141.5), +( 'ppfcz1', 30, 10, 148.5), ( 'ppfcz1', 30, 11, 156.5), ( 'ppfcz1', 30, 12, 163.5), +( 'ppfcz1', 30, 13, 171.5), ( 'ppfcz1', 30, 14, 178.5), ( 'ppfcz1', 30, 15, 186.5), +( 'ppfcz1', 30, 16, 193.5), ( 'ppfcz1', 30, 17, 201.5), ( 'ppfcz1', 30, 18, 209.5), +( 'ppfcz1', 30, 19, 216.5), ( 'ppfcz1', 30, 20, 224.5), ( 'ppfcz1', 30, 21, 231.5), +( 'ppfcz1', 30, 22, 239.5), ( 'ppfcz1', 30, 23, 246.5), ( 'ppfcz1', 30, 24, 254.5), +( 'ppfcz1', 30, 25, 261.5), ( 'ppfcz1', 30, 26, 269.5), ( 'ppfcz1', 30, 27, 276.5), +( 'ppfcz1', 30, 28, 284.5), ( 'ppfcz1', 30, 29, 291.5), ( 'ppfcz1', 30, 30, 299.5), +( 'ppfcz2', 30, 0.5, 61.5), ( 'ppfcz2', 30, 1, 65.5), ( 'ppfcz2', 30, 1.5, 75.5), +( 'ppfcz2', 30, 2, 80.5), ( 'ppfcz2', 30, 2.5, 86.5), ( 'ppfcz2', 30, 3, 99.5), +( 'ppfcz2', 30, 3.5, 109.5), ( 'ppfcz2', 30, 4, 113.5), ( 'ppfcz2', 30, 4.5, 121.5), +( 'ppfcz2', 30, 5, 129.5), ( 'ppfcz2', 30, 6, 139.5), ( 'ppfcz2', 30, 7, 149.5), +( 'ppfcz2', 30, 8, 159.5), ( 'ppfcz2', 30, 9, 169.5), ( 'ppfcz2', 30, 10, 180.5), +( 'ppfcz2', 30, 11, 189.5), ( 'ppfcz2', 30, 12, 199.5), ( 'ppfcz2', 30, 13, 210.5), +( 'ppfcz2', 30, 14, 219.5), ( 'ppfcz2', 30, 15, 229.5), ( 'ppfcz2', 30, 16, 240.5), +( 'ppfcz2', 30, 17, 249.5), ( 'ppfcz2', 30, 18, 259.5), ( 'ppfcz2', 30, 19, 270.5), +( 'ppfcz2', 30, 20, 280.5), ( 'ppfcz2', 30, 21, 289.5), ( 'ppfcz2', 30, 22, 300.5), +( 'ppfcz2', 30, 23, 310.5), ( 'ppfcz2', 30, 24, 320.5), ( 'ppfcz2', 30, 25, 330.5), +( 'ppfcz2', 30, 26, 340.5), ( 'ppfcz2', 30, 27, 350.5), ( 'ppfcz2', 30, 28, 360.5), +( 'ppfcz2', 30, 29, 370.5), ( 'ppfcz2', 30, 30, 381.5), ( 'ppfcz3', 30, 0.5, 74.5), +( 'ppfcz3', 30, 1, 83.5), ( 'ppfcz3', 30, 1.5, 90.5), ( 'ppfcz3', 30, 2, 99.5), +( 'ppfcz3', 30, 2.5, 107.5), ( 'ppfcz3', 30, 3, 114.5), ( 'ppfcz3', 30, 3.5, 122.5), +( 'ppfcz3', 30, 4, 130.5), ( 'ppfcz3', 30, 4.5, 140.5), ( 'ppfcz3', 30, 5, 147.5), +( 'ppfcz3', 30, 6, 162.5), ( 'ppfcz3', 30, 7, 174.5), ( 'ppfcz3', 30, 8, 188.5), +( 'ppfcz3', 30, 9, 201.5), ( 'ppfcz3', 30, 10, 213.5), ( 'ppfcz3', 30, 11, 227.5), +( 'ppfcz3', 30, 12, 240.5), ( 'ppfcz3', 30, 13, 252.5), ( 'ppfcz3', 30, 14, 266.5), +( 'ppfcz3', 30, 15, 278.5), ( 'ppfcz3', 30, 16, 290.5), ( 'ppfcz3', 30, 17, 304.5), +( 'ppfcz3', 30, 18, 317.5), ( 'ppfcz3', 30, 19, 330.5), ( 'ppfcz3', 30, 20, 343.5), +( 'ppfcz3', 30, 21, 354.5), ( 'ppfcz3', 30, 22, 363.5), ( 'ppfcz3', 30, 23, 375.5), +( 'ppfcz3', 30, 24, 385.5), ( 'ppfcz3', 30, 25, 396.5), ( 'ppfcz3', 30, 26, 405.5), +( 'ppfcz3', 30, 27, 417.5), ( 'ppfcz3', 30, 28, 428.5), ( 'ppfcz3', 30, 29, 438.5), +( 'ppfcz3', 30, 30, 448.5), ( 'ppfcz4', 30, 0.5, 90.5), ( 'ppfcz4', 30, 1, 104.5), +( 'ppfcz4', 30, 1.5, 118.5), ( 'ppfcz4', 30, 2, 134.5), ( 'ppfcz4', 30, 2.5, 146.5), +( 'ppfcz4', 30, 3, 163.5), ( 'ppfcz4', 30, 3.5, 179.5), ( 'ppfcz4', 30, 4, 195.5), +( 'ppfcz4', 30, 4.5, 211.5), ( 'ppfcz4', 30, 5, 232.5), ( 'ppfcz4', 30, 6, 257.5), +( 'ppfcz4', 30, 7, 278.5), ( 'ppfcz4', 30, 8, 300.5), ( 'ppfcz4', 30, 9, 321.5), +( 'ppfcz4', 30, 10, 343.5), ( 'ppfcz4', 30, 11, 364.5), ( 'ppfcz4', 30, 12, 386.5), +( 'ppfcz4', 30, 13, 407.5), ( 'ppfcz4', 30, 14, 429.5), ( 'ppfcz4', 30, 15, 450.5), +( 'ppfcz4', 30, 16, 472.5), ( 'ppfcz4', 30, 17, 493.5), ( 'ppfcz4', 30, 18, 515.5), +( 'ppfcz4', 30, 19, 536.5), ( 'ppfcz4', 30, 20, 558.5), ( 'ppfcz4', 30, 21, 579.5), +( 'ppfcz4', 30, 22, 601.5), ( 'ppfcz4', 30, 23, 622.5), ( 'ppfcz4', 30, 24, 644.5), +( 'ppfcz4', 30, 25, 665.5), ( 'ppfcz4', 30, 26, 687.5), ( 'ppfcz4', 30, 27, 708.5), +( 'ppfcz4', 30, 28, 730.5), ( 'ppfcz4', 30, 29, 751.5), ( 'ppfcz4', 30, 30, 773.5), +( 'ppfcz5', 30, 0.5, 97.5), ( 'ppfcz5', 30, 1, 114.5), ( 'ppfcz5', 30, 1.5, 131.5), +( 'ppfcz5', 30, 2, 148.5), ( 'ppfcz5', 30, 2.5, 165.5), ( 'ppfcz5', 30, 3, 183.5), +( 'ppfcz5', 30, 3.5, 200.5), ( 'ppfcz5', 30, 4, 221.5), ( 'ppfcz5', 30, 4.5, 243.5), +( 'ppfcz5', 30, 5, 264.5), ( 'ppfcz5', 30, 6, 289.5), ( 'ppfcz5', 30, 7, 313.5), +( 'ppfcz5', 30, 8, 336.5), ( 'ppfcz5', 30, 9, 360.5), ( 'ppfcz5', 30, 10, 384.5), +( 'ppfcz5', 30, 11, 407.5), ( 'ppfcz5', 30, 12, 431.5), ( 'ppfcz5', 30, 13, 455.5), +( 'ppfcz5', 30, 14, 478.5), ( 'ppfcz5', 30, 15, 502.5), ( 'ppfcz5', 30, 16, 526.5), +( 'ppfcz5', 30, 17, 549.5), ( 'ppfcz5', 30, 18, 573.5), ( 'ppfcz5', 30, 19, 597.5), +( 'ppfcz5', 30, 20, 620.5), ( 'ppfcz5', 30, 21, 644.5), ( 'ppfcz5', 30, 22, 668.5), +( 'ppfcz5', 30, 23, 691.5), ( 'ppfcz5', 30, 24, 715.5), ( 'ppfcz5', 30, 25, 738.5), +( 'ppfcz5', 30, 26, 762.5), ( 'ppfcz5', 30, 27, 786.5), ( 'ppfcz5', 30, 28, 809.5), +( 'ppfcz5', 30, 29, 833.5), ( 'ppfcz5', 30, 30, 857.5), ( 'foreign', 13, 30, 0), +( 'all', 32, 10000, 23.2342007434944); + +--enable_query_log + +INSERT INTO t3 SELECT * FROM t1; + +EXPLAIN +SELECT d FROM t1, t2 +WHERE t2.b=14 AND t2.a=t1.a AND 5.1 Date: Fri, 28 Mar 2008 19:16:52 +0400 Subject: Fix for bug #35392: Delete all statement does not execute properly after few delete statements Problem: changing a file size might require that it must be unmapped beforehand. Fix: unmap the file before changing its size. mysql-test/r/temp_table.result: Fix for bug #35392: Delete all statement does not execute properly after few delete statements - test result. mysql-test/t/temp_table.test: Fix for bug #35392: Delete all statement does not execute properly after few delete statements - test case. storage/myisam/mi_delete_all.c: Fix for bug #35392: Delete all statement does not execute properly after few delete statements - unmap file before changing its size as it's required by SetEndOfFile() function (see my_chsize()). - as no other threads allowed to perform concurrent inserts when delete_all is called, mmap_lock locking removed. --- mysql-test/t/temp_table.test | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/temp_table.test b/mysql-test/t/temp_table.test index d1ad7ab8ffa..4ab8a982e63 100644 --- a/mysql-test/t/temp_table.test +++ b/mysql-test/t/temp_table.test @@ -191,3 +191,17 @@ truncate t1; insert into t1 values (42); select * from t1; drop table t1; + +# +# Bug #35392: Delete all statement does not execute properly after +# few delete statements +# +CREATE TEMPORARY TABLE t1(a INT, b VARCHAR(20)); +INSERT INTO t1 VALUES(1, 'val1'), (2, 'val2'), (3, 'val3'); +DELETE FROM t1 WHERE a=1; +SELECT count(*) FROM t1; +DELETE FROM t1; +SELECT * FROM t1; +DROP TABLE t1; + +--echo End of 5.1 tests -- cgit v1.2.1 From 4ec65151dc8e1b30b05a84c2f3a8bd2b9ce641c6 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Mar 2008 18:59:13 +0300 Subject: Fix for Bug#35469: server crash with LOAD DATA INFILE to a VIEW. The problem was that LOAD DATA code (sql_load.cc) didn't take into account that there may be items, representing references to other columns. This is a usual case in views. The crash happened because Item_direct_view_ref was casted to Item_user_var_as_out_param, which is not a base class. The fix is to 1) Handle references properly; 2) Ensure that an item is treated as a user variable only when it is a user variable indeed; 3) Report an error if LOAD DATA is used to load data into non-updatable column. mysql-test/r/loaddata.result: Update result file. mysql-test/t/loaddata.test: Add a test case form Bug#35469: server crash with LOAD DATA INFILE to a VIEW. sql/share/errmsg.txt: Introduce a new error. sql/sql_load.cc: Handle reference-items properly. mysql-test/std_data/bug35649.data: Add a data file for the test case. --- mysql-test/t/loaddata.test | 82 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index 9eb92015399..68cf84b7fac 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -236,4 +236,86 @@ SELECT * FROM t1; remove_file $MYSQLTEST_VARDIR/tmp/t1; DROP TABLE t1; +########################################################################### + +--echo +--echo # -- +--echo # -- Bug#35469: server crash with LOAD DATA INFILE to a VIEW. +--echo # -- + +--echo +--disable_warnings +DROP TABLE IF EXISTS t1; +DROP VIEW IF EXISTS v1; +DROP VIEW IF EXISTS v2; +DROP VIEW IF EXISTS v3; +--enable_warnings + +--echo +CREATE TABLE t1(c1 INT, c2 VARCHAR(255)); + +--echo +CREATE VIEW v1 AS SELECT * FROM t1; +CREATE VIEW v2 AS SELECT 1 + 2 AS c0, c1, c2 FROM t1; +CREATE VIEW v3 AS SELECT 1 AS d1, 2 AS d2; + +--echo +LOAD DATA INFILE '../std_data_ln/bug35649.data' INTO TABLE v1 + FIELDS ESCAPED BY '\\' + TERMINATED BY ',' + ENCLOSED BY '"' + LINES TERMINATED BY '\n' (c1, c2); + +--echo +SELECT * FROM t1; + +--echo +SELECT * FROM v1; + +--echo +DELETE FROM t1; + +--echo +LOAD DATA INFILE '../std_data_ln/bug35649.data' INTO TABLE v2 + FIELDS ESCAPED BY '\\' + TERMINATED BY ',' + ENCLOSED BY '"' + LINES TERMINATED BY '\n' (c1, c2); + +--echo +SELECT * FROM t1; + +--echo +SELECT * FROM v2; + +--echo +DELETE FROM t1; + +--echo +--error ER_LOAD_DATA_INVALID_COLUMN +LOAD DATA INFILE '../std_data_ln/bug35649.data' INTO TABLE v2 + FIELDS ESCAPED BY '\\' + TERMINATED BY ',' + ENCLOSED BY '"' + LINES TERMINATED BY '\n' (c0, c2); + +--echo +--error ER_NON_UPDATABLE_TABLE +LOAD DATA INFILE '../std_data_ln/bug35649.data' INTO TABLE v3 + FIELDS ESCAPED BY '\\' + TERMINATED BY ',' + ENCLOSED BY '"' + LINES TERMINATED BY '\n' (d1, d2); + +--echo +DROP TABLE t1; +DROP VIEW v1; +DROP VIEW v2; +DROP VIEW v3; + +--echo +--echo # -- End of Bug#35469. + +########################################################################### + # End of 5.0 tests -- cgit v1.2.1 From 7021064aaee66583e8fb2775a335739d6c66fbe5 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Mar 2008 23:39:47 +0300 Subject: Fix tree: 1. Use 'dat' extension, because it is handled in Makefile.am; 2. Fix typo: the bug id is 35469, not 35649. mysql-test/std_data/bug35469.dat: Rename: mysql-test/std_data/bug35649.data -> mysql-test/std_data/bug35469.dat mysql-test/r/loaddata.result: Update result file. mysql-test/t/loaddata.test: 1. Use 'dat' extension, because it is handled in Makefile.am; 2. Fix typo: the bug id is 35469, not 35649. --- mysql-test/t/loaddata.test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index 68cf84b7fac..e9da2bbadc5 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -260,7 +260,7 @@ CREATE VIEW v2 AS SELECT 1 + 2 AS c0, c1, c2 FROM t1; CREATE VIEW v3 AS SELECT 1 AS d1, 2 AS d2; --echo -LOAD DATA INFILE '../std_data_ln/bug35649.data' INTO TABLE v1 +LOAD DATA INFILE '../std_data_ln/bug35469.dat' INTO TABLE v1 FIELDS ESCAPED BY '\\' TERMINATED BY ',' ENCLOSED BY '"' @@ -276,7 +276,7 @@ SELECT * FROM v1; DELETE FROM t1; --echo -LOAD DATA INFILE '../std_data_ln/bug35649.data' INTO TABLE v2 +LOAD DATA INFILE '../std_data_ln/bug35469.dat' INTO TABLE v2 FIELDS ESCAPED BY '\\' TERMINATED BY ',' ENCLOSED BY '"' @@ -293,7 +293,7 @@ DELETE FROM t1; --echo --error ER_LOAD_DATA_INVALID_COLUMN -LOAD DATA INFILE '../std_data_ln/bug35649.data' INTO TABLE v2 +LOAD DATA INFILE '../std_data_ln/bug35469.dat' INTO TABLE v2 FIELDS ESCAPED BY '\\' TERMINATED BY ',' ENCLOSED BY '"' @@ -301,7 +301,7 @@ LOAD DATA INFILE '../std_data_ln/bug35649.data' INTO TABLE v2 --echo --error ER_NON_UPDATABLE_TABLE -LOAD DATA INFILE '../std_data_ln/bug35649.data' INTO TABLE v3 +LOAD DATA INFILE '../std_data_ln/bug35469.dat' INTO TABLE v3 FIELDS ESCAPED BY '\\' TERMINATED BY ',' ENCLOSED BY '"' -- cgit v1.2.1 From 2a001d5389241f0f3cd3debe295ec3ed3c0eea3c Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 30 Mar 2008 00:54:08 +0200 Subject: Bug #35675 reset master finds assert if a binlog file can not be deleted If a binlog file is manually replaced with a namesake directory the internal purging did not handle the error of deleting the file so that eventually a post-execution guards fires an assert. Fixed with reusing a snippet of code for bug@18199 to tolerate lack of the file but no other error at an attempt to delete it. The same applied to the index file deletion. The cset carries pieces of manual merging. mysql-test/r/binlog_index.result: new results mysql-test/r/ctype_big5.result: results changed mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result: new results mysql-test/suite/binlog/r/binlog_stm_blackhole.result: new results mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test: cleanup. still todo: to let the test run multiple times w/o restarting the server (just ./mtr test) mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result: results changed mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test: guarding the test with statement format condition as the logics of the test requires sql/log.cc: two changes. One for the bug, other manual merge. The bug change needs MYF(0) to pass to my_delete because not all error out of the function are critical. The finer check is done on the caller of my_delete similarly how it was implemented for bug@18199 fixes. Non-existance of a file is not a critical error. sql/sql_class.cc: manual merge, removing extra automatically brought hunk. --- mysql-test/t/rpl_auto_increment_bug33029.test | 109 -------------------------- 1 file changed, 109 deletions(-) delete mode 100644 mysql-test/t/rpl_auto_increment_bug33029.test (limited to 'mysql-test/t') diff --git a/mysql-test/t/rpl_auto_increment_bug33029.test b/mysql-test/t/rpl_auto_increment_bug33029.test deleted file mode 100644 index db548945c7f..00000000000 --- a/mysql-test/t/rpl_auto_increment_bug33029.test +++ /dev/null @@ -1,109 +0,0 @@ -# BUG#33029 5.0 to 5.1 replication fails on dup key when inserting -# using a trig in SP - -# For all 5.0 up to 5.0.58 exclusive, and 5.1 up to 5.1.12 exclusive, -# if one statement in a SP generated AUTO_INCREMENT value by the top -# statement, all statements after it would be considered generated -# AUTO_INCREMENT value by the top statement, and a erroneous INSERT_ID -# value might be associated with these statement, which could cause -# duplicate entry error and stop the slave. - -source include/master-slave.inc; - ---disable_warnings -DROP TABLE IF EXISTS t1, t2; -DROP PROCEDURE IF EXISTS p1; -DROP PROCEDURE IF EXISTS p2; -DROP TRIGGER IF EXISTS tr1; -DROP FUNCTION IF EXISTS f1; ---enable_warnings - -CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY); -CREATE TABLE t2 (id INT AUTO_INCREMENT PRIMARY KEY); - -delimiter //; - -CREATE PROCEDURE p1() -BEGIN - DECLARE ins_count INT DEFAULT 10; - - WHILE ins_count > 0 DO - INSERT INTO t1 VALUES (NULL); - SET ins_count = ins_count - 1; - END WHILE; - - DELETE FROM t1 WHERE id = 1; - DELETE FROM t1 WHERE id = 2; - DELETE FROM t2 WHERE id = 1; - DELETE FROM t2 WHERE id = 2; -END// - -CREATE PROCEDURE p2() -BEGIN - INSERT INTO t1 VALUES (NULL); - DELETE FROM t1 WHERE id = f1(3); - DELETE FROM t1 WHERE id = f1(4); - DELETE FROM t2 WHERE id = 3; - DELETE FROM t2 WHERE id = 4; -END// - -CREATE TRIGGER tr1 BEFORE DELETE - ON t1 FOR EACH ROW - BEGIN - INSERT INTO t2 VALUES (NULL); - END// - -CREATE FUNCTION f1 (i int) RETURNS int - BEGIN - INSERT INTO t2 VALUES (NULL); - RETURN i; - END// - -delimiter ;// - -# the $binlog_start will be used by the show_binlog_events.inc, so -# that we can skip binlog events we don't care -let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); -CALL p1(); -source include/show_binlog_events.inc; - -echo # Result on master; -SELECT * FROM t1; -SELECT * FROM t2; - -sync_slave_with_master; - -echo # Result on slave; -SELECT * FROM t1; -SELECT * FROM t2; - -connection master; - -DROP TRIGGER tr1; - -# the $binlog_start will be used by the show_binlog_events.inc, so -# that we can skip binlog events we don't care -let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); -CALL p2(); -source include/show_binlog_events.inc; - -echo # Result on master; -SELECT * FROM t1; -SELECT * FROM t2; - -sync_slave_with_master; - -echo # Result on slave; -SELECT * FROM t1; -SELECT * FROM t2; - -# clean up -connection master; -disable_warnings; -DROP TABLE IF EXISTS t1, t2; -DROP PROCEDURE IF EXISTS p1; -DROP PROCEDURE IF EXISTS p2; -DROP FUNCTION IF EXISTS f1; -DROP TRIGGER IF EXISTS tr1; -enable_warnings; -sync_slave_with_master; -- cgit v1.2.1