Browse Source

fix tests that were relying on @@have_partitioning

sql/sql_partition_admin.cc:
  compilation failures w/o partitioning
pull/3/head
Sergei Golubchik 13 years ago
parent
commit
3462b6d3d2
  1. 8
      mysql-test/include/have_partition.inc
  2. 2
      mysql-test/include/have_partition.opt
  3. 2
      mysql-test/r/disabled_partition.require
  4. 2
      mysql-test/r/have_partition.require
  5. 2
      mysql-test/r/not_partition.require
  6. 6
      mysql-test/r/not_partition.result
  7. 53
      mysql-test/suite/sys_vars/r/have_partitioning_basic.result
  8. 8
      mysql-test/t/not_partition.test
  9. 8
      mysql-test/t/partition_disabled.test
  10. 4
      sql/sql_partition_admin.cc

8
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
}

2
mysql-test/include/have_partition.opt

@ -1 +1 @@
--enable-partition
--loose-enable-partition

2
mysql-test/r/disabled_partition.require

@ -1,2 +0,0 @@
Variable_name Value
have_partitioning DISABLED

2
mysql-test/r/have_partition.require

@ -1,2 +0,0 @@
Variable_name Value
have_partitioning YES

2
mysql-test/r/not_partition.require

@ -1,2 +0,0 @@
Variable_name Value
have_partitioning NO

6
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';

53
mysql-test/suite/sys_vars/r/have_partitioning_basic.result

@ -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'

8
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

8
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

4
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");

Loading…
Cancel
Save