diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-07-02 22:08:51 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-07-02 22:08:51 +0200 |
commit | 9809f05199aeb0b67991fac41bd86f38730768dc (patch) | |
tree | fa2792ff86d0da014b535d743759810612338042 /mysql-test/suite/parts/inc | |
parent | 0accbd0364e0333e0b119aa9ce93e34ded9df6cb (diff) | |
parent | 5a0e7394a5ae0c7b6a1ea35b7ea3a8985325987a (diff) | |
download | mariadb-git-9809f05199aeb0b67991fac41bd86f38730768dc.tar.gz |
5.5-merge
Diffstat (limited to 'mysql-test/suite/parts/inc')
-rw-r--r-- | mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc | 71 | ||||
-rw-r--r-- | mysql-test/suite/parts/inc/partition_auto_increment.inc | 49 | ||||
-rw-r--r-- | mysql-test/suite/parts/inc/partition_check.inc | 10 | ||||
-rw-r--r-- | mysql-test/suite/parts/inc/partition_check_drop.inc | 11 | ||||
-rw-r--r-- | mysql-test/suite/parts/inc/partition_crash.inc | 6 | ||||
-rw-r--r-- | mysql-test/suite/parts/inc/partition_decimal.inc | 9 | ||||
-rw-r--r-- | mysql-test/suite/parts/inc/partition_double.inc | 58 | ||||
-rw-r--r-- | mysql-test/suite/parts/inc/partition_fail.inc | 24 | ||||
-rw-r--r-- | mysql-test/suite/parts/inc/partition_float.inc | 58 | ||||
-rw-r--r-- | mysql-test/suite/parts/inc/partition_layout.inc | 2 | ||||
-rw-r--r-- | mysql-test/suite/parts/inc/partition_layout_check1.inc | 18 | ||||
-rw-r--r-- | mysql-test/suite/parts/inc/partition_layout_check2.inc | 12 |
12 files changed, 132 insertions, 196 deletions
diff --git a/mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc b/mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc index 25a9774d2a1..b7a170dd9d8 100644 --- a/mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc +++ b/mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc @@ -39,29 +39,6 @@ let $val3 = 17 ; let $val4 = 15 ; --source suite/parts/inc/partition_supported_sql_funcs.inc - -let $sqlfunc = ceiling(col1); -let $valsqlfunc = ceiling(15); -let $coltype = float(7,4); -let $infile = part_supported_sql_funcs_int_float.inc; -let $val1 = 5.1230; -let $val2 = 13.345; -let $val3 = 17.987; -let $val4 = 15.654 ; -# DISABLED due to bug 30577 -#--source suite/parts/inc/partition_supported_sql_funcs.inc - -let $sqlfunc = floor(col1); -let $valsqlfunc = floor(15.123); -let $coltype = float(7,4); -let $infile = part_supported_sql_funcs_int_float.inc; -let $val1 = 5.1230; -let $val2 = 13.345; -let $val3 = 17.987; -let $val4 = 15.654 ; -# DISABLED due to bug 30577 -#--source suite/parts/inc/partition_supported_sql_funcs.inc - let $sqlfunc = mod(col1,10); let $valsqlfunc = mod(15,10); let $coltype = int; @@ -111,8 +88,9 @@ let $val2 = '2006-01-17'; let $val3 = '2006-02-25'; let $val4 = '2006-02-05'; --source suite/parts/inc/partition_supported_sql_funcs.inc -let $coltype = char(30); ---source suite/parts/inc/partition_supported_sql_funcs.inc +# Disabled after fixing bug#54483. +#let $coltype = char(30); +#--source suite/parts/inc/partition_supported_sql_funcs.inc let $sqlfunc = extract(month from col1); let $valsqlfunc = extract(year from '1998-11-23'); @@ -162,8 +140,9 @@ let $val2 = '14:30:20'; let $val3 = '21:59:22'; let $val4 = '10:22:33'; --source suite/parts/inc/partition_supported_sql_funcs.inc -let $coltype = char(30); ---source suite/parts/inc/partition_supported_sql_funcs.inc +# second(non_time_col) is disabled after bug#54483. +#let $coltype = char(30); +#--source suite/parts/inc/partition_supported_sql_funcs.inc let $sqlfunc = month(col1); let $valsqlfunc = month('2006-10-14'); @@ -195,26 +174,28 @@ let $val3 = '21:59:22'; let $val4 = '10:33:11'; --source suite/parts/inc/partition_supported_sql_funcs.inc -let $sqlfunc = to_days(col1)-to_days('2006-01-01'); -let $valsqlfunc = to_days('2006-02-02')-to_days('2006-01-01'); -let $coltype = date; -let $infile = part_supported_sql_funcs_int_date.inc; -let $val1 = '2006-02-03'; -let $val2 = '2006-01-17'; -let $val3 = '2006-01-25'; -let $val4 = '2006-02-06'; ---source suite/parts/inc/partition_supported_sql_funcs.inc +# to_days(non_date_col) is disabled after bug#54483. +#let $sqlfunc = to_days(col1)-to_days('2006-01-01'); +#let $valsqlfunc = to_days('2006-02-02')-to_days('2006-01-01'); +#let $coltype = date; +#let $infile = part_supported_sql_funcs_int_date.inc; +#let $val1 = '2006-02-03'; +#let $val2 = '2006-01-17'; +#let $val3 = '2006-01-25'; +#let $val4 = '2006-02-06'; +#--source suite/parts/inc/partition_supported_sql_funcs.inc +# to_days(non_date_col) is disabled after bug#54483. # DATEDIFF() is implemented as (TO_DAYS(d1) - TO_DAYS(d2)) -let $sqlfunc = datediff(col1, '2006-01-01'); -let $valsqlfunc = datediff('2006-02-02', '2006-01-01'); -let $coltype = date; -let $infile = part_supported_sql_funcs_int_date.inc; -let $val1 = '2006-02-03'; -let $val2 = '2006-01-17'; -let $val3 = '2006-01-25'; -let $val4 = '2006-02-06'; ---source suite/parts/inc/partition_supported_sql_funcs.inc +#let $sqlfunc = datediff(col1, '2006-01-01'); +#let $valsqlfunc = datediff('2006-02-02', '2006-01-01'); +#let $coltype = date; +#let $infile = part_supported_sql_funcs_int_date.inc; +#let $val1 = '2006-02-03'; +#let $val2 = '2006-01-17'; +#let $val3 = '2006-01-25'; +#let $val4 = '2006-02-06'; +#--source suite/parts/inc/partition_supported_sql_funcs.inc let $sqlfunc = weekday(col1); let $valsqlfunc = weekday('2006-10-14'); diff --git a/mysql-test/suite/parts/inc/partition_auto_increment.inc b/mysql-test/suite/parts/inc/partition_auto_increment.inc index 102e57d3d04..034460d49ac 100644 --- a/mysql-test/suite/parts/inc/partition_auto_increment.inc +++ b/mysql-test/suite/parts/inc/partition_auto_increment.inc @@ -105,6 +105,30 @@ OPTIMIZE TABLE t1; SHOW CREATE TABLE t1; DROP TABLE t1; +if (!$skip_update) +{ +eval CREATE TABLE t1 +(a INT NULL AUTO_INCREMENT, + UNIQUE KEY (a)) +ENGINE=$engine; +SET LAST_INSERT_ID = 999; +SET INSERT_ID = 0; +INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL; +SELECT LAST_INSERT_ID(); +SELECT * FROM t1; +INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL; +SELECT LAST_INSERT_ID(); +SELECT * FROM t1; +UPDATE t1 SET a = 1 WHERE a IS NULL; +SELECT LAST_INSERT_ID(); +SELECT * FROM t1; +UPDATE t1 SET a = NULL WHERE a = 1; +SELECT LAST_INSERT_ID(); +SELECT * FROM t1; +DROP TABLE t1; +SET INSERT_ID = 1; +} + -- echo # Simple test with NULL eval CREATE TABLE t1 ( c1 INT NOT NULL AUTO_INCREMENT, @@ -831,5 +855,30 @@ SELECT * FROM t ORDER BY c1 ASC; DROP TABLE t; +if (!$skip_update) +{ +eval CREATE TABLE t1 +(a INT NULL AUTO_INCREMENT, + UNIQUE KEY (a)) +ENGINE=$engine +PARTITION BY KEY(a) PARTITIONS 2; +SET LAST_INSERT_ID = 999; +SET INSERT_ID = 0; +INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL; +SELECT LAST_INSERT_ID(); +SELECT * FROM t1; +INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL; +SELECT LAST_INSERT_ID(); +SELECT * FROM t1; +UPDATE t1 SET a = 1 WHERE a IS NULL; +SELECT LAST_INSERT_ID(); +SELECT * FROM t1; +UPDATE t1 SET a = NULL WHERE a = 1; +SELECT LAST_INSERT_ID(); +SELECT * FROM t1; +DROP TABLE t1; +} + + --echo ############################################################################## } diff --git a/mysql-test/suite/parts/inc/partition_check.inc b/mysql-test/suite/parts/inc/partition_check.inc index 19d548cc8ef..235764a034f 100644 --- a/mysql-test/suite/parts/inc/partition_check.inc +++ b/mysql-test/suite/parts/inc/partition_check.inc @@ -177,7 +177,7 @@ let $any_unique= `SELECT @my_errno IN ($ER_DUP_KEY,$ER_DUP_ENTRY)`; # @my_errno AS sql_errno; if (`SELECT @my_errno NOT IN (0,$ER_DUP_KEY,$ER_DUP_ENTRY)`) { - --echo # The last command got an unexepected error response. + --echo # The last command got an unexpected error response. --echo # Expected/handled SQL codes are 0,$ER_DUP_KEY,$ER_DUP_ENTRY SELECT '# SQL code we got was: ' AS "", @my_errno AS ""; --echo # Sorry, have to abort. @@ -219,7 +219,7 @@ if ($any_unique) # @my_errno AS sql_errno; if (`SELECT @my_errno NOT IN (0,$ER_DUP_KEY,$ER_DUP_ENTRY)`) { - --echo # The last command got an unexepected error response. + --echo # The last command got an unexpected error response. --echo # Expected/handled SQL codes are 0,$ER_DUP_KEY,$ER_DUP_ENTRY SELECT '# SQL code we got was: ' AS "", @my_errno AS ""; --echo # Sorry, have to abort. @@ -255,7 +255,7 @@ if ($any_unique) # @my_errno AS sql_errno; if (`SELECT @my_errno NOT IN (0,$ER_DUP_KEY,$ER_DUP_ENTRY)`) { - --echo # The last command got an unexepected error response. + --echo # The last command got an unexpected error response. --echo # Expected/handled SQL codes are 0,$ER_DUP_KEY,$ER_DUP_ENTRY SELECT '# SQL code we got was: ' AS "", @my_errno AS ""; --echo # Sorry, have to abort. @@ -503,7 +503,7 @@ if ($no_debug) eval SET @my_errno = $mysql_errno; if (`SELECT @my_errno NOT IN (0,$ER_SAME_NAME_PARTITION,$ER_NO_PARTITION_FOR_GIVEN_VALUE)`) { - --echo # The last command got an unexepected error response. + --echo # The last command got an unexpected error response. --echo # Expected/handled SQL codes are 0,$ER_SAME_NAME_PARTITION,$ER_NO_PARTITION_FOR_GIVEN_VALUE SELECT '# SQL code we got was: ' AS "", @my_errno AS ""; --echo # Sorry, have to abort. @@ -566,7 +566,7 @@ eval SET @my_errno = $mysql_errno; let $run= `SELECT @my_errno = 0`; if (`SELECT @my_errno NOT IN (0,$ER_BAD_NULL_ERROR)`) { - --echo # The last command got an unexepected error response. + --echo # The last command got an unexpected error response. --echo # Expected/handled SQL codes are 0,$ER_BAD_NULL_ERROR SELECT '# SQL code we got was: ' AS "", @my_errno AS ""; --echo # Sorry, have to abort. diff --git a/mysql-test/suite/parts/inc/partition_check_drop.inc b/mysql-test/suite/parts/inc/partition_check_drop.inc index daaa5e541c7..7f8b5b7929b 100644 --- a/mysql-test/suite/parts/inc/partition_check_drop.inc +++ b/mysql-test/suite/parts/inc/partition_check_drop.inc @@ -26,16 +26,18 @@ if ($do_file_tests) { let $ls_file= $MYSQLD_DATADIR/test/tmp2; # List the files belonging to the table t1 + --replace_result $MYSQLTEST_VARDIR \$MYSQLTEST_VARDIR #p# #P# #sp# #SP# --list_files_write_file $ls_file $MYSQLD_DATADIR/test t1* --chmod 0644 $ls_file if ($with_directories) { + --replace_result $MYSQLTEST_VARDIR \$MYSQLTEST_VARDIR #p# #P# #sp# #SP# --list_files_append_file $ls_file $MYSQLTEST_VARDIR/tmp t1* } eval SET @aux = load_file('$ls_file'); # clean up - remove_file $ls_file; + --remove_file $ls_file } if (!$do_file_tests) { @@ -60,16 +62,15 @@ if ($found_garbage) --echo # <alter partitioning> worked incomplete. --echo # We found: # Print the list of files into the protocol - eval SELECT REPLACE(file_list,'$MYSQLTEST_VARDIR','\$MYSQLTEST_VARDIR') - AS "unified filelist" + eval SELECT file_list AS "unified filelist" FROM t0_definition WHERE state = 'old'; } # Do a manual cleanup, because the following tests should not suffer from # remaining files - --exec rm -f $MYSQLD_DATADIR/test/t1* || true + --remove_files_wildcard $MYSQLD_DATADIR/test t1* if ($with_directories) { - --exec rm -f $MYSQLTEST_VARDIR/tmp/t1* || true + --remove_files_wildcard $MYSQLTEST_VARDIR/tmp t1* } } --enable_query_log diff --git a/mysql-test/suite/parts/inc/partition_crash.inc b/mysql-test/suite/parts/inc/partition_crash.inc index f18b8728784..b8a7c61792b 100644 --- a/mysql-test/suite/parts/inc/partition_crash.inc +++ b/mysql-test/suite/parts/inc/partition_crash.inc @@ -3,7 +3,7 @@ --eval $create_statement --eval $insert_statement --echo # State before crash ---replace_result #p# #P# +--replace_result #p# #P# #sp# #SP# --list_files $DATADIR/test SHOW CREATE TABLE t1; --sorted_result @@ -14,13 +14,13 @@ SELECT * FROM t1; --error 2013 --eval $crash_statement --echo # State after crash (before recovery) ---replace_regex /sqlx.*\./sqlx-nnnn_nnnn./ /#p#/#P#/ +--replace_regex /sqlx.*\./sqlx-nnnn_nnnn./ /#p#/#P#/ /#sp#/#SP#/ /#tmp#/#TMP#/ --list_files $DATADIR/test --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --enable_reconnect --source include/wait_until_connected_again.inc --echo # State after crash recovery ---replace_result #p# #P# +--replace_result #p# #P# #sp# #SP# --list_files $DATADIR/test SHOW CREATE TABLE t1; --sorted_result diff --git a/mysql-test/suite/parts/inc/partition_decimal.inc b/mysql-test/suite/parts/inc/partition_decimal.inc index 95ef878b957..93e9e48c9c9 100644 --- a/mysql-test/suite/parts/inc/partition_decimal.inc +++ b/mysql-test/suite/parts/inc/partition_decimal.inc @@ -39,10 +39,8 @@ drop table t2; # Bug 30577: FLOOR() and CEILING() not usable as partition functions # Partition functions are required to return INT_RESULT; FLOOR() and -# CEILING() do not, unless they have an INT argument. Disable this -# portion of the test until bug 30577 is fixed. +# CEILING() do not, unless they have an INT or DECIMAL argument. ---disable_parsing eval create table t3 (a decimal(18,9) not null, primary key(a)) engine=$engine partition by range (floor(a)) subpartition by key (a) subpartitions 2 ( @@ -70,7 +68,7 @@ select count(*) from t3; drop table t3; eval create table t4 (a decimal(18,9) not null, primary key(a)) engine=$engine -partition by list (floor(a)) subpartition by key (a) subpartitions 2 ( +partition by list (ceiling(a)) subpartition by key (a) subpartitions 2 ( partition pa2 values in (1,2), partition pa4 values in (3,4), partition pa6 values in (5,6), @@ -93,6 +91,3 @@ commit; --enable_query_log select count(*) from t4; drop table t4; - -# Disabled due to Bug 30577 ---enable_parsing diff --git a/mysql-test/suite/parts/inc/partition_double.inc b/mysql-test/suite/parts/inc/partition_double.inc index aef5aa4f675..9e43887be09 100644 --- a/mysql-test/suite/parts/inc/partition_double.inc +++ b/mysql-test/suite/parts/inc/partition_double.inc @@ -37,61 +37,3 @@ commit; select count(*) from t2; drop table t2; - -# Bug 30577: FLOOR() and CEILING() not usable as partition functions -# Partition functions are required to return INT_RESULT; FLOOR() and -# CEILING() do not, unless they have an INT argument. Disable this -# portion of the test until bug 30577 is fixed. - ---disable_parsing - -eval create table t3 (a double not null, primary key(a)) engine=$engine -partition by range (floor(a)) subpartition by key (a) subpartitions 3 ( -partition pa1 values less than (3), -partition pa3 values less than (6), -partition pa10 values less than (10) -); -show create table t3; -let $count=9; ---echo $count*3 inserts; ---disable_query_log -begin; -while ($count) -{ -eval insert into t3 values ($count); -eval insert into t3 values ($count+0.33); -eval insert into t3 values ($count+0.75); -dec $count; -} -commit; ---enable_query_log -select count(*) from t3; -select * from t3; -drop table t3; - -eval create table t4 (a double not null, primary key(a)) engine=$engine -partition by list (floor(a)) subpartition by key (a) subpartitions 3 ( -partition pa1 values in (1,2,3), -partition pa3 values in (4,5,6), -partition pa10 values in (7,8,9,10) -); -show create table t4; -let $count=9; ---echo $count*3 inserts; ---disable_query_log -begin; -while ($count) -{ -eval insert into t4 values ($count); -eval insert into t4 values ($count+0.33); -eval insert into t4 values ($count+0.75); -dec $count; -} -commit; ---enable_query_log -select count(*) from t4; -select * from t4; -drop table t4; - -# Disabled due to Bug 30577 ---enable_parsing diff --git a/mysql-test/suite/parts/inc/partition_fail.inc b/mysql-test/suite/parts/inc/partition_fail.inc index 6942b40042a..dd79cdf1dc8 100644 --- a/mysql-test/suite/parts/inc/partition_fail.inc +++ b/mysql-test/suite/parts/inc/partition_fail.inc @@ -3,6 +3,7 @@ --eval $create_statement --eval $insert_statement --echo # State before failure +--replace_result #p# #P# #sp# #SP# --list_files $DATADIR/test SHOW CREATE TABLE t1; --sorted_result @@ -11,8 +12,31 @@ SELECT * FROM t1; --eval $fail_statement --enable_abort_on_error --echo # State after failure +--replace_result #p# #P# #sp# #SP# --list_files $DATADIR/test SHOW CREATE TABLE t1; --sorted_result SELECT * FROM t1; DROP TABLE t1; + +--echo # Same test under LOCK TABLE +--eval $create_statement +--eval $insert_statement +--echo # State before failure +--replace_result #p# #P# #sp# #SP# +--list_files $DATADIR/test +SHOW CREATE TABLE t1; +--sorted_result +SELECT * FROM t1; +LOCK TABLE t1 WRITE; +--disable_abort_on_error +--eval $fail_statement +--enable_abort_on_error +--echo # State after failure +--replace_result #p# #P# #sp# #SP# +--list_files $DATADIR/test +SHOW CREATE TABLE t1; +--sorted_result +SELECT * FROM t1; +UNLOCK TABLES; +DROP TABLE t1; diff --git a/mysql-test/suite/parts/inc/partition_float.inc b/mysql-test/suite/parts/inc/partition_float.inc index 8da12a3e5bd..b9c6af84fc4 100644 --- a/mysql-test/suite/parts/inc/partition_float.inc +++ b/mysql-test/suite/parts/inc/partition_float.inc @@ -40,61 +40,3 @@ commit; --enable_query_log select count(*) from t2; drop table t2; - -# Bug 30577: FLOOR() and CEILING() not usable as partition functions -# Partition functions are required to return INT_RESULT; FLOOR() and -# CEILING() do not, unless they have an INT argument. Disable this -# portion of the test until bug 30577 is fixed. - ---disable_parsing - -eval create table t3 (a float not null, primary key(a)) engine=$engine -partition by range (floor(a)) subpartition by key (a) subpartitions 3 ( -partition pa1 values less than (3), -partition pa3 values less than (6), -partition pa10 values less than (10) -); -show create table t3; -let $count=9; ---echo $count*3 inserts; ---disable_query_log -begin; -while ($count) -{ -eval insert into t3 values ($count); -eval insert into t3 values ($count+0.33); -eval insert into t3 values ($count+0.75); -dec $count; -} -commit; ---enable_query_log -select count(*) from t3; -select * from t3; -drop table t3; - -eval create table t4 (a float not null, primary key(a)) engine=$engine -partition by list (floor(a)) subpartition by key (a) subpartitions 3 ( -partition pa1 values in (1,2,3), -partition pa3 values in (4,5,6), -partition pa10 values in (7,8,9,10) -); -show create table t4; -let $count=9; ---echo $count*3 inserts; ---disable_query_log -begin; -while ($count) -{ -eval insert into t4 values ($count); -eval insert into t4 values ($count+0.33); -eval insert into t4 values ($count+0.75); -dec $count; -} -commit; ---enable_query_log -select count(*) from t4; -select * from t4; -drop table t4; - -# Disabled due to Bug 30577 ---enable_parsing diff --git a/mysql-test/suite/parts/inc/partition_layout.inc b/mysql-test/suite/parts/inc/partition_layout.inc index 67d0fd4c0e9..12fbfb9a46a 100644 --- a/mysql-test/suite/parts/inc/partition_layout.inc +++ b/mysql-test/suite/parts/inc/partition_layout.inc @@ -10,6 +10,6 @@ eval SHOW CREATE TABLE t1; if ($ls) { let $MYSQLD_DATADIR= `select @@datadir`; - --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR + --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR #p# #P# #sp# #SP# --list_files $MYSQLD_DATADIR/test t1* } diff --git a/mysql-test/suite/parts/inc/partition_layout_check1.inc b/mysql-test/suite/parts/inc/partition_layout_check1.inc index bca41b6f9c7..76df4c1a250 100644 --- a/mysql-test/suite/parts/inc/partition_layout_check1.inc +++ b/mysql-test/suite/parts/inc/partition_layout_check1.inc @@ -29,14 +29,10 @@ DELETE FROM t0_definition; let $MYSQLD_DATADIR= `select LEFT(@@datadir, LENGTH(@@datadir)-1)`; #echo MYSQLD_DATADIR: $MYSQLD_DATADIR; -# Dump the current definition of the table t1 to tmp1 -# This complicated method - let another mysqltest collect the output - is used -# because of two reasons +# Save the current definition of the table t1 # - SHOW CREATE TABLE t1 is at least currently most probably more reliable than # the corresponding SELECT on the INFORMATION_SCHEMA -# - SHOW CREATE TABLE .. cannot write its out put into a file like SELECT -let $show_file= $MYSQLD_DATADIR/test/tmp1; ---exec echo "SHOW CREATE TABLE t1; exit; " | $MYSQL_TEST > $show_file 2>&1 +let $show_create= `SHOW CREATE TABLE t1`; if ($do_file_tests) { # List the files belonging to the table t1 @@ -49,6 +45,9 @@ if ($do_file_tests) --list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-test-idx-dir t1* } eval SET @aux = load_file('$ls_file'); + + # clean up + --remove_file $ls_file } if (!$do_file_tests) { @@ -57,19 +56,20 @@ if (!$do_file_tests) # Insert the current definition of the table t1 into t0_definition eval INSERT INTO t0_definition SET state = 'old', - create_command = load_file('$show_file'), + create_command = "$show_create", file_list = @aux; # Print the create table statement into the protocol +# Added the concat to avoid changing the result files --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR '\r' '' -SELECT create_command FROM t0_definition WHERE state = 'old'; +SELECT concat('SHOW CREATE TABLE t1;\nTable\tCreate Table\n',create_command,'\n') as `create_command` FROM t0_definition WHERE state = 'old'; if ($do_file_tests) { # We stored the list of files, therefore printing the content makes sense if ($ls) { # Print the list of files into the protocol - replace_result $MYSQLD_DATADIR MYSQLD_DATADIR $MYSQLTEST_VARDIR MYSQLTEST_VARDIR; + replace_result $MYSQLD_DATADIR MYSQLD_DATADIR $MYSQLTEST_VARDIR MYSQLTEST_VARDIR #p# #P# #sp# #SP# part_n part_N; SELECT file_list AS "unified filelist" FROM t0_definition WHERE state = 'old'; } diff --git a/mysql-test/suite/parts/inc/partition_layout_check2.inc b/mysql-test/suite/parts/inc/partition_layout_check2.inc index 7ff871a4c45..23e4a9e1e95 100644 --- a/mysql-test/suite/parts/inc/partition_layout_check2.inc +++ b/mysql-test/suite/parts/inc/partition_layout_check2.inc @@ -28,9 +28,8 @@ DELETE FROM t0_definition WHERE state = 'new'; let $MYSQLD_DATADIR= `select LEFT(@@datadir, LENGTH(@@datadir)-1)`; #echo MYSQLD_DATADIR: $MYSQLD_DATADIR; -# Dump the current definition of the table t1 to tmp1 -let $show_file= $MYSQLD_DATADIR/test/tmp1; ---exec echo "SHOW CREATE TABLE t1; exit; " | $MYSQL_TEST > $show_file 2>&1 +# Save the current definition of the table t1 +let $show_create= `SHOW CREATE TABLE t1`; if ($do_file_tests) { @@ -44,6 +43,9 @@ if ($do_file_tests) --list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-test-idx-dir t1* } eval SET @aux = load_file('$ls_file'); + + # clean up + --remove_file $ls_file } if (!$do_file_tests) { @@ -52,7 +54,7 @@ if (!$do_file_tests) # Insert the current definition of the table t1 into t0_definition eval INSERT INTO t0_definition SET state = 'new', - create_command = load_file('$show_file'), + create_command = "$show_create", file_list = @aux; # Print the old and new table layout, if they differ @@ -65,7 +67,7 @@ let $run= `SELECT @aux`; if ($run) { --vertical_results - --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR + --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR #p# #P# #sp# #SP# SELECT state, REPLACE(create_command,'\n',' ') AS "Table definition", REPLACE(file_list ,'\n',' ') AS "File list" |