2005-07-20 14:46:02 +02:00
|
|
|
#
|
2009-02-18 21:29:30 +01:00
|
|
|
# Simple test for the erroneos statements using the
|
2005-07-20 14:46:02 +02:00
|
|
|
# partition storage engine
|
|
|
|
#
|
|
|
|
-- source include/have_partition.inc
|
|
|
|
|
WL #2604: Partition Management
Optimised version of ADD/DROP/REORGANIZE partitions for
non-NDB storage engines.
New syntax to handle REBUILD/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
Quite a few bug fixes
include/thr_lock.h:
New method to downgrade locks from TL_WRITE_ONLY
Possibility to upgrade lock while aborting locks
mysql-test/r/ndb_autodiscover.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_bitfield.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_gis.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_partition_key.result:
New test case
mysql-test/r/partition.result:
New test case
mysql-test/r/partition_error.result:
New test case
mysql-test/r/partition_mgm_err.result:
Fix of test case results
mysql-test/t/disabled.def:
partition_03ndb still has bug
mysql-test/t/ndb_partition_key.test:
New test cases for new functionality and bugs
mysql-test/t/partition.test:
New test cases for new functionality and bugs
mysql-test/t/partition_error.test:
New test cases for new functionality and bugs
mysql-test/t/partition_mgm_err.test:
New test cases for new functionality and bugs
mysys/thr_lock.c:
New method to downgrade TL_WRITE_ONLY locks
Possibility to specify if locks are to be upgraded at abort locks
sql/ha_archive.cc:
New handlerton methods
sql/ha_berkeley.cc:
New handlerton methods
sql/ha_blackhole.cc:
New handlerton methods
sql/ha_federated.cc:
New handlerton methods
sql/ha_heap.cc:
New handlerton methods
sql/ha_innodb.cc:
New handlerton methods
sql/ha_myisam.cc:
New handlerton methods
sql/ha_myisammrg.cc:
New handlerton methods
sql/ha_ndbcluster.cc:
New handlerton methods
Moved out packfrm and unpackfrm methods
Adapted many parts to use table_share instead of table->s
Ensured that .ndb file uses filename and not tablename
according to new encoding of names (WL 1324)
All NDB tables are partitioned and set up partition info
Fixed such that tablenames use tablenames and not filenames in NDB
NDB uses auto partitioning for ENGINE=NDB tables
Warning for very large tables
Set RANGE data
Set LIST data
New method to set-up partition info
Set Default number of partitions flag
Set linear hash flag
Set node group array
Set number of fragments
Set max rows
Set tablespace names
New method to get number of partitions of table to use at open table
sql/ha_ndbcluster.h:
Removed partition_flags and alter_table_flags from handler class
A couple of new and changed method headers
sql/ha_ndbcluster_binlog.cc:
Use new method headers
sql/ha_partition.cc:
New handlerton methods
Lots of new function headers
Use #P# as separator between table name and partition name and
#SP# as separator between partition name and subpartition name
Use filename encoding for files both of table name part and of
partition name parts
New method to drop partitions based on partition state
New method to rename partitions based on partition state
New methods to optimize, analyze, check and repair partitions
New methods to optimize, analyze, check and repair table
Helper method to create new partition, open it and external lock
it, not needed to lock it internally since no one else knows about
it yet.
Cleanup method at error for new partitions
New methods to perform bulk of work at ADD/REORGANIZE partitions
(change_partitions, copy_partitions)
sql/ha_partition.h:
New methods and variables
A few dropped ones and a few changed ones
sql/handler.cc:
Handlerton interface changes
New flag to open_table_from_share
sql/handler.h:
New alter_table_flags
New partition flags
New partition states
More states for default handling
Lots of new, dropped and changed interfaces
sql/lex.h:
Added REBUILD and changed name of REORGANISE to REORGANIZE
sql/lock.cc:
Method to downgrade locks
Able to specify if locks upgraded on abort locks
sql/log.cc:
New handlerton methods
sql/mysql_priv.h:
Lots of new interfaces
sql/share/errmsg.txt:
Lots of new, dropped and changed error messages
sql/sql_base.cc:
Adapted to new method headers
New method to abort and upgrade lock
New method to close open tables and downgrade lock
New method to wait for completed table
sql/sql_lex.h:
New flags
sql/sql_partition.cc:
Return int instead of bool in get_partition_id
More defaults handling
Make use of new mem_alloc_error method
More work on function headers
Changes to generate partition syntax to cater for intermediate
partition states
Lots of new code with large comments describing new features for
Partition Management:
ADD/DROP/REORGANIZE/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
sql/sql_show.cc:
Minors
sql/sql_table.cc:
Moved a couple of methods
New methods to copy create lists and key lists
for use with mysql_prepare_table
New method to write frm file
New handling of handlers with auto partitioning
Fix CREATE TABLE LIKE
Moved code for ADD/DROP/REORGANIZE partitions
Use handlerton method for alter_table_flags
sql/sql_yacc.yy:
More memory alloc error checks
New syntax for REBUILD, ANALYZE, CHECK, OPTIMIZE, REPAIR partitions
sql/table.cc:
Fix length of extra part to be 4 bytes
Partition state introduced in frm file
sql/table.h:
Partition state introduced
sql/unireg.cc:
Partition state introduced
Default partition
storage/csv/ha_tina.cc:
New handlerton methods
storage/example/ha_example.cc:
New handlerton methods
storage/ndb/include/kernel/ndb_limits.h:
RANGE DATA
storage/ndb/include/kernel/signaldata/AlterTable.hpp:
New interfaces in ALTER TABLE towards NDB kernel
storage/ndb/include/kernel/signaldata/DiAddTab.hpp:
New section
storage/ndb/include/kernel/signaldata/DictTabInfo.hpp:
Lots of new parts of table description
storage/ndb/include/kernel/signaldata/LqhFrag.hpp:
tablespace id specified in LQHFRAGREQ
storage/ndb/include/ndbapi/NdbDictionary.hpp:
Lots of new methods in NDB dictionary
storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
New error insertion
storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp:
a few extra jam's
storage/ndb/src/ndbapi/NdbBlob.cpp:
Changes to definition of blob tables
storage/ndb/src/ndbapi/NdbDictionary.cpp:
Lots of new stuff in NDB dictionary
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Lots of new stuff in NDB dictionary
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp:
Lots of new stuff in NDB dictionary
storage/ndb/test/ndbapi/test_event.cpp:
removed use of methods no longer in existence
storage/ndb/tools/restore/Restore.cpp:
Renamed variable
2006-01-17 08:40:00 +01:00
|
|
|
--disable_warnings
|
2010-08-30 17:33:55 +02:00
|
|
|
drop table if exists t1, t2;
|
WL #2604: Partition Management
Optimised version of ADD/DROP/REORGANIZE partitions for
non-NDB storage engines.
New syntax to handle REBUILD/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
Quite a few bug fixes
include/thr_lock.h:
New method to downgrade locks from TL_WRITE_ONLY
Possibility to upgrade lock while aborting locks
mysql-test/r/ndb_autodiscover.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_bitfield.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_gis.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_partition_key.result:
New test case
mysql-test/r/partition.result:
New test case
mysql-test/r/partition_error.result:
New test case
mysql-test/r/partition_mgm_err.result:
Fix of test case results
mysql-test/t/disabled.def:
partition_03ndb still has bug
mysql-test/t/ndb_partition_key.test:
New test cases for new functionality and bugs
mysql-test/t/partition.test:
New test cases for new functionality and bugs
mysql-test/t/partition_error.test:
New test cases for new functionality and bugs
mysql-test/t/partition_mgm_err.test:
New test cases for new functionality and bugs
mysys/thr_lock.c:
New method to downgrade TL_WRITE_ONLY locks
Possibility to specify if locks are to be upgraded at abort locks
sql/ha_archive.cc:
New handlerton methods
sql/ha_berkeley.cc:
New handlerton methods
sql/ha_blackhole.cc:
New handlerton methods
sql/ha_federated.cc:
New handlerton methods
sql/ha_heap.cc:
New handlerton methods
sql/ha_innodb.cc:
New handlerton methods
sql/ha_myisam.cc:
New handlerton methods
sql/ha_myisammrg.cc:
New handlerton methods
sql/ha_ndbcluster.cc:
New handlerton methods
Moved out packfrm and unpackfrm methods
Adapted many parts to use table_share instead of table->s
Ensured that .ndb file uses filename and not tablename
according to new encoding of names (WL 1324)
All NDB tables are partitioned and set up partition info
Fixed such that tablenames use tablenames and not filenames in NDB
NDB uses auto partitioning for ENGINE=NDB tables
Warning for very large tables
Set RANGE data
Set LIST data
New method to set-up partition info
Set Default number of partitions flag
Set linear hash flag
Set node group array
Set number of fragments
Set max rows
Set tablespace names
New method to get number of partitions of table to use at open table
sql/ha_ndbcluster.h:
Removed partition_flags and alter_table_flags from handler class
A couple of new and changed method headers
sql/ha_ndbcluster_binlog.cc:
Use new method headers
sql/ha_partition.cc:
New handlerton methods
Lots of new function headers
Use #P# as separator between table name and partition name and
#SP# as separator between partition name and subpartition name
Use filename encoding for files both of table name part and of
partition name parts
New method to drop partitions based on partition state
New method to rename partitions based on partition state
New methods to optimize, analyze, check and repair partitions
New methods to optimize, analyze, check and repair table
Helper method to create new partition, open it and external lock
it, not needed to lock it internally since no one else knows about
it yet.
Cleanup method at error for new partitions
New methods to perform bulk of work at ADD/REORGANIZE partitions
(change_partitions, copy_partitions)
sql/ha_partition.h:
New methods and variables
A few dropped ones and a few changed ones
sql/handler.cc:
Handlerton interface changes
New flag to open_table_from_share
sql/handler.h:
New alter_table_flags
New partition flags
New partition states
More states for default handling
Lots of new, dropped and changed interfaces
sql/lex.h:
Added REBUILD and changed name of REORGANISE to REORGANIZE
sql/lock.cc:
Method to downgrade locks
Able to specify if locks upgraded on abort locks
sql/log.cc:
New handlerton methods
sql/mysql_priv.h:
Lots of new interfaces
sql/share/errmsg.txt:
Lots of new, dropped and changed error messages
sql/sql_base.cc:
Adapted to new method headers
New method to abort and upgrade lock
New method to close open tables and downgrade lock
New method to wait for completed table
sql/sql_lex.h:
New flags
sql/sql_partition.cc:
Return int instead of bool in get_partition_id
More defaults handling
Make use of new mem_alloc_error method
More work on function headers
Changes to generate partition syntax to cater for intermediate
partition states
Lots of new code with large comments describing new features for
Partition Management:
ADD/DROP/REORGANIZE/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
sql/sql_show.cc:
Minors
sql/sql_table.cc:
Moved a couple of methods
New methods to copy create lists and key lists
for use with mysql_prepare_table
New method to write frm file
New handling of handlers with auto partitioning
Fix CREATE TABLE LIKE
Moved code for ADD/DROP/REORGANIZE partitions
Use handlerton method for alter_table_flags
sql/sql_yacc.yy:
More memory alloc error checks
New syntax for REBUILD, ANALYZE, CHECK, OPTIMIZE, REPAIR partitions
sql/table.cc:
Fix length of extra part to be 4 bytes
Partition state introduced in frm file
sql/table.h:
Partition state introduced
sql/unireg.cc:
Partition state introduced
Default partition
storage/csv/ha_tina.cc:
New handlerton methods
storage/example/ha_example.cc:
New handlerton methods
storage/ndb/include/kernel/ndb_limits.h:
RANGE DATA
storage/ndb/include/kernel/signaldata/AlterTable.hpp:
New interfaces in ALTER TABLE towards NDB kernel
storage/ndb/include/kernel/signaldata/DiAddTab.hpp:
New section
storage/ndb/include/kernel/signaldata/DictTabInfo.hpp:
Lots of new parts of table description
storage/ndb/include/kernel/signaldata/LqhFrag.hpp:
tablespace id specified in LQHFRAGREQ
storage/ndb/include/ndbapi/NdbDictionary.hpp:
Lots of new methods in NDB dictionary
storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
New error insertion
storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp:
a few extra jam's
storage/ndb/src/ndbapi/NdbBlob.cpp:
Changes to definition of blob tables
storage/ndb/src/ndbapi/NdbDictionary.cpp:
Lots of new stuff in NDB dictionary
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Lots of new stuff in NDB dictionary
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp:
Lots of new stuff in NDB dictionary
storage/ndb/test/ndbapi/test_event.cpp:
removed use of methods no longer in existence
storage/ndb/tools/restore/Restore.cpp:
Renamed variable
2006-01-17 08:40:00 +01:00
|
|
|
--enable_warnings
|
2010-05-25 15:41:00 +02:00
|
|
|
|
|
|
|
let $MYSQLD_DATADIR= `SELECT @@datadir`;
|
|
|
|
|
2013-09-27 14:58:49 +02:00
|
|
|
--echo #
|
|
|
|
--echo # Bug#60039: crash when exchanging a partition on
|
|
|
|
--echo # nonpartitioned table with a view
|
|
|
|
--echo #
|
|
|
|
CREATE TABLE t1 (a int);
|
|
|
|
CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1;
|
|
|
|
--error ER_CHECK_NO_SUCH_TABLE
|
|
|
|
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE v1;
|
|
|
|
DROP VIEW v1;
|
|
|
|
DROP TABLE t1;
|
|
|
|
|
2012-02-02 12:47:17 +01:00
|
|
|
--echo #
|
|
|
|
--echo # Bug#13608188 - 64038: CRASH IN HANDLER::HA_THD ON ALTER TABLE AFTER
|
|
|
|
--echo # REPAIR NON-EXISTING PARTITION
|
|
|
|
--echo #
|
|
|
|
CREATE TABLE t1 ( a INT, b INT );
|
|
|
|
INSERT INTO t1 VALUES (5,3),(5,6);
|
|
|
|
ALTER TABLE t1 PARTITION BY KEY(b) PARTITIONS 3 ;
|
|
|
|
ALTER TABLE t1 REPAIR PARTITION p1, p3;
|
|
|
|
ALTER TABLE t1 ORDER BY b;
|
|
|
|
DROP TABLE t1;
|
|
|
|
|
|
|
|
--echo #
|
|
|
|
--echo # Bug#13593865 - 64037: CRASH IN HA_PARTITION::CREATE_HANDLERS ON
|
|
|
|
--echo # ALTER TABLE AFTER DROP PARTITION
|
|
|
|
--echo #
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY RANGE (a)
|
|
|
|
(PARTITION p0 VALUES LESS THAN (0),
|
|
|
|
PARTITION p1 VALUES LESS THAN MAXVALUE ) ;
|
|
|
|
|
|
|
|
ALTER TABLE t1 DROP PARTITION p1;
|
|
|
|
ALTER TABLE t1 ANALYZE PARTITION p0, p1;
|
|
|
|
|
|
|
|
ALTER TABLE t1 COMMENT 'altered';
|
|
|
|
|
|
|
|
DROP TABLE t1;
|
|
|
|
|
2011-01-10 16:20:28 +01:00
|
|
|
--echo #
|
|
|
|
--echo # Bug#57924: crash when creating partitioned table with
|
|
|
|
--echo # multiple columns in the partition key
|
|
|
|
--echo #
|
2011-01-26 19:33:53 +01:00
|
|
|
--error ER_SAME_NAME_PARTITION_FIELD
|
2011-01-10 16:20:28 +01:00
|
|
|
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b))
|
|
|
|
PARTITION BY KEY(a, b, a);
|
|
|
|
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b))
|
|
|
|
PARTITION BY KEY(A, b);
|
|
|
|
DROP TABLE t1;
|
2011-01-26 19:33:53 +01:00
|
|
|
--error ER_SAME_NAME_PARTITION_FIELD
|
2011-01-10 16:20:28 +01:00
|
|
|
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b))
|
|
|
|
PARTITION BY KEY(a, b, A);
|
|
|
|
|
2011-01-26 16:50:21 +01:00
|
|
|
|
2010-12-22 10:50:36 +01:00
|
|
|
--echo #
|
|
|
|
--echo # Bug#54483: valgrind errors when making warnings for multiline inserts
|
|
|
|
--echo # into partition
|
|
|
|
--echo #
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARBINARY(10))
|
|
|
|
PARTITION BY RANGE (DAYOFWEEK(a))
|
|
|
|
(PARTITION a1 VALUES LESS THAN (60));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a CHAR(10))
|
|
|
|
PARTITION BY RANGE (DAYOFWEEK(a))
|
|
|
|
(PARTITION a1 VALUES LESS THAN (60));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY RANGE (DAYOFWEEK(a))
|
|
|
|
(PARTITION a1 VALUES LESS THAN (60));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a TIMESTAMP)
|
|
|
|
PARTITION BY RANGE (DAYOFWEEK(a))
|
|
|
|
(PARTITION a1 VALUES LESS THAN (60));
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY RANGE (DAYOFWEEK(a))
|
|
|
|
(PARTITION a1 VALUES LESS THAN (60));
|
2017-02-08 21:28:00 +01:00
|
|
|
INSERT IGNORE INTO t1 VALUES ('test'),('a'),('5');
|
2010-12-22 10:50:36 +01:00
|
|
|
SHOW WARNINGS;
|
|
|
|
DROP TABLE t1;
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY RANGE (DAYOFWEEK(a))
|
|
|
|
(PARTITION a1 VALUES LESS THAN (60));
|
2017-02-08 21:28:00 +01:00
|
|
|
INSERT IGNORE INTO t1 VALUES ('test'),('a'),('5');
|
2010-12-22 10:50:36 +01:00
|
|
|
SHOW WARNINGS;
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY RANGE (DAYOFWEEK(a))
|
|
|
|
(PARTITION a1 VALUES LESS THAN (60));
|
|
|
|
SHOW WARNINGS;
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (TO_DAYS(a));
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (TO_DAYS(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (TO_DAYS(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (TO_DAYS(a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (TO_DAYS(a));
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (DAYOFMONTH(a));
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (DAYOFMONTH(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (DAYOFMONTH(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (DAYOFMONTH(a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (DAYOFMONTH(a));
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (MONTH(a));
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (MONTH(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (MONTH(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (MONTH(a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (MONTH(a));
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (DAYOFYEAR(a));
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (DAYOFYEAR(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (DAYOFYEAR(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (DAYOFYEAR(a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (DAYOFYEAR(a));
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (HOUR(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (HOUR(a));
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (HOUR(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (HOUR(a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (HOUR(a));
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (MINUTE(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (MINUTE(a));
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (MINUTE(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (MINUTE(a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (MINUTE(a));
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (QUARTER(a));
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (QUARTER(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (QUARTER(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (QUARTER(a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (QUARTER(a));
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (SECOND(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (SECOND(a));
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (SECOND(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (SECOND(a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (SECOND(a));
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (YEARWEEK(a));
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (YEARWEEK(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (YEARWEEK(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (YEARWEEK(a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (YEARWEEK(a));
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (WEEKDAY(a));
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (WEEKDAY(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (WEEKDAY(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (WEEKDAY(a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (WEEKDAY(a));
|
|
|
|
|
2011-01-10 15:08:31 +01:00
|
|
|
--echo # TO_SECONDS() is added in 5.5.
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
2010-12-22 10:50:36 +01:00
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (TO_SECONDS(a));
|
2011-01-10 15:08:31 +01:00
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (TO_SECONDS(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (TO_SECONDS(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (TO_SECONDS(a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (TO_SECONDS(a));
|
2010-12-22 10:50:36 +01:00
|
|
|
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (TIME_TO_SEC(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (TIME_TO_SEC(a));
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (TIME_TO_SEC(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (TIME_TO_SEC(a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (TIME_TO_SEC(a));
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (FROM_DAYS(a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (FROM_DAYS(a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (FROM_DAYS(a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (TO_DAYS(FROM_DAYS(a)));
|
|
|
|
--error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (FROM_DAYS(a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (TO_DAYS(FROM_DAYS(a)));
|
|
|
|
--error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (FROM_DAYS(a));
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (MICROSECOND(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (MICROSECOND(a));
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (MICROSECOND(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (MICROSECOND(a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (MICROSECOND(a));
|
|
|
|
--echo # Bug#57071
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1
|
|
|
|
(`date` date,
|
|
|
|
`extracted_week` int,
|
|
|
|
`yearweek` int,
|
|
|
|
`week` int,
|
|
|
|
`default_week_format` int)
|
|
|
|
PARTITION BY LIST (EXTRACT(WEEK FROM date) % 3)
|
|
|
|
(PARTITION p0 VALUES IN (0),
|
|
|
|
PARTITION p1 VALUES IN (1),
|
|
|
|
PARTITION p2 VALUES IN (2));
|
|
|
|
CREATE TABLE t1
|
|
|
|
(`date` date,
|
|
|
|
`extracted_week` int,
|
|
|
|
`yearweek` int,
|
|
|
|
`week` int,
|
|
|
|
`default_week_format` int);
|
|
|
|
SET @old_default_week_format := @@default_week_format;
|
|
|
|
SET default_week_format = 0;
|
|
|
|
INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
|
|
|
|
SET default_week_format = 1;
|
|
|
|
INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
|
|
|
|
SET default_week_format = 2;
|
|
|
|
INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
|
|
|
|
SET default_week_format = 3;
|
|
|
|
INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
|
|
|
|
SET default_week_format = 4;
|
|
|
|
INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
|
|
|
|
SET default_week_format = 5;
|
|
|
|
INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
|
|
|
|
SET default_week_format = 6;
|
|
|
|
INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
|
|
|
|
SET default_week_format = 7;
|
|
|
|
INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
|
|
|
|
SELECT * FROM t1;
|
|
|
|
SET default_week_format = @old_default_week_format;
|
|
|
|
DROP TABLE t1;
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(YEAR FROM a));
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (EXTRACT(YEAR FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(YEAR FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (EXTRACT(YEAR FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (EXTRACT(YEAR FROM a));
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(QUARTER FROM a));
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (EXTRACT(QUARTER FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(QUARTER FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (EXTRACT(QUARTER FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (EXTRACT(QUARTER FROM a));
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(MONTH FROM a));
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (EXTRACT(MONTH FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(MONTH FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (EXTRACT(MONTH FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (EXTRACT(MONTH FROM a));
|
|
|
|
|
|
|
|
--echo # EXTRACT(WEEK...) is disallowed, see bug#57071.
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(WEEK FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (EXTRACT(WEEK FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(WEEK FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (EXTRACT(WEEK FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (EXTRACT(WEEK FROM a));
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY FROM a));
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY FROM a));
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(HOUR FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (EXTRACT(HOUR FROM a));
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(HOUR FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (EXTRACT(HOUR FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (EXTRACT(HOUR FROM a));
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(MINUTE FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (EXTRACT(MINUTE FROM a));
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(MINUTE FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (EXTRACT(MINUTE FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (EXTRACT(MINUTE FROM a));
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(SECOND FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (EXTRACT(SECOND FROM a));
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(SECOND FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (EXTRACT(SECOND FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (EXTRACT(SECOND FROM a));
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a TIME, b DATE)
|
|
|
|
PARTITION BY HASH (DATEDIFF(a, b));
|
|
|
|
CREATE TABLE t1 (a DATE, b DATETIME)
|
|
|
|
PARTITION BY HASH (DATEDIFF(a, b));
|
|
|
|
DROP TABLE t1;
|
|
|
|
CREATE TABLE t1 (a DATETIME, b DATE)
|
|
|
|
PARTITION BY HASH (DATEDIFF(a, b));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE, b VARCHAR(10))
|
|
|
|
PARTITION BY HASH (DATEDIFF(a, b));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT, b DATETIME)
|
|
|
|
PARTITION BY HASH (DATEDIFF(a, b));
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a TIME)
|
|
|
|
PARTITION BY HASH (TIME_TO_SEC(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a DATE)
|
|
|
|
PARTITION BY HASH (TIME_TO_SEC(a));
|
|
|
|
CREATE TABLE t1 (a DATETIME)
|
|
|
|
PARTITION BY HASH (TIME_TO_SEC(a));
|
|
|
|
DROP TABLE t1;
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10))
|
|
|
|
PARTITION BY HASH (TIME_TO_SEC(a));
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY HASH (TIME_TO_SEC(a));
|
|
|
|
|
2010-08-30 17:33:55 +02:00
|
|
|
--echo #
|
|
|
|
--echo # Bug#50036: Inconsistent errors when using TIMESTAMP
|
|
|
|
--echo # columns/expressions
|
|
|
|
|
|
|
|
--echo # 1. correct and appropriate errors in light of
|
|
|
|
--echo # the fix for BUG#42849:
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE t1 (c TIMESTAMP)
|
|
|
|
PARTITION BY RANGE (TO_DAYS(c))
|
|
|
|
(PARTITION p0 VALUES LESS THAN (10000),
|
|
|
|
PARTITION p1 VALUES LESS THAN (MAXVALUE));
|
|
|
|
CREATE TABLE t2 (c TIMESTAMP);
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE t2
|
|
|
|
PARTITION BY RANGE (TO_DAYS(c))
|
|
|
|
(PARTITION p0 VALUES LESS THAN (10000),
|
|
|
|
PARTITION p1 VALUES LESS THAN (MAXVALUE));
|
|
|
|
|
|
|
|
--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
|
|
|
|
CREATE TABLE t1 (c TIMESTAMP)
|
|
|
|
PARTITION BY RANGE COLUMNS(c)
|
|
|
|
(PARTITION p0 VALUES LESS THAN ('2000-01-01 00:00:00'),
|
|
|
|
PARTITION p1 VALUES LESS THAN (MAXVALUE));
|
|
|
|
--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
|
|
|
|
ALTER TABLE t2 PARTITION BY RANGE COLUMNS(c)
|
|
|
|
(PARTITION p0 VALUES LESS THAN ('2000-01-01 00:00:00'),
|
|
|
|
PARTITION p1 VALUES LESS THAN (MAXVALUE));
|
|
|
|
DROP TABLE t2;
|
|
|
|
|
|
|
|
--echo # 2. These errors where questionable before the fix:
|
|
|
|
|
|
|
|
--echo # VALUES clause are checked first, clearified the error message.
|
|
|
|
--error ER_VALUES_IS_NOT_INT_TYPE_ERROR
|
|
|
|
CREATE TABLE t1 (c TIMESTAMP)
|
|
|
|
PARTITION BY RANGE (c)
|
|
|
|
(PARTITION p0 VALUES LESS THAN ('2000-01-01 00:00:00'),
|
|
|
|
PARTITION p1 VALUES LESS THAN (MAXVALUE));
|
|
|
|
|
|
|
|
--echo # TIMESTAMP is not INT (e.g. UNIX_TIMESTAMP).
|
|
|
|
--error ER_VALUES_IS_NOT_INT_TYPE_ERROR
|
|
|
|
CREATE TABLE t1 (c TIMESTAMP)
|
|
|
|
PARTITION BY RANGE (UNIX_TIMESTAMP(c))
|
|
|
|
(PARTITION p0 VALUES LESS THAN ('2000-01-01 00:00:00'),
|
|
|
|
PARTITION p1 VALUES LESS THAN (MAXVALUE));
|
|
|
|
|
|
|
|
CREATE TABLE t1 (c TIMESTAMP)
|
|
|
|
PARTITION BY RANGE (UNIX_TIMESTAMP(c))
|
2011-10-19 21:45:18 +02:00
|
|
|
(PARTITION p0 VALUES LESS THAN (UNIX_TIMESTAMP(20000101000000)),
|
2010-08-30 17:33:55 +02:00
|
|
|
PARTITION p1 VALUES LESS THAN (MAXVALUE));
|
|
|
|
DROP TABLE t1;
|
|
|
|
|
|
|
|
--echo # Changed error from ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR
|
|
|
|
--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
|
|
|
|
CREATE TABLE t1 (c TIMESTAMP)
|
|
|
|
PARTITION BY HASH (c) PARTITIONS 4;
|
|
|
|
|
2011-03-31 14:38:54 +02:00
|
|
|
--echo # Moved to partition_myisam, since it was MyISAM specific
|
2010-08-30 17:33:55 +02:00
|
|
|
--echo # Added test with existing TIMESTAMP partitioning (when it was allowed).
|
|
|
|
|
2009-12-11 18:41:31 +01:00
|
|
|
--echo #
|
|
|
|
--echo # Bug#49477: Assertion `0' failed in ha_partition.cc:5530
|
|
|
|
--echo # with temporary table and partitions
|
|
|
|
--echo #
|
|
|
|
CREATE TABLE t1 (a INT) PARTITION BY HASH(a);
|
|
|
|
--error ER_PARTITION_NO_TEMPORARY
|
|
|
|
CREATE TEMPORARY TABLE tmp_t1 LIKE t1;
|
|
|
|
DROP TABLE t1;
|
2010-03-11 14:00:36 +01:00
|
|
|
--echo #
|
|
|
|
--echo # Bug#42954: SQL MODE 'NO_DIR_IN_CREATE' does not work with
|
|
|
|
--echo # subpartitions
|
2012-02-29 21:55:04 +01:00
|
|
|
let $curr_engine=`select @@default_storage_engine`;
|
2010-03-11 14:00:36 +01:00
|
|
|
SET @org_mode=@@sql_mode;
|
|
|
|
SET @@sql_mode='NO_DIR_IN_CREATE';
|
|
|
|
SELECT @@sql_mode;
|
|
|
|
CREATE TABLE t1 (id INT, purchased DATE)
|
|
|
|
PARTITION BY RANGE(YEAR(purchased))
|
|
|
|
SUBPARTITION BY HASH(TO_DAYS(purchased))
|
|
|
|
(PARTITION p0 VALUES LESS THAN MAXVALUE
|
|
|
|
DATA DIRECTORY = '/tmp/not-existing'
|
|
|
|
INDEX DIRECTORY = '/tmp/not-existing');
|
2012-02-29 21:55:04 +01:00
|
|
|
--replace_result $curr_engine <curr_engine>
|
2010-03-11 14:00:36 +01:00
|
|
|
SHOW CREATE TABLE t1;
|
|
|
|
DROP TABLE t1;
|
|
|
|
CREATE TABLE t1 (id INT, purchased DATE)
|
|
|
|
PARTITION BY RANGE(YEAR(purchased))
|
|
|
|
SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2
|
|
|
|
(PARTITION p0 VALUES LESS THAN MAXVALUE
|
|
|
|
(SUBPARTITION sp0
|
|
|
|
DATA DIRECTORY = '/tmp/not-existing'
|
|
|
|
INDEX DIRECTORY = '/tmp/not-existing',
|
|
|
|
SUBPARTITION sp1));
|
2012-02-29 21:55:04 +01:00
|
|
|
--replace_result $curr_engine <curr_engine>
|
2010-03-11 14:00:36 +01:00
|
|
|
SHOW CREATE TABLE t1;
|
|
|
|
DROP TABLE t1;
|
|
|
|
CREATE TABLE t1 (id INT, purchased DATE)
|
|
|
|
PARTITION BY RANGE(YEAR(purchased))
|
|
|
|
(PARTITION p0 VALUES LESS THAN MAXVALUE
|
|
|
|
DATA DIRECTORY = '/tmp/not-existing'
|
|
|
|
INDEX DIRECTORY = '/tmp/not-existing');
|
2012-02-29 21:55:04 +01:00
|
|
|
--replace_result $curr_engine <curr_engine>
|
2010-03-11 14:00:36 +01:00
|
|
|
SHOW CREATE TABLE t1;
|
|
|
|
DROP TABLE t1;
|
|
|
|
SET @@sql_mode= @org_mode;
|
2009-12-11 18:41:31 +01:00
|
|
|
|
2009-02-18 21:29:30 +01:00
|
|
|
#
|
|
|
|
# Bug#38719: Partitioning returns a different error code for a
|
|
|
|
# duplicate key error
|
|
|
|
CREATE TABLE t1 (a INTEGER NOT NULL, PRIMARY KEY (a));
|
|
|
|
-- error ER_DUP_ENTRY
|
|
|
|
INSERT INTO t1 VALUES (1),(1);
|
|
|
|
DROP TABLE t1;
|
|
|
|
CREATE TABLE t1 (a INTEGER NOT NULL, PRIMARY KEY (a))
|
|
|
|
PARTITION BY KEY (a) PARTITIONS 2;
|
|
|
|
-- error ER_DUP_ENTRY
|
|
|
|
INSERT INTO t1 VALUES (1),(1);
|
|
|
|
DROP TABLE t1;
|
WL #2604: Partition Management
Optimised version of ADD/DROP/REORGANIZE partitions for
non-NDB storage engines.
New syntax to handle REBUILD/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
Quite a few bug fixes
include/thr_lock.h:
New method to downgrade locks from TL_WRITE_ONLY
Possibility to upgrade lock while aborting locks
mysql-test/r/ndb_autodiscover.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_bitfield.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_gis.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_partition_key.result:
New test case
mysql-test/r/partition.result:
New test case
mysql-test/r/partition_error.result:
New test case
mysql-test/r/partition_mgm_err.result:
Fix of test case results
mysql-test/t/disabled.def:
partition_03ndb still has bug
mysql-test/t/ndb_partition_key.test:
New test cases for new functionality and bugs
mysql-test/t/partition.test:
New test cases for new functionality and bugs
mysql-test/t/partition_error.test:
New test cases for new functionality and bugs
mysql-test/t/partition_mgm_err.test:
New test cases for new functionality and bugs
mysys/thr_lock.c:
New method to downgrade TL_WRITE_ONLY locks
Possibility to specify if locks are to be upgraded at abort locks
sql/ha_archive.cc:
New handlerton methods
sql/ha_berkeley.cc:
New handlerton methods
sql/ha_blackhole.cc:
New handlerton methods
sql/ha_federated.cc:
New handlerton methods
sql/ha_heap.cc:
New handlerton methods
sql/ha_innodb.cc:
New handlerton methods
sql/ha_myisam.cc:
New handlerton methods
sql/ha_myisammrg.cc:
New handlerton methods
sql/ha_ndbcluster.cc:
New handlerton methods
Moved out packfrm and unpackfrm methods
Adapted many parts to use table_share instead of table->s
Ensured that .ndb file uses filename and not tablename
according to new encoding of names (WL 1324)
All NDB tables are partitioned and set up partition info
Fixed such that tablenames use tablenames and not filenames in NDB
NDB uses auto partitioning for ENGINE=NDB tables
Warning for very large tables
Set RANGE data
Set LIST data
New method to set-up partition info
Set Default number of partitions flag
Set linear hash flag
Set node group array
Set number of fragments
Set max rows
Set tablespace names
New method to get number of partitions of table to use at open table
sql/ha_ndbcluster.h:
Removed partition_flags and alter_table_flags from handler class
A couple of new and changed method headers
sql/ha_ndbcluster_binlog.cc:
Use new method headers
sql/ha_partition.cc:
New handlerton methods
Lots of new function headers
Use #P# as separator between table name and partition name and
#SP# as separator between partition name and subpartition name
Use filename encoding for files both of table name part and of
partition name parts
New method to drop partitions based on partition state
New method to rename partitions based on partition state
New methods to optimize, analyze, check and repair partitions
New methods to optimize, analyze, check and repair table
Helper method to create new partition, open it and external lock
it, not needed to lock it internally since no one else knows about
it yet.
Cleanup method at error for new partitions
New methods to perform bulk of work at ADD/REORGANIZE partitions
(change_partitions, copy_partitions)
sql/ha_partition.h:
New methods and variables
A few dropped ones and a few changed ones
sql/handler.cc:
Handlerton interface changes
New flag to open_table_from_share
sql/handler.h:
New alter_table_flags
New partition flags
New partition states
More states for default handling
Lots of new, dropped and changed interfaces
sql/lex.h:
Added REBUILD and changed name of REORGANISE to REORGANIZE
sql/lock.cc:
Method to downgrade locks
Able to specify if locks upgraded on abort locks
sql/log.cc:
New handlerton methods
sql/mysql_priv.h:
Lots of new interfaces
sql/share/errmsg.txt:
Lots of new, dropped and changed error messages
sql/sql_base.cc:
Adapted to new method headers
New method to abort and upgrade lock
New method to close open tables and downgrade lock
New method to wait for completed table
sql/sql_lex.h:
New flags
sql/sql_partition.cc:
Return int instead of bool in get_partition_id
More defaults handling
Make use of new mem_alloc_error method
More work on function headers
Changes to generate partition syntax to cater for intermediate
partition states
Lots of new code with large comments describing new features for
Partition Management:
ADD/DROP/REORGANIZE/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
sql/sql_show.cc:
Minors
sql/sql_table.cc:
Moved a couple of methods
New methods to copy create lists and key lists
for use with mysql_prepare_table
New method to write frm file
New handling of handlers with auto partitioning
Fix CREATE TABLE LIKE
Moved code for ADD/DROP/REORGANIZE partitions
Use handlerton method for alter_table_flags
sql/sql_yacc.yy:
More memory alloc error checks
New syntax for REBUILD, ANALYZE, CHECK, OPTIMIZE, REPAIR partitions
sql/table.cc:
Fix length of extra part to be 4 bytes
Partition state introduced in frm file
sql/table.h:
Partition state introduced
sql/unireg.cc:
Partition state introduced
Default partition
storage/csv/ha_tina.cc:
New handlerton methods
storage/example/ha_example.cc:
New handlerton methods
storage/ndb/include/kernel/ndb_limits.h:
RANGE DATA
storage/ndb/include/kernel/signaldata/AlterTable.hpp:
New interfaces in ALTER TABLE towards NDB kernel
storage/ndb/include/kernel/signaldata/DiAddTab.hpp:
New section
storage/ndb/include/kernel/signaldata/DictTabInfo.hpp:
Lots of new parts of table description
storage/ndb/include/kernel/signaldata/LqhFrag.hpp:
tablespace id specified in LQHFRAGREQ
storage/ndb/include/ndbapi/NdbDictionary.hpp:
Lots of new methods in NDB dictionary
storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
New error insertion
storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp:
a few extra jam's
storage/ndb/src/ndbapi/NdbBlob.cpp:
Changes to definition of blob tables
storage/ndb/src/ndbapi/NdbDictionary.cpp:
Lots of new stuff in NDB dictionary
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Lots of new stuff in NDB dictionary
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp:
Lots of new stuff in NDB dictionary
storage/ndb/test/ndbapi/test_event.cpp:
removed use of methods no longer in existence
storage/ndb/tools/restore/Restore.cpp:
Renamed variable
2006-01-17 08:40:00 +01:00
|
|
|
|
2007-11-10 13:09:18 +01:00
|
|
|
#
|
|
|
|
# Bug 29368:
|
|
|
|
# Incorrect error, 1467, for syntax error when creating partition
|
|
|
|
--error ER_PARTITION_REQUIRES_VALUES_ERROR
|
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int
|
|
|
|
)
|
|
|
|
PARTITION BY RANGE (a)
|
|
|
|
(
|
|
|
|
PARTITION p0 VALUES LESS THAN (1),
|
|
|
|
PARTITION p1 VALU ES LESS THAN (2)
|
|
|
|
);
|
|
|
|
|
2005-07-20 14:46:02 +02:00
|
|
|
#
|
|
|
|
# Partition by key stand-alone error
|
|
|
|
#
|
2011-03-31 14:38:54 +02:00
|
|
|
--error ER_PARSE_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
partition by list (a)
|
|
|
|
partitions 3
|
|
|
|
(partition x1 values in (1,2,9,4) tablespace ts1,
|
|
|
|
partition x2 values in (3, 11, 5, 7) tablespace ts2,
|
|
|
|
partition x3 values in (16, 8, 5+19, 70-43) tablespace ts3);
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by key list, number of partitions defined, no partition defined
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_PARTITIONS_MUST_BE_DEFINED_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by list (a)
|
|
|
|
partitions 2;
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by key list, wrong result type
|
|
|
|
#
|
2007-04-04 16:26:32 +02:00
|
|
|
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by list (sin(a))
|
|
|
|
partitions 3
|
|
|
|
(partition x1 values in (1,2,9,4) tablespace ts1,
|
|
|
|
partition x2 values in (3, 11, 5, 7) tablespace ts2,
|
|
|
|
partition x3 values in (16, 8, 5+19, 70-43) tablespace ts3);
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by key, partition function not allowed
|
|
|
|
#
|
2011-03-31 14:38:54 +02:00
|
|
|
--error ER_PARSE_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by key (a+2)
|
|
|
|
partitions 3
|
|
|
|
(partition x1 tablespace ts1,
|
|
|
|
partition x2 tablespace ts2,
|
|
|
|
partition x3 tablespace ts3);
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by key, no partition name
|
|
|
|
#
|
2011-03-31 14:38:54 +02:00
|
|
|
--error ER_PARSE_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by key (a)
|
|
|
|
partitions 3
|
|
|
|
(partition tablespace ts1,
|
|
|
|
partition x2 tablespace ts2,
|
|
|
|
partition x3 tablespace ts3);
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by key, invalid field in field list
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_FIELD_NOT_FOUND_PART_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by key (a,d)
|
|
|
|
partitions 3
|
|
|
|
(partition x1 tablespace ts1,
|
|
|
|
partition x2 tablespace ts2,
|
|
|
|
partition x3 tablespace ts3);
|
2006-06-20 22:38:42 +02:00
|
|
|
|
2007-12-12 18:19:24 +01:00
|
|
|
select load_file('$MYSQLD_DATADIR/test/t1.par');
|
2005-07-20 14:46:02 +02:00
|
|
|
#
|
|
|
|
# Partition by hash, invalid field in function
|
|
|
|
#
|
2011-03-31 14:38:54 +02:00
|
|
|
--error ER_BAD_FIELD_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by hash (a + d)
|
|
|
|
partitions 3
|
|
|
|
(partition x1 tablespace ts1,
|
|
|
|
partition x2 tablespace ts2,
|
|
|
|
partition x3 tablespace ts3);
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by hash, invalid result type
|
|
|
|
#
|
2007-04-04 16:26:32 +02:00
|
|
|
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by hash (sin(a))
|
|
|
|
partitions 3
|
|
|
|
(partition x1 tablespace ts1,
|
|
|
|
partition x2 tablespace ts2,
|
|
|
|
partition x3 tablespace ts3);
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by key specified 3 partitions but only defined 2 => error
|
|
|
|
#
|
2011-03-31 14:38:54 +02:00
|
|
|
--error ER_PARSE_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by key (a)
|
|
|
|
partitions 3
|
|
|
|
(partition x1, partition x2);
|
|
|
|
|
|
|
|
#
|
2009-09-15 17:07:52 +02:00
|
|
|
# Partition by hash, random function
|
2005-07-20 14:46:02 +02:00
|
|
|
#
|
2011-03-31 14:38:54 +02:00
|
|
|
--error ER_PARSE_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by hash (rand(a))
|
|
|
|
partitions 2
|
|
|
|
(partition x1, partition x2);
|
|
|
|
|
|
|
|
#
|
2009-09-15 17:07:52 +02:00
|
|
|
# Partition by range, random function
|
2005-07-20 14:46:02 +02:00
|
|
|
#
|
2011-03-31 14:38:54 +02:00
|
|
|
--error ER_PARSE_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by range (rand(a))
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values less than (0), partition x2 values less than (2));
|
|
|
|
|
|
|
|
#
|
2009-09-15 17:07:52 +02:00
|
|
|
# Partition by list, random function
|
2005-07-20 14:46:02 +02:00
|
|
|
#
|
2011-03-31 14:38:54 +02:00
|
|
|
--error ER_PARSE_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by list (rand(a))
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values in (1), partition x2 values in (2));
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by hash, values less than error
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_PARTITION_WRONG_VALUES_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by hash (a)
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values less than (4),
|
|
|
|
partition x2 values less than (5));
|
2007-12-12 18:19:24 +01:00
|
|
|
select load_file('$MYSQLD_DATADIR/test/t1.par');
|
2005-07-20 14:46:02 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by hash, values in error
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_PARTITION_WRONG_VALUES_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by hash (a)
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values in (4),
|
|
|
|
partition x2 values in (5));
|
2007-12-12 18:19:24 +01:00
|
|
|
select load_file('$MYSQLD_DATADIR/test/t1.par');
|
2005-07-20 14:46:02 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by hash, values in error
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_PARTITION_WRONG_VALUES_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by hash (a)
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values in (4,6),
|
|
|
|
partition x2 values in (5,7));
|
2007-12-12 18:19:24 +01:00
|
|
|
select load_file('$MYSQLD_DATADIR/test/t1.par');
|
2005-07-20 14:46:02 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Subpartition by key, no partitions defined, single field
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_SUBPARTITION_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key (a,b))
|
|
|
|
partition by key (a)
|
|
|
|
subpartition by key (b);
|
2007-12-12 18:19:24 +01:00
|
|
|
select load_file('$MYSQLD_DATADIR/test/t1.par');
|
2005-07-20 14:46:02 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Subpartition by key, no partitions defined, list of fields
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_SUBPARTITION_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key (a,b))
|
|
|
|
partition by key (a)
|
|
|
|
subpartition by key (a, b);
|
2007-12-12 18:19:24 +01:00
|
|
|
select load_file('$MYSQLD_DATADIR/test/t1.par');
|
2005-07-20 14:46:02 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Subpartition by hash, no partitions defined
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_SUBPARTITION_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key (a,b))
|
|
|
|
partition by key (a)
|
|
|
|
subpartition by hash (a+b);
|
2007-12-12 18:19:24 +01:00
|
|
|
select load_file('$MYSQLD_DATADIR/test/t1.par');
|
2005-07-20 14:46:02 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Subpartition by key, no partitions defined, single field
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_SUBPARTITION_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key (a,b))
|
|
|
|
partition by key (a)
|
|
|
|
subpartition by key (b);
|
2007-12-12 18:19:24 +01:00
|
|
|
select load_file('$MYSQLD_DATADIR/test/t1.par');
|
2005-07-20 14:46:02 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Subpartition by key, no partitions defined, list of fields
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_SUBPARTITION_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key (a,b))
|
|
|
|
partition by key (a)
|
|
|
|
subpartition by key (a, b);
|
2007-12-12 18:19:24 +01:00
|
|
|
select load_file('$MYSQLD_DATADIR/test/t1.par');
|
2005-07-20 14:46:02 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Subpartition by hash, no partitions defined
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_SUBPARTITION_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key (a,b))
|
|
|
|
partition by key (a)
|
|
|
|
subpartition by hash (a+b);
|
2007-12-12 18:19:24 +01:00
|
|
|
select load_file('$MYSQLD_DATADIR/test/t1.par');
|
2005-07-20 14:46:02 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Subpartition by hash, no partitions defined, wrong subpartition function
|
|
|
|
#
|
2011-03-31 14:38:54 +02:00
|
|
|
--error ER_PARSE_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key (a,b))
|
|
|
|
partition by key (a)
|
|
|
|
subpartition by hash (rand(a+b));
|
|
|
|
|
|
|
|
#
|
|
|
|
# Subpartition by hash, wrong subpartition function
|
|
|
|
#
|
2015-06-24 06:57:12 +02:00
|
|
|
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key (a,b))
|
|
|
|
partition by key (a)
|
|
|
|
subpartition by hash (sin(a+b))
|
|
|
|
(partition x1 (subpartition x11, subpartition x12),
|
|
|
|
partition x2 (subpartition x21, subpartition x22));
|
2007-12-12 18:19:24 +01:00
|
|
|
select load_file('$MYSQLD_DATADIR/test/t1.par');
|
2005-07-20 14:46:02 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Subpartition by hash, no partitions defined, wrong subpartition function
|
|
|
|
#
|
2011-03-31 14:38:54 +02:00
|
|
|
--error ER_PARSE_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key (a,b))
|
|
|
|
partition by range (a)
|
|
|
|
subpartition by key (a+b)
|
|
|
|
(partition x1 values less than (1) (subpartition x11, subpartition x12),
|
|
|
|
partition x2 values less than (2) (subpartition x21, subpartition x22));
|
|
|
|
|
|
|
|
#
|
|
|
|
# Subpartition by hash, no partitions defined, wrong subpartition function
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_FIELD_NOT_FOUND_PART_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key (a,b))
|
|
|
|
partition by range (a)
|
|
|
|
subpartition by key (a,d)
|
|
|
|
(partition x1 values less than (1) (subpartition x11, subpartition x12),
|
|
|
|
partition x2 values less than (2) (subpartition x21, subpartition x22));
|
2007-12-12 18:19:24 +01:00
|
|
|
select load_file('$MYSQLD_DATADIR/test/t1.par');
|
2005-07-20 14:46:02 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Subpartition by hash, no partitions defined, wrong subpartition function
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_SUBPARTITION_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key (a,b))
|
|
|
|
partition by key (a)
|
|
|
|
subpartition by hash (3+4);
|
|
|
|
|
|
|
|
#
|
|
|
|
# Subpartition by hash, no partitions defined, wrong subpartition function
|
|
|
|
#
|
2011-03-31 14:38:54 +02:00
|
|
|
--error ER_BAD_FIELD_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key (a,b))
|
|
|
|
partition by range (a)
|
|
|
|
subpartition by hash (a+d)
|
|
|
|
(partition x1 values less than (1) (subpartition x11, subpartition x12),
|
|
|
|
partition x2 values less than (2) (subpartition x21, subpartition x22));
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by range, no partition => error
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_PARTITIONS_MUST_BE_DEFINED_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by range (a);
|
2007-12-12 18:19:24 +01:00
|
|
|
select load_file('$MYSQLD_DATADIR/test/t1.par');
|
2005-07-20 14:46:02 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by range, invalid field in function
|
|
|
|
#
|
2011-03-31 14:38:54 +02:00
|
|
|
--error ER_BAD_FIELD_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by range (a+d)
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values less than (4) tablespace ts1,
|
|
|
|
partition x2 values less than (8) tablespace ts2);
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by range, inconsistent partition function and constants
|
|
|
|
#
|
2010-08-30 17:33:55 +02:00
|
|
|
--error ER_VALUES_IS_NOT_INT_TYPE_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by range (a)
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values less than (4.0) tablespace ts1,
|
|
|
|
partition x2 values less than (8) tablespace ts2);
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by range, constant partition function not allowed
|
|
|
|
#
|
2009-12-13 21:29:50 +01:00
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by range (3+4)
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values less than (4) tablespace ts1,
|
|
|
|
partition x2 values less than (8) tablespace ts2);
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by range, no values less than definition
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_PARTITION_REQUIRES_VALUES_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by range (a)
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values less than (4),
|
|
|
|
partition x2);
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by range, no values in definition allowed
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_PARTITION_WRONG_VALUES_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by range (a)
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values in (4),
|
|
|
|
partition x2);
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by range, values in error
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_PARTITION_WRONG_VALUES_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by range (a)
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values in (4),
|
|
|
|
partition x2 values less than (5));
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by range, missing parenthesis
|
|
|
|
#
|
2009-10-21 12:40:21 +02:00
|
|
|
--error ER_PARTITION_WRONG_VALUES_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by list (a)
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values less than 4,
|
|
|
|
partition x2 values less than (5));
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by range, maxvalue in wrong place
|
|
|
|
#
|
2009-10-21 12:40:21 +02:00
|
|
|
--error ER_PARTITION_MAXVALUE_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by range (a)
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values less than maxvalue,
|
|
|
|
partition x2 values less than (5));
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by range, maxvalue in several places
|
|
|
|
#
|
2009-10-21 12:40:21 +02:00
|
|
|
--error ER_PARTITION_MAXVALUE_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by range (a)
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values less than maxvalue,
|
|
|
|
partition x2 values less than maxvalue);
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by range, not increasing ranges
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_RANGE_NOT_INCREASING_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by range (a)
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values less than (4),
|
|
|
|
partition x2 values less than (3));
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by range, wrong result type of partition function
|
|
|
|
#
|
2007-04-04 16:26:32 +02:00
|
|
|
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by range (sin(a))
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values less than (4),
|
|
|
|
partition x2 values less than (5));
|
|
|
|
|
|
|
|
#
|
|
|
|
# Subpartition by hash, wrong number of subpartitions
|
|
|
|
#
|
2011-03-31 14:38:54 +02:00
|
|
|
--error ER_PARSE_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key (a,b))
|
|
|
|
partition by list (a)
|
|
|
|
subpartition by hash (a+b)
|
|
|
|
subpartitions 3
|
|
|
|
( partition x1 values in (1,2,4)
|
|
|
|
( subpartition x11 nodegroup 0,
|
|
|
|
subpartition x12 nodegroup 1),
|
|
|
|
partition x2 values in (3,5,6)
|
|
|
|
( subpartition x21 nodegroup 0,
|
|
|
|
subpartition x22 nodegroup 1)
|
|
|
|
);
|
|
|
|
|
|
|
|
#
|
|
|
|
# Subpartition by hash, wrong number of subpartitions
|
|
|
|
#
|
2011-03-31 14:38:54 +02:00
|
|
|
--error ER_PARSE_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key (a,b))
|
|
|
|
partition by list (a)
|
|
|
|
subpartition by hash (a+b)
|
|
|
|
( partition x1 values in (1)
|
|
|
|
( subpartition x11 nodegroup 0,
|
|
|
|
subpartition xextra,
|
|
|
|
subpartition x12 nodegroup 1),
|
|
|
|
partition x2 values in (2)
|
|
|
|
( subpartition x21 nodegroup 0,
|
|
|
|
subpartition x22 nodegroup 1)
|
|
|
|
);
|
|
|
|
|
|
|
|
#
|
|
|
|
# Subpartition by list => error
|
|
|
|
#
|
2011-03-31 14:38:54 +02:00
|
|
|
--error ER_PARSE_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key (a,b))
|
|
|
|
partition by key (a)
|
|
|
|
subpartition by list (a+b)
|
|
|
|
( partition x1
|
|
|
|
( subpartition x11 engine myisam,
|
|
|
|
subpartition x12 engine myisam),
|
|
|
|
partition x2
|
|
|
|
( subpartition x21 engine myisam,
|
|
|
|
subpartition x22 engine myisam)
|
|
|
|
);
|
|
|
|
|
|
|
|
#
|
|
|
|
# Subpartition by list => error
|
|
|
|
#
|
2011-03-31 14:38:54 +02:00
|
|
|
--error ER_PARSE_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key (a,b))
|
|
|
|
partition by key (a)
|
|
|
|
subpartition by list (a+b)
|
|
|
|
( partition x1
|
|
|
|
( subpartition x11 engine myisam values in (0),
|
|
|
|
subpartition x12 engine myisam values in (1)),
|
|
|
|
partition x2
|
|
|
|
( subpartition x21 engine myisam values in (0),
|
|
|
|
subpartition x22 engine myisam values in (1))
|
|
|
|
);
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by list, no partition => error
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_PARTITIONS_MUST_BE_DEFINED_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by list (a);
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by list, constant partition function not allowed
|
|
|
|
#
|
2009-12-13 21:29:50 +01:00
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by list (3+4)
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values in (4) tablespace ts1,
|
|
|
|
partition x2 values in (8) tablespace ts2);
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by list, invalid field in function
|
|
|
|
#
|
2011-03-31 14:38:54 +02:00
|
|
|
--error ER_BAD_FIELD_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by list (a+d)
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values in (4) tablespace ts1,
|
|
|
|
partition x2 values in (8) tablespace ts2);
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by list, no values in definition
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_PARTITION_REQUIRES_VALUES_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by list (a)
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values in (4),
|
|
|
|
partition x2);
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by list, values less than error
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_PARTITION_WRONG_VALUES_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by list (a)
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values in (4),
|
|
|
|
partition x2 values less than (5));
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by list, no values in definition
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_PARTITION_REQUIRES_VALUES_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by list (a)
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values in (4,6),
|
|
|
|
partition x2);
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by list, duplicate values
|
|
|
|
#
|
2005-08-06 19:11:56 +02:00
|
|
|
--error ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by list (a)
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values in (4, 12+9),
|
|
|
|
partition x2 values in (3, 21));
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by list, wrong constant result type (not INT)
|
|
|
|
#
|
2010-08-30 17:33:55 +02:00
|
|
|
--error ER_VALUES_IS_NOT_INT_TYPE_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by list (a)
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values in (4.0, 12+8),
|
|
|
|
partition x2 values in (3, 21));
|
|
|
|
|
|
|
|
#
|
|
|
|
# Partition by list, missing parenthesis
|
|
|
|
#
|
2011-03-31 14:38:54 +02:00
|
|
|
--error ER_PARSE_ERROR
|
2005-07-20 14:46:02 +02:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int not null,
|
|
|
|
b int not null,
|
|
|
|
c int not null,
|
|
|
|
primary key(a,b))
|
|
|
|
partition by list (a)
|
|
|
|
partitions 2
|
|
|
|
(partition x1 values in 4,
|
|
|
|
partition x2 values in (5));
|
2005-08-19 16:26:05 +02:00
|
|
|
|
WL #2604: Partition Management
Optimised version of ADD/DROP/REORGANIZE partitions for
non-NDB storage engines.
New syntax to handle REBUILD/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
Quite a few bug fixes
include/thr_lock.h:
New method to downgrade locks from TL_WRITE_ONLY
Possibility to upgrade lock while aborting locks
mysql-test/r/ndb_autodiscover.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_bitfield.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_gis.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_partition_key.result:
New test case
mysql-test/r/partition.result:
New test case
mysql-test/r/partition_error.result:
New test case
mysql-test/r/partition_mgm_err.result:
Fix of test case results
mysql-test/t/disabled.def:
partition_03ndb still has bug
mysql-test/t/ndb_partition_key.test:
New test cases for new functionality and bugs
mysql-test/t/partition.test:
New test cases for new functionality and bugs
mysql-test/t/partition_error.test:
New test cases for new functionality and bugs
mysql-test/t/partition_mgm_err.test:
New test cases for new functionality and bugs
mysys/thr_lock.c:
New method to downgrade TL_WRITE_ONLY locks
Possibility to specify if locks are to be upgraded at abort locks
sql/ha_archive.cc:
New handlerton methods
sql/ha_berkeley.cc:
New handlerton methods
sql/ha_blackhole.cc:
New handlerton methods
sql/ha_federated.cc:
New handlerton methods
sql/ha_heap.cc:
New handlerton methods
sql/ha_innodb.cc:
New handlerton methods
sql/ha_myisam.cc:
New handlerton methods
sql/ha_myisammrg.cc:
New handlerton methods
sql/ha_ndbcluster.cc:
New handlerton methods
Moved out packfrm and unpackfrm methods
Adapted many parts to use table_share instead of table->s
Ensured that .ndb file uses filename and not tablename
according to new encoding of names (WL 1324)
All NDB tables are partitioned and set up partition info
Fixed such that tablenames use tablenames and not filenames in NDB
NDB uses auto partitioning for ENGINE=NDB tables
Warning for very large tables
Set RANGE data
Set LIST data
New method to set-up partition info
Set Default number of partitions flag
Set linear hash flag
Set node group array
Set number of fragments
Set max rows
Set tablespace names
New method to get number of partitions of table to use at open table
sql/ha_ndbcluster.h:
Removed partition_flags and alter_table_flags from handler class
A couple of new and changed method headers
sql/ha_ndbcluster_binlog.cc:
Use new method headers
sql/ha_partition.cc:
New handlerton methods
Lots of new function headers
Use #P# as separator between table name and partition name and
#SP# as separator between partition name and subpartition name
Use filename encoding for files both of table name part and of
partition name parts
New method to drop partitions based on partition state
New method to rename partitions based on partition state
New methods to optimize, analyze, check and repair partitions
New methods to optimize, analyze, check and repair table
Helper method to create new partition, open it and external lock
it, not needed to lock it internally since no one else knows about
it yet.
Cleanup method at error for new partitions
New methods to perform bulk of work at ADD/REORGANIZE partitions
(change_partitions, copy_partitions)
sql/ha_partition.h:
New methods and variables
A few dropped ones and a few changed ones
sql/handler.cc:
Handlerton interface changes
New flag to open_table_from_share
sql/handler.h:
New alter_table_flags
New partition flags
New partition states
More states for default handling
Lots of new, dropped and changed interfaces
sql/lex.h:
Added REBUILD and changed name of REORGANISE to REORGANIZE
sql/lock.cc:
Method to downgrade locks
Able to specify if locks upgraded on abort locks
sql/log.cc:
New handlerton methods
sql/mysql_priv.h:
Lots of new interfaces
sql/share/errmsg.txt:
Lots of new, dropped and changed error messages
sql/sql_base.cc:
Adapted to new method headers
New method to abort and upgrade lock
New method to close open tables and downgrade lock
New method to wait for completed table
sql/sql_lex.h:
New flags
sql/sql_partition.cc:
Return int instead of bool in get_partition_id
More defaults handling
Make use of new mem_alloc_error method
More work on function headers
Changes to generate partition syntax to cater for intermediate
partition states
Lots of new code with large comments describing new features for
Partition Management:
ADD/DROP/REORGANIZE/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
sql/sql_show.cc:
Minors
sql/sql_table.cc:
Moved a couple of methods
New methods to copy create lists and key lists
for use with mysql_prepare_table
New method to write frm file
New handling of handlers with auto partitioning
Fix CREATE TABLE LIKE
Moved code for ADD/DROP/REORGANIZE partitions
Use handlerton method for alter_table_flags
sql/sql_yacc.yy:
More memory alloc error checks
New syntax for REBUILD, ANALYZE, CHECK, OPTIMIZE, REPAIR partitions
sql/table.cc:
Fix length of extra part to be 4 bytes
Partition state introduced in frm file
sql/table.h:
Partition state introduced
sql/unireg.cc:
Partition state introduced
Default partition
storage/csv/ha_tina.cc:
New handlerton methods
storage/example/ha_example.cc:
New handlerton methods
storage/ndb/include/kernel/ndb_limits.h:
RANGE DATA
storage/ndb/include/kernel/signaldata/AlterTable.hpp:
New interfaces in ALTER TABLE towards NDB kernel
storage/ndb/include/kernel/signaldata/DiAddTab.hpp:
New section
storage/ndb/include/kernel/signaldata/DictTabInfo.hpp:
Lots of new parts of table description
storage/ndb/include/kernel/signaldata/LqhFrag.hpp:
tablespace id specified in LQHFRAGREQ
storage/ndb/include/ndbapi/NdbDictionary.hpp:
Lots of new methods in NDB dictionary
storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
New error insertion
storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp:
a few extra jam's
storage/ndb/src/ndbapi/NdbBlob.cpp:
Changes to definition of blob tables
storage/ndb/src/ndbapi/NdbDictionary.cpp:
Lots of new stuff in NDB dictionary
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Lots of new stuff in NDB dictionary
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp:
Lots of new stuff in NDB dictionary
storage/ndb/test/ndbapi/test_event.cpp:
removed use of methods no longer in existence
storage/ndb/tools/restore/Restore.cpp:
Renamed variable
2006-01-17 08:40:00 +01:00
|
|
|
#
|
|
|
|
# Bug #13439: Crash when LESS THAN (non-literal)
|
|
|
|
#
|
2011-03-31 14:38:54 +02:00
|
|
|
--error ER_BAD_FIELD_ERROR
|
WL #2604: Partition Management
Optimised version of ADD/DROP/REORGANIZE partitions for
non-NDB storage engines.
New syntax to handle REBUILD/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
Quite a few bug fixes
include/thr_lock.h:
New method to downgrade locks from TL_WRITE_ONLY
Possibility to upgrade lock while aborting locks
mysql-test/r/ndb_autodiscover.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_bitfield.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_gis.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_partition_key.result:
New test case
mysql-test/r/partition.result:
New test case
mysql-test/r/partition_error.result:
New test case
mysql-test/r/partition_mgm_err.result:
Fix of test case results
mysql-test/t/disabled.def:
partition_03ndb still has bug
mysql-test/t/ndb_partition_key.test:
New test cases for new functionality and bugs
mysql-test/t/partition.test:
New test cases for new functionality and bugs
mysql-test/t/partition_error.test:
New test cases for new functionality and bugs
mysql-test/t/partition_mgm_err.test:
New test cases for new functionality and bugs
mysys/thr_lock.c:
New method to downgrade TL_WRITE_ONLY locks
Possibility to specify if locks are to be upgraded at abort locks
sql/ha_archive.cc:
New handlerton methods
sql/ha_berkeley.cc:
New handlerton methods
sql/ha_blackhole.cc:
New handlerton methods
sql/ha_federated.cc:
New handlerton methods
sql/ha_heap.cc:
New handlerton methods
sql/ha_innodb.cc:
New handlerton methods
sql/ha_myisam.cc:
New handlerton methods
sql/ha_myisammrg.cc:
New handlerton methods
sql/ha_ndbcluster.cc:
New handlerton methods
Moved out packfrm and unpackfrm methods
Adapted many parts to use table_share instead of table->s
Ensured that .ndb file uses filename and not tablename
according to new encoding of names (WL 1324)
All NDB tables are partitioned and set up partition info
Fixed such that tablenames use tablenames and not filenames in NDB
NDB uses auto partitioning for ENGINE=NDB tables
Warning for very large tables
Set RANGE data
Set LIST data
New method to set-up partition info
Set Default number of partitions flag
Set linear hash flag
Set node group array
Set number of fragments
Set max rows
Set tablespace names
New method to get number of partitions of table to use at open table
sql/ha_ndbcluster.h:
Removed partition_flags and alter_table_flags from handler class
A couple of new and changed method headers
sql/ha_ndbcluster_binlog.cc:
Use new method headers
sql/ha_partition.cc:
New handlerton methods
Lots of new function headers
Use #P# as separator between table name and partition name and
#SP# as separator between partition name and subpartition name
Use filename encoding for files both of table name part and of
partition name parts
New method to drop partitions based on partition state
New method to rename partitions based on partition state
New methods to optimize, analyze, check and repair partitions
New methods to optimize, analyze, check and repair table
Helper method to create new partition, open it and external lock
it, not needed to lock it internally since no one else knows about
it yet.
Cleanup method at error for new partitions
New methods to perform bulk of work at ADD/REORGANIZE partitions
(change_partitions, copy_partitions)
sql/ha_partition.h:
New methods and variables
A few dropped ones and a few changed ones
sql/handler.cc:
Handlerton interface changes
New flag to open_table_from_share
sql/handler.h:
New alter_table_flags
New partition flags
New partition states
More states for default handling
Lots of new, dropped and changed interfaces
sql/lex.h:
Added REBUILD and changed name of REORGANISE to REORGANIZE
sql/lock.cc:
Method to downgrade locks
Able to specify if locks upgraded on abort locks
sql/log.cc:
New handlerton methods
sql/mysql_priv.h:
Lots of new interfaces
sql/share/errmsg.txt:
Lots of new, dropped and changed error messages
sql/sql_base.cc:
Adapted to new method headers
New method to abort and upgrade lock
New method to close open tables and downgrade lock
New method to wait for completed table
sql/sql_lex.h:
New flags
sql/sql_partition.cc:
Return int instead of bool in get_partition_id
More defaults handling
Make use of new mem_alloc_error method
More work on function headers
Changes to generate partition syntax to cater for intermediate
partition states
Lots of new code with large comments describing new features for
Partition Management:
ADD/DROP/REORGANIZE/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
sql/sql_show.cc:
Minors
sql/sql_table.cc:
Moved a couple of methods
New methods to copy create lists and key lists
for use with mysql_prepare_table
New method to write frm file
New handling of handlers with auto partitioning
Fix CREATE TABLE LIKE
Moved code for ADD/DROP/REORGANIZE partitions
Use handlerton method for alter_table_flags
sql/sql_yacc.yy:
More memory alloc error checks
New syntax for REBUILD, ANALYZE, CHECK, OPTIMIZE, REPAIR partitions
sql/table.cc:
Fix length of extra part to be 4 bytes
Partition state introduced in frm file
sql/table.h:
Partition state introduced
sql/unireg.cc:
Partition state introduced
Default partition
storage/csv/ha_tina.cc:
New handlerton methods
storage/example/ha_example.cc:
New handlerton methods
storage/ndb/include/kernel/ndb_limits.h:
RANGE DATA
storage/ndb/include/kernel/signaldata/AlterTable.hpp:
New interfaces in ALTER TABLE towards NDB kernel
storage/ndb/include/kernel/signaldata/DiAddTab.hpp:
New section
storage/ndb/include/kernel/signaldata/DictTabInfo.hpp:
Lots of new parts of table description
storage/ndb/include/kernel/signaldata/LqhFrag.hpp:
tablespace id specified in LQHFRAGREQ
storage/ndb/include/ndbapi/NdbDictionary.hpp:
Lots of new methods in NDB dictionary
storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
New error insertion
storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp:
a few extra jam's
storage/ndb/src/ndbapi/NdbBlob.cpp:
Changes to definition of blob tables
storage/ndb/src/ndbapi/NdbDictionary.cpp:
Lots of new stuff in NDB dictionary
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Lots of new stuff in NDB dictionary
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp:
Lots of new stuff in NDB dictionary
storage/ndb/test/ndbapi/test_event.cpp:
removed use of methods no longer in existence
storage/ndb/tools/restore/Restore.cpp:
Renamed variable
2006-01-17 08:40:00 +01:00
|
|
|
CREATE TABLE t1 (a int)
|
|
|
|
PARTITION BY RANGE (a)
|
|
|
|
(PARTITION p0 VALUES LESS THAN (x1));
|
|
|
|
|
2005-12-15 13:20:56 +01:00
|
|
|
#
|
|
|
|
# No partition for the given value
|
|
|
|
#
|
|
|
|
CREATE TABLE t1(a int)
|
|
|
|
PARTITION BY RANGE (a) (PARTITION p1 VALUES LESS THAN(5));
|
|
|
|
--error ER_NO_PARTITION_FOR_GIVEN_VALUE
|
|
|
|
insert into t1 values (10);
|
|
|
|
drop table t1;
|
2006-05-31 19:32:14 +02:00
|
|
|
|
2006-06-05 20:55:22 +02:00
|
|
|
--error ER_PARTITION_CONST_DOMAIN_ERROR
|
2006-04-18 04:51:34 +02:00
|
|
|
create table t1 (a bigint unsigned)
|
|
|
|
partition by range (a)
|
|
|
|
(partition p0 values less than (-1));
|
2006-05-31 19:32:14 +02:00
|
|
|
#
|
|
|
|
# Bug 18198 Partitions: Verify that erroneus partition functions doesn't work
|
|
|
|
#
|
2007-06-13 17:28:59 +02:00
|
|
|
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
|
2006-05-31 19:32:14 +02:00
|
|
|
create table t1 (v varchar(12))
|
|
|
|
partition by range (ascii(v))
|
|
|
|
(partition p0 values less than (10));
|
2007-06-13 17:28:59 +02:00
|
|
|
#drop table t1;
|
2006-05-31 19:32:14 +02:00
|
|
|
|
2011-03-31 14:38:54 +02:00
|
|
|
-- error ER_PARSE_ERROR
|
2006-05-31 19:32:14 +02:00
|
|
|
create table t1 (a int)
|
|
|
|
partition by hash (rand(a));
|
2011-03-31 14:38:54 +02:00
|
|
|
-- error ER_PARSE_ERROR
|
2006-05-31 19:32:14 +02:00
|
|
|
create table t1 (a int)
|
|
|
|
partition by hash(CURTIME() + a);
|
2011-03-31 14:38:54 +02:00
|
|
|
-- error ER_PARSE_ERROR
|
2006-05-31 19:32:14 +02:00
|
|
|
create table t1 (a int)
|
|
|
|
partition by hash (NOW()+a);
|
|
|
|
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
|
|
|
|
create table t1 (a int)
|
|
|
|
partition by hash (extract(hour from convert_tz(a, '+00:00', '+00:00')));
|
|
|
|
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
|
|
|
|
create table t1 (a int)
|
|
|
|
partition by range (a + (select count(*) from t1))
|
|
|
|
(partition p1 values less than (1));
|
2007-04-04 16:26:32 +02:00
|
|
|
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
|
2006-05-31 19:32:14 +02:00
|
|
|
create table t1 (a char(10))
|
|
|
|
partition by hash (extractvalue(a,'a'));
|
2006-06-14 04:46:38 +02:00
|
|
|
|
2009-12-13 21:29:50 +01:00
|
|
|
--echo #
|
|
|
|
--echo # Bug #42849: innodb crash with varying time_zone on partitioned
|
|
|
|
--echo # timestamp primary key
|
|
|
|
--echo #
|
2006-06-14 04:46:38 +02:00
|
|
|
|
2009-12-13 21:29:50 +01:00
|
|
|
# A correctly partitioned table to test that trying to repartition it using
|
|
|
|
# timezone-dependent expression will throw an error.
|
|
|
|
CREATE TABLE old (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (UNIX_TIMESTAMP(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (1219089600),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
# Check that allowed arithmetic/math functions involving TIMESTAMP values result
|
|
|
|
# in ER_PARTITION_FUNC_NOT_ALLOWED_ERROR when used as a partitioning function
|
|
|
|
|
2010-08-30 17:33:55 +02:00
|
|
|
--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
|
2009-12-13 21:29:50 +01:00
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (a) (
|
|
|
|
PARTITION p VALUES LESS THAN (20080819),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
2010-08-30 17:33:55 +02:00
|
|
|
--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
|
2009-12-13 21:29:50 +01:00
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (a) (
|
|
|
|
PARTITION p VALUES LESS THAN (20080819),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (a+0) (
|
|
|
|
PARTITION p VALUES LESS THAN (20080819),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (a+0) (
|
|
|
|
PARTITION p VALUES LESS THAN (20080819),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (a % 2) (
|
|
|
|
PARTITION p VALUES LESS THAN (20080819),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (a % 2) (
|
|
|
|
PARTITION p VALUES LESS THAN (20080819),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (ABS(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (20080819),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (ABS(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (20080819),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (CEILING(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (20080819),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (CEILING(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (20080819),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (FLOOR(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (20080819),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (FLOOR(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (20080819),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
# Check that allowed date/time functions involving TIMESTAMP values result
|
|
|
|
# in ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR when used as a partitioning function
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (TO_DAYS(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (733638),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (TO_DAYS(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (733638),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (DAYOFYEAR(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (231),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (DAYOFYEAR(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (231),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (DAYOFMONTH(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (19),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (DAYOFMONTH(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (19),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (DAYOFWEEK(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (3),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (DAYOFWEEK(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (3),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (MONTH(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (8),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (MONTH(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (8),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (HOUR(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (17),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (HOUR(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (17),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (MINUTE(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (55),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (MINUTE(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (55),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (QUARTER(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (3),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (QUARTER(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (3),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (SECOND(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (7),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (SECOND(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (7),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (YEARWEEK(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (200833),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (YEARWEEK(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (200833),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (YEAR(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (2008),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (YEAR(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (2008),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (WEEKDAY(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (3),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (WEEKDAY(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (3),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (TIME_TO_SEC(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (64507),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (TIME_TO_SEC(a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (64507),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (EXTRACT(DAY FROM a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (18),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (EXTRACT(DAY FROM a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (18),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL, b TIMESTAMP NOT NULL, PRIMARY KEY(a,b))
|
|
|
|
PARTITION BY RANGE (DATEDIFF(a, a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (18),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (DATEDIFF(a, a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (18),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (YEAR(a + 0)) (
|
|
|
|
PARTITION p VALUES LESS THAN (2008),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (YEAR(a + 0)) (
|
|
|
|
PARTITION p VALUES LESS THAN (2008),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (TO_DAYS(a + '2008-01-01')) (
|
|
|
|
PARTITION p VALUES LESS THAN (733638),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (TO_DAYS(a + '2008-01-01')) (
|
|
|
|
PARTITION p VALUES LESS THAN (733638),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
|
|
|
PARTITION BY RANGE (YEAR(a + '2008-01-01')) (
|
|
|
|
PARTITION p VALUES LESS THAN (2008),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (YEAR(a + '2008-01-01')) (
|
|
|
|
PARTITION p VALUES LESS THAN (2008),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
ALTER TABLE old ADD COLUMN b DATE;
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP, b DATE)
|
|
|
|
PARTITION BY RANGE (YEAR(a + b)) (
|
|
|
|
PARTITION p VALUES LESS THAN (2008),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (YEAR(a + b)) (
|
|
|
|
PARTITION p VALUES LESS THAN (2008),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP, b DATE)
|
|
|
|
PARTITION BY RANGE (TO_DAYS(a + b)) (
|
|
|
|
PARTITION p VALUES LESS THAN (733638),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (TO_DAYS(a + b)) (
|
|
|
|
PARTITION p VALUES LESS THAN (733638),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP, b date)
|
|
|
|
PARTITION BY RANGE (UNIX_TIMESTAMP(a + b)) (
|
|
|
|
PARTITION p VALUES LESS THAN (1219089600),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (UNIX_TIMESTAMP(a + b)) (
|
|
|
|
PARTITION p VALUES LESS THAN (1219089600),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
CREATE TABLE new (a TIMESTAMP, b TIMESTAMP)
|
|
|
|
PARTITION BY RANGE (UNIX_TIMESTAMP(a + b)) (
|
|
|
|
PARTITION p VALUES LESS THAN (1219089600),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
ALTER TABLE old MODIFY b TIMESTAMP;
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE old
|
|
|
|
PARTITION BY RANGE (UNIX_TIMESTAMP(a + b)) (
|
|
|
|
PARTITION p VALUES LESS THAN (1219089600),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
DROP TABLE old;
|
|
|
|
|
2010-09-22 21:33:18 +02:00
|
|
|
--echo #
|
|
|
|
--echo # Bug #56709: Memory leaks at running the 5.1 test suite
|
|
|
|
--echo #
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a TIMESTAMP NOT NULL PRIMARY KEY);
|
|
|
|
|
|
|
|
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
|
|
|
ALTER TABLE t1
|
|
|
|
PARTITION BY RANGE (EXTRACT(DAY FROM a)) (
|
|
|
|
PARTITION p VALUES LESS THAN (18),
|
|
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
|
|
|
|
|
|
|
DROP TABLE t1;
|
|
|
|
|
2009-12-13 21:29:50 +01:00
|
|
|
--echo End of 5.1 tests
|
2014-03-26 09:41:28 +01:00
|
|
|
|
2014-11-18 15:42:40 +01:00
|
|
|
#
|
|
|
|
# MDEV-7113 difference between check_vcol_func_processor and check_partition_func_processor
|
|
|
|
#
|
|
|
|
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
|
|
|
|
create table t1 (a int) partition by list (values(a) div 1) (partition p0 values in (0), partition p1 values in (1));
|
|
|
|
|
|
|
|
--error ER_PARSE_ERROR
|
|
|
|
create table t1 (a int) partition by list (uuid_short()) (partition p0 values in (0), partition p1 values in (1));
|
|
|
|
|
|
|
|
--echo End of 5.5 tests
|
2014-11-19 17:23:39 +01:00
|
|
|
|
2014-03-26 09:41:28 +01:00
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY LIST (a)
|
|
|
|
SUBPARTITION BY HASH (a) SUBPARTITIONS 2
|
|
|
|
(PARTITION p1 VALUES IN (1) COMMENT "Comment in p1"
|
|
|
|
(SUBPARTITION p1spFirst COMMENT "SubPartition comment in p1spFirst",
|
|
|
|
SUBPARTITION p1spSecond COMMENT "SubPartition comment in p1spSecond"),
|
|
|
|
PARTITION p2 VALUES IN (2) COMMENT "Comment in p2"
|
|
|
|
(SUBPARTITION p2spFirst COMMENT "SubPartition comment in p2spFirst",
|
|
|
|
SUBPARTITION p2spSecond COMMENT "SubPartition comment in p2spSecond"));
|
|
|
|
SHOW CREATE TABLE t1;
|
|
|
|
SELECT PARTITION_NAME, SUBPARTITION_NAME, PARTITION_COMMENT FROM INFORMATION_SCHEMA.PARTITIONS
|
|
|
|
WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test';
|
|
|
|
DROP TABLE t1;
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a INT)
|
|
|
|
PARTITION BY LIST (a)
|
|
|
|
SUBPARTITION BY HASH (a) SUBPARTITIONS 2
|
|
|
|
(PARTITION p1 VALUES IN (1)
|
|
|
|
(SUBPARTITION p1spFirst COMMENT "SubPartition comment in p1spFirst",
|
|
|
|
SUBPARTITION p1spSecond),
|
|
|
|
PARTITION p2 VALUES IN (2) COMMENT "Comment in p2"
|
|
|
|
(SUBPARTITION p2spFirst,
|
|
|
|
SUBPARTITION p2spSecond COMMENT "SubPartition comment in p2spSecond"));
|
|
|
|
SHOW CREATE TABLE t1;
|
|
|
|
SELECT PARTITION_NAME, SUBPARTITION_NAME, PARTITION_COMMENT FROM INFORMATION_SCHEMA.PARTITIONS
|
|
|
|
WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test';
|
|
|
|
DROP TABLE t1;
|
|
|
|
|
2017-02-08 21:28:00 +01:00
|
|
|
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
|
2014-03-26 09:41:28 +01:00
|
|
|
CREATE TABLE t1
|
|
|
|
(a INT ,
|
|
|
|
KEY inx_a (a) )
|
|
|
|
PARTITION BY RANGE (a)
|
|
|
|
SUBPARTITION BY HASH (a) SUBPARTITIONS 2
|
|
|
|
(PARTITION pUpTo10 VALUES LESS THAN (10) COMMENT
|
|
|
|
"This is a long comment (2050 ascii characters) 50 pUpTo10 partition ......80-!.................. 100 ................................................................................................ 200....................................................................................................................................................................................................................................................................................................... 500 ............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 1000 ..............1024-|.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 1500 .............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 2000 ......................................2048-|++"
|
|
|
|
(SUBPARTITION `p-10sp0` ,SUBPARTITION `p-10sp1` ),
|
|
|
|
PARTITION pMax VALUES LESS THAN MAXVALUE COMMENT
|
|
|
|
"This is a long comment (2050 ascii characters) 50 pMax partition comment .80-!.................. 100 ................................................................................................ 200....................................................................................................................................................................................................................................................................................................... 500 ............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 1000 ..............1024-|.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 1500 .............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 2000 ......................................2048-|++"
|
|
|
|
(SUBPARTITION `pMaxsp0` ,SUBPARTITION `pMaxsp1` ));
|
|
|
|
|
|
|
|
SHOW CREATE TABLE t1;
|
|
|
|
SELECT PARTITION_NAME, SUBPARTITION_NAME, PARTITION_COMMENT FROM INFORMATION_SCHEMA.PARTITIONS
|
|
|
|
WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test';
|
|
|
|
|
|
|
|
DROP TABLE t1;
|