From 3462b6d3d29eebc246dbf8942baffd0ae5dd0b4f Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 15 Aug 2013 10:47:18 +0200 Subject: [PATCH] fix tests that were relying on @@have_partitioning sql/sql_partition_admin.cc: compilation failures w/o partitioning --- mysql-test/include/have_partition.inc | 8 +-- mysql-test/include/have_partition.opt | 2 +- mysql-test/r/disabled_partition.require | 2 - mysql-test/r/have_partition.require | 2 - mysql-test/r/not_partition.require | 2 - mysql-test/r/not_partition.result | 6 +-- .../sys_vars/r/have_partitioning_basic.result | 53 ------------------- mysql-test/t/not_partition.test | 8 +-- mysql-test/t/partition_disabled.test | 8 +-- sql/sql_partition_admin.cc | 4 +- 10 files changed, 18 insertions(+), 77 deletions(-) delete mode 100644 mysql-test/r/disabled_partition.require delete mode 100644 mysql-test/r/have_partition.require delete mode 100644 mysql-test/r/not_partition.require delete mode 100644 mysql-test/suite/sys_vars/r/have_partitioning_basic.result diff --git a/mysql-test/include/have_partition.inc b/mysql-test/include/have_partition.inc index b45572ad31e..50dc98ac1ed 100644 --- a/mysql-test/include/have_partition.inc +++ b/mysql-test/include/have_partition.inc @@ -1,4 +1,4 @@ --- require r/have_partition.require -disable_query_log; -show variables like 'have_partitioning'; -enable_query_log; +if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'partition' AND PLUGIN_STATUS='ACTIVE'`) +{ + --skip Test requires partitioning +} diff --git a/mysql-test/include/have_partition.opt b/mysql-test/include/have_partition.opt index efbbfda3921..9c511d27dce 100644 --- a/mysql-test/include/have_partition.opt +++ b/mysql-test/include/have_partition.opt @@ -1 +1 @@ ---enable-partition +--loose-enable-partition diff --git a/mysql-test/r/disabled_partition.require b/mysql-test/r/disabled_partition.require deleted file mode 100644 index a21c259447a..00000000000 --- a/mysql-test/r/disabled_partition.require +++ /dev/null @@ -1,2 +0,0 @@ -Variable_name Value -have_partitioning DISABLED diff --git a/mysql-test/r/have_partition.require b/mysql-test/r/have_partition.require deleted file mode 100644 index 324c04eed6f..00000000000 --- a/mysql-test/r/have_partition.require +++ /dev/null @@ -1,2 +0,0 @@ -Variable_name Value -have_partitioning YES diff --git a/mysql-test/r/not_partition.require b/mysql-test/r/not_partition.require deleted file mode 100644 index 808242277cb..00000000000 --- a/mysql-test/r/not_partition.require +++ /dev/null @@ -1,2 +0,0 @@ -Variable_name Value -have_partitioning NO diff --git a/mysql-test/r/not_partition.result b/mysql-test/r/not_partition.result index adda476da95..8bff8708a86 100644 --- a/mysql-test/r/not_partition.result +++ b/mysql-test/r/not_partition.result @@ -50,7 +50,7 @@ ERROR HY000: The 'partitioning' feature is disabled; you need MariaDB built with ALTER TABLE t1 PARTITION BY KEY(joined) PARTITIONS 2; ERROR HY000: The 'partitioning' feature is disabled; you need MariaDB built with '--with-plugin-partition' to have it working drop table t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' CREATE TABLE t1 ( firstname VARCHAR(25) NOT NULL, lastname VARCHAR(25) NOT NULL, @@ -67,7 +67,7 @@ PARTITION p4 VALUES LESS THAN MAXVALUE ); ERROR HY000: The 'partitioning' feature is disabled; you need MariaDB built with '--with-plugin-partition' to have it working drop table t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' CREATE TABLE t1 (id INT, purchased DATE) PARTITION BY RANGE( YEAR(purchased) ) SUBPARTITION BY HASH( TO_DAYS(purchased) ) @@ -78,7 +78,7 @@ PARTITION p2 VALUES LESS THAN MAXVALUE ); ERROR HY000: The 'partitioning' feature is disabled; you need MariaDB built with '--with-plugin-partition' to have it working drop table t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' create table t1 (a varchar(10) charset latin1 collate latin1_bin); insert into t1 values (''),(' '),('a'),('a '),('a '); explain partitions select * from t1 where a='a ' OR a='a'; diff --git a/mysql-test/suite/sys_vars/r/have_partitioning_basic.result b/mysql-test/suite/sys_vars/r/have_partitioning_basic.result deleted file mode 100644 index 8a18288a3ec..00000000000 --- a/mysql-test/suite/sys_vars/r/have_partitioning_basic.result +++ /dev/null @@ -1,53 +0,0 @@ -'#---------------------BS_STVARS_014_01----------------------#' -SELECT COUNT(@@GLOBAL.have_partitioning); -COUNT(@@GLOBAL.have_partitioning) -1 -1 Expected -'#---------------------BS_STVARS_014_02----------------------#' -SET @@GLOBAL.have_partitioning=1; -ERROR HY000: Variable 'have_partitioning' is a read only variable -Expected error 'Read only variable' -SELECT COUNT(@@GLOBAL.have_partitioning); -COUNT(@@GLOBAL.have_partitioning) -1 -1 Expected -'#---------------------BS_STVARS_014_03----------------------#' -SELECT @@GLOBAL.have_partitioning = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_partitioning'; -@@GLOBAL.have_partitioning = VARIABLE_VALUE -1 -1 Expected -SELECT COUNT(@@GLOBAL.have_partitioning); -COUNT(@@GLOBAL.have_partitioning) -1 -1 Expected -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_partitioning'; -COUNT(VARIABLE_VALUE) -1 -1 Expected -'#---------------------BS_STVARS_014_04----------------------#' -SELECT @@have_partitioning = @@GLOBAL.have_partitioning; -@@have_partitioning = @@GLOBAL.have_partitioning -1 -1 Expected -'#---------------------BS_STVARS_014_05----------------------#' -SELECT COUNT(@@have_partitioning); -COUNT(@@have_partitioning) -1 -1 Expected -SELECT COUNT(@@local.have_partitioning); -ERROR HY000: Variable 'have_partitioning' is a GLOBAL variable -Expected error 'Variable is a GLOBAL variable' -SELECT COUNT(@@SESSION.have_partitioning); -ERROR HY000: Variable 'have_partitioning' is a GLOBAL variable -Expected error 'Variable is a GLOBAL variable' -SELECT COUNT(@@GLOBAL.have_partitioning); -COUNT(@@GLOBAL.have_partitioning) -1 -1 Expected -SELECT have_partitioning = @@SESSION.have_partitioning; -ERROR 42S22: Unknown column 'have_partitioning' in 'field list' -Expected error 'Readonly variable' diff --git a/mysql-test/t/not_partition.test b/mysql-test/t/not_partition.test index b930214e008..a4faa794e3d 100644 --- a/mysql-test/t/not_partition.test +++ b/mysql-test/t/not_partition.test @@ -2,10 +2,10 @@ # Run this test only when mysqld doesn't have partitioning (not compiled with) # the statements are not expected to work, just check that we # can't crash the server --- require r/not_partition.require -disable_query_log; -show variables like "have_partitioning"; -enable_query_log; +if (`SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'partition'`) +{ + --skip Test requires no partitioning +} --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings diff --git a/mysql-test/t/partition_disabled.test b/mysql-test/t/partition_disabled.test index 798fb0aa59e..c3e6cd5119f 100644 --- a/mysql-test/t/partition_disabled.test +++ b/mysql-test/t/partition_disabled.test @@ -2,10 +2,10 @@ # Run this test only when mysqld has partitioning, but it is disabled. # The statements are not expected to work, just check that we # can't crash the server. ---require r/disabled_partition.require ---disable_query_log -show variables like "have_partitioning"; ---enable_query_log +if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'partition' AND PLUGIN_STATUS='DISABLED'`) +{ + --skip Test requires disabled partitioning +} --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc index 1a82413bb07..29ca86fa274 100644 --- a/sql/sql_partition_admin.cc +++ b/sql/sql_partition_admin.cc @@ -32,9 +32,9 @@ #ifndef WITH_PARTITION_STORAGE_ENGINE -bool Partition_statement_unsupported::execute(THD *) +bool Sql_cmd_partition_unsupported::execute(THD *) { - DBUG_ENTER("Partition_statement_unsupported::execute"); + DBUG_ENTER("Sql_cmd_partition_unsupported::execute"); /* error, partitioning support not compiled in... */ my_error(ER_FEATURE_DISABLED, MYF(0), "partitioning", "--with-plugin-partition");