diff options
author | Sergei Golubchik <sergii@pisem.net> | 2010-03-23 10:22:33 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2010-03-23 10:22:33 +0100 |
commit | 2b17c453a7267dad0ad9cca1e2d929b05f1e226d (patch) | |
tree | e1a080ba2435860de3af59d9a7e28e261cf28393 | |
parent | b0ce621d137367e6401d2273e74ff5b66f315d54 (diff) | |
download | mariadb-git-2b17c453a7267dad0ad9cca1e2d929b05f1e226d.tar.gz |
portability fix for vcol.vcol_partition_myisam test
-rw-r--r-- | mysql-test/suite/vcol/inc/vcol_partition.inc | 45 | ||||
-rw-r--r-- | mysql-test/suite/vcol/r/vcol_partition_innodb.result | 22 | ||||
-rw-r--r-- | mysql-test/suite/vcol/r/vcol_partition_myisam.result | 39 |
3 files changed, 50 insertions, 56 deletions
diff --git a/mysql-test/suite/vcol/inc/vcol_partition.inc b/mysql-test/suite/vcol/inc/vcol_partition.inc index a7f65256684..c20dfaaa2a4 100644 --- a/mysql-test/suite/vcol/inc/vcol_partition.inc +++ b/mysql-test/suite/vcol/inc/vcol_partition.inc @@ -36,27 +36,14 @@ insert into t1 values ('2007-01-01',default); insert into t1 values ('2005-01-01',default); select * from t1; -# Specifically for MyISAM, check that data is written into correct -# $MYSQLTEST_VARDIR/mysqld.1/data/test/t1*p?.MYD files -let $myisam_engine = `select @@session.storage_engine='myisam'`; -if ($myisam_engine) -{ - --echo # Check how data is physically partitioned. - --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR - --exec du -b $MYSQLTEST_VARDIR/mysqld.1/data/test/t1*p?.MYD -} +select partition_name,table_rows,data_length from information_schema.partitions where table_name = 't1'; --echo # Modify the expression of virtual column b ALTER TABLE t1 modify b int as (year(a)-1); select * from t1; -if ($myisam_engine) -{ - --echo # Check how data is physically partitioned. - --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR - --exec du -b $MYSQLTEST_VARDIR/mysqld.1/data/test/t1*p?.MYD -} +select partition_name,table_rows,data_length from information_schema.partitions where table_name = 't1'; drop table t1; @@ -67,12 +54,7 @@ PARTITION BY LIST (a+1) (PARTITION p1 VALUES IN (1), PARTITION p2 VALUES IN (2)); insert into t1 values (1,default); -if ($myisam_engine) -{ - --echo # Check how data is physically partitioned. - --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR - --exec du -b $MYSQLTEST_VARDIR/mysqld.1/data/test/t1*p?.MYD -} +select partition_name,table_rows,data_length from information_schema.partitions where table_name = 't1'; select * from t1; # @@ -115,12 +97,7 @@ select * from t1; #alter table t1 change b b int as ((a % 3)+1) persistent; #--error ER_NO_PARTITION_FOR_GIVEN_VALUE #alter table t1 change b b int as (a % 2) persistent; -#if ($myisam_engine) -#{ -# --echo # Check how data is physically partitioned. -# --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -# --exec du -b $MYSQLTEST_VARDIR/mysqld.1/data/test/t1*p?.MYD -#} +#select partition_name,table_rows,data_length from information_schema.partitions where table_name = 't1'; select * from t1; @@ -138,23 +115,13 @@ insert into t1 values ('2005-01-01',default); insert into t1 values ('2006-01-01',default); select * from t1; -if ($myisam_engine) -{ - --echo # Check how data is physically partitioned. - --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR - --exec du -b $MYSQLTEST_VARDIR/mysqld.1/data/test/t1*p?.MYD -} +select partition_name,table_rows,data_length from information_schema.partitions where table_name = 't1'; --echo # Modify the expression of virtual column b ALTER TABLE t1 modify b int as (year(a)-1); select * from t1; -if ($myisam_engine) -{ - --echo # Check how data is physically partitioned. - --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR - --exec du -b $MYSQLTEST_VARDIR/mysqld.1/data/test/t1*p?.MYD -} +select partition_name,table_rows,data_length from information_schema.partitions where table_name = 't1'; drop table t1; diff --git a/mysql-test/suite/vcol/r/vcol_partition_innodb.result b/mysql-test/suite/vcol/r/vcol_partition_innodb.result index a754581e98d..466c1851800 100644 --- a/mysql-test/suite/vcol/r/vcol_partition_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_partition_innodb.result @@ -17,6 +17,10 @@ a b 2005-01-01 2005 2006-01-01 2006 2007-01-01 2007 +select partition_name,table_rows,data_length from information_schema.partitions where table_name = 't1'; +partition_name table_rows data_length +p0 1 16384 +p2 2 16384 # Modify the expression of virtual column b ALTER TABLE t1 modify b int as (year(a)-1); select * from t1; @@ -24,12 +28,20 @@ a b 2005-01-01 2004 2006-01-01 2005 2007-01-01 2006 +select partition_name,table_rows,data_length from information_schema.partitions where table_name = 't1'; +partition_name table_rows data_length +p0 2 16384 +p2 1 16384 drop table t1; # Case 2. Partitioning by LIST based on a stored virtual column. CREATE TABLE t1 (a int, b int as (a % 3 ) persistent) PARTITION BY LIST (a+1) (PARTITION p1 VALUES IN (1), PARTITION p2 VALUES IN (2)); insert into t1 values (1,default); +select partition_name,table_rows,data_length from information_schema.partitions where table_name = 't1'; +partition_name table_rows data_length +p1 0 16384 +p2 1 16384 select * from t1; a b 1 1 @@ -49,10 +61,20 @@ select * from t1; a b 2005-01-01 2005 2006-01-01 2006 +select partition_name,table_rows,data_length from information_schema.partitions where table_name = 't1'; +partition_name table_rows data_length +p0 0 16384 +p1 1 16384 +p2 1 16384 # Modify the expression of virtual column b ALTER TABLE t1 modify b int as (year(a)-1); select * from t1; a b 2005-01-01 2004 2006-01-01 2005 +select partition_name,table_rows,data_length from information_schema.partitions where table_name = 't1'; +partition_name table_rows data_length +p0 1 16384 +p1 1 16384 +p2 0 16384 drop table t1; diff --git a/mysql-test/suite/vcol/r/vcol_partition_myisam.result b/mysql-test/suite/vcol/r/vcol_partition_myisam.result index 5d04df9e1a8..9a92f308c45 100644 --- a/mysql-test/suite/vcol/r/vcol_partition_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_partition_myisam.result @@ -17,9 +17,10 @@ a b 2005-01-01 2005 2006-01-01 2006 2007-01-01 2007 -# Check how data is physically partitioned. -7 MYSQLTEST_VARDIR/mysqld.1/data/test/t1#P#p0.MYD -14 MYSQLTEST_VARDIR/mysqld.1/data/test/t1#P#p2.MYD +select partition_name,table_rows,data_length from information_schema.partitions where table_name = 't1'; +partition_name table_rows data_length +p0 1 7 +p2 2 14 # Modify the expression of virtual column b ALTER TABLE t1 modify b int as (year(a)-1); select * from t1; @@ -27,18 +28,20 @@ a b 2005-01-01 2004 2006-01-01 2005 2007-01-01 2006 -# Check how data is physically partitioned. -14 MYSQLTEST_VARDIR/mysqld.1/data/test/t1#P#p0.MYD -7 MYSQLTEST_VARDIR/mysqld.1/data/test/t1#P#p2.MYD +select partition_name,table_rows,data_length from information_schema.partitions where table_name = 't1'; +partition_name table_rows data_length +p0 2 14 +p2 1 7 drop table t1; # Case 2. Partitioning by LIST based on a stored virtual column. CREATE TABLE t1 (a int, b int as (a % 3 ) persistent) PARTITION BY LIST (a+1) (PARTITION p1 VALUES IN (1), PARTITION p2 VALUES IN (2)); insert into t1 values (1,default); -# Check how data is physically partitioned. -0 MYSQLTEST_VARDIR/mysqld.1/data/test/t1#P#p1.MYD -9 MYSQLTEST_VARDIR/mysqld.1/data/test/t1#P#p2.MYD +select partition_name,table_rows,data_length from information_schema.partitions where table_name = 't1'; +partition_name table_rows data_length +p1 0 0 +p2 1 9 select * from t1; a b 1 1 @@ -58,18 +61,20 @@ select * from t1; a b 2005-01-01 2005 2006-01-01 2006 -# Check how data is physically partitioned. -0 MYSQLTEST_VARDIR/mysqld.1/data/test/t1#P#p0.MYD -7 MYSQLTEST_VARDIR/mysqld.1/data/test/t1#P#p1.MYD -7 MYSQLTEST_VARDIR/mysqld.1/data/test/t1#P#p2.MYD +select partition_name,table_rows,data_length from information_schema.partitions where table_name = 't1'; +partition_name table_rows data_length +p0 0 0 +p1 1 7 +p2 1 7 # Modify the expression of virtual column b ALTER TABLE t1 modify b int as (year(a)-1); select * from t1; a b 2005-01-01 2004 2006-01-01 2005 -# Check how data is physically partitioned. -7 MYSQLTEST_VARDIR/mysqld.1/data/test/t1#P#p0.MYD -7 MYSQLTEST_VARDIR/mysqld.1/data/test/t1#P#p1.MYD -0 MYSQLTEST_VARDIR/mysqld.1/data/test/t1#P#p2.MYD +select partition_name,table_rows,data_length from information_schema.partitions where table_name = 't1'; +partition_name table_rows data_length +p0 1 7 +p1 1 7 +p2 0 0 drop table t1; |