Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22

into  ramayana.hindu.god:/home/tsmith/m/bk/51-target22-X
This commit is contained in:
tsmith@ramayana.hindu.god 2007-08-27 14:23:02 -06:00
commit c0fd09224b
80 changed files with 7315 additions and 9819 deletions

View file

@ -9,5 +9,6 @@ eval SHOW CREATE TABLE t1;
# listing of files belonging to the table t1
if ($ls)
{
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec ls $MYSQLTEST_VARDIR/master-data/test/t1*
}

View file

@ -501,7 +501,7 @@ ERROR 23000: Duplicate entry 'test2' for key 'ggid'
select * from t1;
id ggid email passwd
1 this will work
3 test2 this will work
4 test2 this will work
select * from t1 where id=1;
id ggid email passwd
1 this will work

View file

@ -17,6 +17,18 @@
--echo --- All SQL functions should be rejected, otherwise BUG (see 18198)
--echo -------------------------------------------------------------------------
let $sqlfunc = ascii(col1);
let $valsqlfunc = ascii('a');
let $coltype = char(30);
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = ord(col1);
let $valsqlfunc = ord('a');
let $coltype = char(30);
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = greatest(col1,15);
let $valsqlfunc = greatest(1,15);
let $coltype = int;
@ -151,12 +163,6 @@ let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = datediff(col1,col1);
let $valsqlfunc = datediff('1997-11-30 23:59:59','1997-12-31');
let $coltype = datetime;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = period_add(col1,5);
let $valsqlfunc = period_add(9804,5);
let $coltype = datetime;
@ -190,6 +196,12 @@ let $coltype = datetime;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = weekofyear(col1);
let $valsqlfunc = weekofyear('2002-05-01');
let $coltype = datetime;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
let $sqlfunc = cast(col1 as signed);
let $valsqlfunc = cast(123 as signed);
let $coltype = varchar(30);

View file

@ -40,61 +40,42 @@ let $val4 = 15 ;
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = ascii(col1);
let $valsqlfunc = ascii('5');
let $coltype = char(1);
let $infile = part_supported_sql_funcs_int_ch1.inc;
let $val1 = '1';
let $val2 = '9';
let $val3 = '3';
let $val4 = '8';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = cast(ceiling(col1) as signed integer);
let $valsqlfunc = cast(ceiling(15) as signed integer);
let $sqlfunc = ceiling(col1);
let $valsqlfunc = ceiling(15);
let $coltype = float(7,4);
let $infile = part_supported_sql_funcs_int_float.inc;
let $val1 = 5.1230;
let $val2 = 13.345;
let $val3 = 17.987;
let $val4 = 15.654 ;
--source suite/parts/inc/partition_supported_sql_funcs.inc
# DISABLED due to bug 30577
#--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = cast(floor(col1) as signed);
let $valsqlfunc = cast(floor(15.123) as signed);
let $sqlfunc = floor(col1);
let $valsqlfunc = floor(15.123);
let $coltype = float(7,4);
let $infile = part_supported_sql_funcs_int_float.inc;
let $val1 = 5.1230;
let $val2 = 13.345;
let $val3 = 17.987;
let $val4 = 15.654 ;
--source suite/parts/inc/partition_supported_sql_funcs.inc
# DISABLED due to bug 30577
#--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = cast(mod(col1,10) as signed);
let $valsqlfunc = cast(mod(15,10) as signed);
let $coltype = float(7,4);
let $infile = part_supported_sql_funcs_int_float.inc;
let $val1 = 5.0000;
let $sqlfunc = mod(col1,10);
let $valsqlfunc = mod(15,10);
let $coltype = int;
let $infile = part_supported_sql_funcs_int_int.inc;
let $val1 = 5;
let $val2 = 19;
let $val3 = 17;
let $val4 = 15 ;
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = ord(col1);
let $valsqlfunc = ord('a');
let $coltype = char(3);
let $infile = part_supported_sql_funcs_int_ch1.inc;
let $val1 = '1';
let $val2 = '9';
let $val3 = '3';
let $val4 = '8';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = day(col1);
let $valsqlfunc = day('2006-12-21');
let $coltype = date;
@ -243,6 +224,18 @@ let $val4 = '2006-02-06';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
# DATEDIFF() is implemented as (TO_DAYS(d1) - TO_DAYS(d2))
let $sqlfunc = datediff(col1, '2006-01-01');
let $valsqlfunc = datediff('2006-02-02', '2006-01-01');
let $coltype = date;
let $infile = part_supported_sql_funcs_int_date.inc;
let $val1 = '2006-02-03';
let $val2 = '2006-01-17';
let $val3 = '2006-01-25';
let $val4 = '2006-02-06';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = weekday(col1);
let $valsqlfunc = weekday('2006-10-14');
let $coltype = date;
@ -254,17 +247,6 @@ let $val4 = '2006-02-06';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = weekofyear(col1);
let $valsqlfunc = weekofyear('2006-02-14');
let $coltype = date;
let $infile = part_supported_sql_funcs_int_date.inc;
let $val1 = '2006-01-03';
let $val2 = '2006-03-17';
let $val3 = '2006-05-25';
let $val4 = '2006-09-06';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
let $sqlfunc = year(col1)-1990;
let $valsqlfunc = year('2005-10-14')-1990;
let $coltype = date;

View file

@ -43,16 +43,16 @@ SELECT IF(9999 - 1000 + 1 > @max_row, @max_row , 9999 - 1000 + 1)
ALTER TABLE t1 ADD PARTITION (PARTITION part2);
#
--echo # 1.1.2 Assign HASH partitioning
ALTER TABLE t1 PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER));
ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date));
--source include/partition_layout.inc
--source suite/parts/inc/partition_check_read1.inc
#
--echo # 1.1.3 Assign other HASH partitioning to already partitioned table
--echo # + test and switch back + test
ALTER TABLE t1 PARTITION BY HASH(CAST(f_varchar AS SIGNED INTEGER));
ALTER TABLE t1 PARTITION BY HASH(DAYOFYEAR(f_date));
--source include/partition_layout.inc
--source suite/parts/inc/partition_check_read1.inc
ALTER TABLE t1 PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER));
ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date));
--source include/partition_layout.inc
--source suite/parts/inc/partition_check_read1.inc
#

View file

@ -36,8 +36,9 @@
eval $insert_first_half;
# Possible/Expected return codes for ALTER TABLE ...
# 0
# 1491: A PRIMARY KEY need to include all fields in the partition function
# A UNIQUE INDEX need to include all fields in the partition function
# 1030: ER_GET_ERRNO
# 1500: ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
# 1504: ER_DROP_PARTITION_NON_EXISTENT
--disable_abort_on_error
eval $alter;
--enable_abort_on_error
@ -47,11 +48,11 @@ if ($no_debug)
}
eval SET @my_errno = $mysql_errno;
let $run_test= `SELECT @my_errno = 0`;
let $unexpected_error= `SELECT @my_errno NOT IN (0,1030,1491,1495)`;
let $unexpected_error= `SELECT @my_errno NOT IN (0,1030,1500,1504)`;
if ($unexpected_error)
{
--echo # The last command got an unexepected error response.
--echo # Expected/handled SQL codes are 0,1030,1491,1495
--echo # Expected/handled SQL codes are 0,1030,1500,1504
SELECT '# SQL code we got was: ' AS "", @my_errno AS "";
--echo # Sorry, have to abort.
exit;

View file

@ -15,8 +15,7 @@
--echo -------------------------------------------------------------------------
--echo --- $sqlfunc in partition with coltype $coltype
--echo -------------------------------------------------------------------------
--echo must all fail! (delete 0 and comment char, if bug fixed)
--disable_abort_on_error
--echo must all fail!
--disable_warnings
drop table if exists t1 ;
drop table if exists t2 ;
@ -26,32 +25,31 @@ drop table if exists t5 ;
drop table if exists t6 ;
--enable_warnings
#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t1 (col1 $coltype) engine=$engine
partition by range($sqlfunc)
(partition p0 values less than (15),
partition p1 values less than (31));
#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t2 (col1 $coltype) engine=$engine
partition by list($sqlfunc)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t3 (col1 $coltype) engine=$engine
partition by hash($sqlfunc);
--enable_abort_on_error
--error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t4 (colint int, col1 $coltype) engine=$engine
partition by range(colint)
subpartition by hash($sqlfunc) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
--error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t5 (colint int, col1 $coltype) engine=$engine
partition by list(colint)
subpartition by hash($sqlfunc) subpartitions 2
@ -59,7 +57,7 @@ subpartition by hash($sqlfunc) subpartitions 2
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
--error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t6 (colint int, col1 $coltype) engine=$engine
partition by range(colint)
(partition p0 values less than ($valsqlfunc),
@ -75,50 +73,44 @@ drop table if exists t55 ;
drop table if exists t66 ;
--enable_warnings
#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t11 (col1 $coltype) engine=$engine ;
#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t22 (col1 $coltype) engine=$engine ;
#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t33 (col1 $coltype) engine=$engine ;
--error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t44 (colint int, col1 $coltype) engine=$engine ;
--error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t55 (colint int, col1 $coltype) engine=$engine ;
--error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t66 (colint int, col1 $coltype) engine=$engine ;
#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval alter table t11
partition by range($sqlfunc)
(partition p0 values less than (15),
partition p1 values less than (31));
#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval alter table t22
partition by list($sqlfunc)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval alter table t33
partition by hash($sqlfunc);
--enable_abort_on_error
--error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval alter table t44
partition by range(colint)
subpartition by hash($sqlfunc) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
--error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval alter table t55
partition by list(colint)
subpartition by hash($sqlfunc) subpartitions 2
@ -126,7 +118,7 @@ subpartition by hash($sqlfunc) subpartitions 2
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
--error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval alter table t66
partition by range(colint)
(partition p0 values less than ($valsqlfunc),

View file

@ -156,8 +156,8 @@ if ($run)
# partitioning mechanism.
# Sideeffect: Attempt to INSERT one record
# DUPLICATE KEY will appear if we have UNIQUE columns
# 1022: Can't write; duplicate key in table 't1' UIDX/PK(f_int1)
# 1062: Duplicate entry '2' for key 1 UIDX/PK(f_int2)
# 1022: ER_DUP_KEY
# 1062: ER_DUP_ENTRY
--disable_abort_on_error
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
@ -200,7 +200,8 @@ if ($any_unique)
## 1.3.1 Check, if f_int1 is UNIQUE
# Sideeffect: Attempt to INSERT one record
# DUPLICATE KEY will appear if we have UNIQUE columns
# 1022: Can't write; duplicate key in table 't1' UIDX/PK
# 1022: ER_DUP_KEY
# 1062: ER_DUP_ENTRY
--disable_abort_on_error
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
@ -494,8 +495,9 @@ WHERE f_charbig = '#SINGLE#' AND f_int1 IN (-1,@cur_value);
# 4.7 Insert one record with such a big value for f_int1, so that in case
# - f_int1 is used within the partitioning algorithm
# - we use range partitioning
# we get error ER_NO_PARTITION_FOR_GIVEN_VALUE (1514)
# we get error ER_NO_PARTITION_FOR_GIVEN_VALUE (1523)
# "Table has no partition for value ...."
# or ER_SAME_NAME_PARTITION (1514)
--disable_abort_on_error
eval INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#$max_int_4##';
--enable_abort_on_error
@ -504,11 +506,11 @@ if ($no_debug)
--disable_query_log
}
eval SET @my_errno = $mysql_errno;
let $unexpected_error= `SELECT @my_errno NOT IN (0,1505,1514)`;
let $unexpected_error= `SELECT @my_errno NOT IN (0,1514,1523)`;
if ($unexpected_error)
{
--echo # The last command got an unexepected error response.
--echo # Expected/handled SQL codes are 0,1514
--echo # Expected/handled SQL codes are 0,1514,1523
SELECT '# SQL code we got was: ' AS "", @my_errno AS "";
--echo # Sorry, have to abort.
exit;
@ -555,8 +557,8 @@ INSERT t1 SET f_int1 = 0 , f_int2 = 0,
# f1 "=" NULL is a delicate value which might stress the partitioning
# mechanism if the result of the expression in the partitioning algorithm
# becomes NULL.
# Not: This INSERT will fail, if f_int1 is PRIMARY KEY or UNIQUE INDEX
# 1048: Column 'f_int1' cannot be null
# This INSERT will fail, if f_int1 is PRIMARY KEY or UNIQUE INDEX
# 1048: ER_BAD_NULL_ERROR
--disable_abort_on_error
INSERT INTO t1

View file

@ -49,7 +49,7 @@ select * from t2;
drop table t2;
eval create table t3 (a date not null, primary key(a)) engine=$engine
partition by range (cast(month(a) as unsigned)) subpartition by key (a)
partition by range (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (4),
partition quarter2 values less than (7),
@ -69,7 +69,7 @@ select * from t3;
drop table t3;
eval create table t4 (a date not null, primary key(a)) engine=$engine
partition by list (cast(month(a) as unsigned)) subpartition by key (a)
partition by list (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (1,2,3),
partition quarter2 values in (4,5,6),

View file

@ -46,7 +46,7 @@ select * from t2;
drop table t2;
eval create table t3 (a datetime not null, primary key(a)) engine=$engine
partition by range (cast(month(a) as unsigned)) subpartition by key (a)
partition by range (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (4),
partition quarter2 values less than (7),
@ -66,7 +66,7 @@ select * from t3;
drop table t3;
eval create table t4 (a datetime not null, primary key(a)) engine=$engine
partition by list (cast(month(a) as unsigned)) subpartition by key (a)
partition by list (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (1,2,3),
partition quarter2 values in (4,5,6),

View file

@ -47,8 +47,15 @@ dec $count;
select count(*) from t2;
drop table t2;
# Bug 30577: FLOOR() and CEILING() not usable as partition functions
# Partition functions are required to return INT_RESULT; FLOOR() and
# CEILING() do not, unless they have an INT argument. Disable this
# portion of the test until bug 30577 is fixed.
--disable_parsing
eval create table t3 (a decimal(18,9) not null, primary key(a)) engine=$engine
partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 2 (
partition by range (floor(a)) subpartition by key (a) subpartitions 2 (
partition pa2 values less than (2),
partition pa4 values less than (4),
partition pa6 values less than (6),
@ -70,7 +77,7 @@ select count(*) from t3;
drop table t3;
eval create table t4 (a decimal(18,9) not null, primary key(a)) engine=$engine
partition by list (cast(floor(a) as signed)) subpartition by key (a) subpartitions 2 (
partition by list (floor(a)) subpartition by key (a) subpartitions 2 (
partition pa2 values in (1,2),
partition pa4 values in (3,4),
partition pa6 values in (5,6),
@ -90,3 +97,6 @@ dec $count;
--enable_query_log
select count(*) from t4;
drop table t4;
# Disabled due to Bug 30577
--enable_parsing

View file

@ -29,9 +29,9 @@ let $partitioning= ;
if ($with_partitioning)
{
let $partitioning= PARTITION BY HASH(f_int1) PARTITIONS 2;
--disable_query_log
if ($with_directories)
{
--disable_query_log
eval SET @aux =
'PARTITION BY HASH(f_int1) PARTITIONS 2
(PARTITION p1
@ -39,7 +39,6 @@ $index_directory,
PARTITION p2
$index_directory)';
let $partitioning= `SELECT @aux`;
--enable_query_log
}
}
eval CREATE TABLE t1 (
@ -47,6 +46,7 @@ $column_list
$unique
)
$partitioning;
--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@ -54,9 +54,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY KEY
--disable_query_log
if ($with_partitioning)
{
--disable_query_log
eval SET @aux =
'PARTITION BY KEY(f_int1) PARTITIONS 5';
let $partitioning= `SELECT @aux`;
@ -76,7 +76,6 @@ PARTITION p4,
PARTITION p5
$index_directory)';
let $partitioning= `SELECT @aux`;
--enable_query_log
}
}
eval CREATE TABLE t1 (
@ -84,6 +83,7 @@ $column_list
$unique
)
$partitioning;
--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@ -91,9 +91,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY LIST
--disable_query_log
if ($with_partitioning)
{
--disable_query_log
eval SET @aux =
'PARTITION BY LIST(MOD(f_int1,4))
(PARTITION part_3 VALUES IN (-3)
@ -119,6 +119,7 @@ $column_list
$unique
)
$partitioning;
--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@ -126,9 +127,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY RANGE
--disable_query_log
if ($with_partitioning)
{
#--disable_query_log
eval SET @aux = 'PARTITION BY RANGE(f_int1)
(PARTITION parta VALUES LESS THAN (0)
$index_directory,
@ -143,13 +144,13 @@ $data_directory,
PARTITION partf VALUES LESS THAN $MAX_VALUE
$index_directory)';
let $partitioning= `SELECT @aux`;
#--enable_query_log
}
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@ -157,9 +158,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY RANGE -- SUBPARTITION BY HASH
--disable_query_log
if ($with_partitioning)
{
--disable_query_log
eval SET @aux =
'PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
(PARTITION parta VALUES LESS THAN (0)
@ -171,13 +172,13 @@ PARTITION partd VALUES LESS THAN $MAX_VALUE
$data_directory
$index_directory)';
let $partitioning= `SELECT @aux`;
--enable_query_log
}
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@ -185,9 +186,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY RANGE -- SUBPARTITION BY KEY
--disable_query_log
if ($with_partitioning)
{
--disable_query_log
eval SET @aux = 'PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
(PARTITION part1 VALUES LESS THAN (0)
$data_directory
@ -202,13 +203,13 @@ $index_directory
PARTITION part4 VALUES LESS THAN $MAX_VALUE
(SUBPARTITION subpart41, SUBPARTITION subpart42))';
let $partitioning= `SELECT @aux`;
--enable_query_log
}
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@ -216,9 +217,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY LIST -- SUBPARTITION BY HASH
--disable_query_log
if ($with_partitioning)
{
--disable_query_log
eval SET @aux =
'PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
(PARTITION part1 VALUES IN (0)
@ -246,13 +247,13 @@ eval SET @aux =
$data_directory
$index_directory))';
let $partitioning= `SELECT @aux`;
--enable_query_log
}
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc

View file

@ -48,8 +48,15 @@ select count(*) from t2;
drop table t2;
# Bug 30577: FLOOR() and CEILING() not usable as partition functions
# Partition functions are required to return INT_RESULT; FLOOR() and
# CEILING() do not, unless they have an INT argument. Disable this
# portion of the test until bug 30577 is fixed.
--disable_parsing
eval create table t3 (a double not null, primary key(a)) engine=$engine
partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 (
partition by range (floor(a)) subpartition by key (a) subpartitions 3 (
partition pa1 values less than (3),
partition pa3 values less than (6),
partition pa10 values less than (10)
@ -69,7 +76,7 @@ select * from t3;
drop table t3;
eval create table t4 (a double not null, primary key(a)) engine=$engine
partition by list (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 (
partition by list (floor(a)) subpartition by key (a) subpartitions 3 (
partition pa1 values in (1,2,3),
partition pa3 values in (4,5,6),
partition pa10 values in (7,8,9,10)
@ -87,3 +94,6 @@ dec $count;
select count(*) from t4;
select * from t4;
drop table t4;
# Disabled due to Bug 30577
--enable_parsing

View file

@ -53,7 +53,7 @@ eval create table t3 (a enum (
'M','N','O','P','Q','R','S','T','U','V','W','X',
'Y','Z'
) not null, primary key(a)) engine=$engine
partition by range (cast(a as unsigned)) subpartition by key (a) subpartitions 3 (
partition by range (a) subpartition by key (a) subpartitions 3 (
partition pa9 values less than (10),
partition pa18 values less than (19),
partition pa27 values less than (28),
@ -72,28 +72,3 @@ select count(*) from t3;
select * from t3;
drop table t3;
eval create table t4 (a enum (
'1','2','3','4','5','6','7','8','9','0',
'A','B','C','D','E','F','G','H','I','J','K','L',
'M','N','O','P','Q','R','S','T','U','V','W','X',
'Y','Z'
) not null, primary key(a)) engine=$engine
partition by list (cast(a as unsigned)) subpartition by key (a) subpartitions 3 (
partition pa9 values in (1,2,3,4,5,6,7,8,9),
partition pa18 values in (10,11,12,13,14,15,16,17,18),
partition pa27 values in (19,20,21,22,23,24,25,26,27),
partition pa36 values in (28,29,30,31,32,33,34,35,36)
);
show create table t4;
let $letter=36;
--echo $count inserts;
#--disable_query_log
while ($letter)
{
#eval insert into t4 values ($letter);
dec $letter;
}
select count(*) from t4;
select * from t4;
drop table t4;

View file

@ -51,8 +51,15 @@ dec $count;
select count(*) from t2;
drop table t2;
# Bug 30577: FLOOR() and CEILING() not usable as partition functions
# Partition functions are required to return INT_RESULT; FLOOR() and
# CEILING() do not, unless they have an INT argument. Disable this
# portion of the test until bug 30577 is fixed.
--disable_parsing
eval create table t3 (a float not null, primary key(a)) engine=$engine
partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 (
partition by range (floor(a)) subpartition by key (a) subpartitions 3 (
partition pa1 values less than (3),
partition pa3 values less than (6),
partition pa10 values less than (10)
@ -72,7 +79,7 @@ select * from t3;
drop table t3;
eval create table t4 (a float not null, primary key(a)) engine=$engine
partition by list (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 (
partition by list (floor(a)) subpartition by key (a) subpartitions 3 (
partition pa1 values in (1,2,3),
partition pa3 values in (4,5,6),
partition pa10 values in (7,8,9,10)
@ -90,3 +97,6 @@ dec $count;
select count(*) from t4;
select * from t4;
drop table t4;
# Disabled due to Bug 30577
--enable_parsing

View file

@ -56,6 +56,7 @@ eval INSERT INTO t0_definition SET state = 'old',
file_list = $file_list;
# Print the create table statement into the protocol
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
SELECT create_command FROM t0_definition WHERE state = 'old';
if ($do_file_tests)
{

View file

@ -55,6 +55,7 @@ let $run= `SELECT @aux`;
if ($run)
{
--vertical_results
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
SELECT state,
REPLACE(create_command,'\n',' ') AS "Table definition",
REPLACE(file_list ,'\n',' ') AS "File list"

View file

@ -44,9 +44,9 @@ let $partitioning= ;
if ($with_partitioning)
{
let $partitioning= PARTITION BY HASH(f_int1) PARTITIONS 2;
--disable_query_log
if ($with_directories)
{
--disable_query_log
eval SET @aux =
'PARTITION BY HASH(f_int1) PARTITIONS 2
(PARTITION p1
@ -56,7 +56,6 @@ PARTITION p2
$data_directory
$index_directory)';
let $partitioning= `SELECT @aux`;
--enable_query_log
}
}
eval CREATE TABLE t1 (
@ -64,6 +63,7 @@ $column_list
$unique
)
$partitioning;
--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@ -71,15 +71,14 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY KEY
--disable_query_log
if ($with_partitioning)
{
--disable_query_log
eval SET @aux =
'PARTITION BY KEY(f_int1) PARTITIONS 5';
let $partitioning= `SELECT @aux`;
if ($with_directories)
{
--disable_query_log
eval SET @aux =
'PARTITION BY HASH(f_int1) PARTITIONS 5
(PARTITION p1
@ -98,7 +97,6 @@ PARTITION p5
$data_directory
$index_directory)';
let $partitioning= `SELECT @aux`;
--enable_query_log
}
}
eval CREATE TABLE t1 (
@ -106,6 +104,7 @@ $column_list
$unique
)
$partitioning;
--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@ -113,9 +112,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY LIST
--disable_query_log
if ($with_partitioning)
{
--disable_query_log
eval SET @aux =
'PARTITION BY LIST(MOD(f_int1,4))
(PARTITION part_3 VALUES IN (-3)
@ -141,6 +140,7 @@ $column_list
$unique
)
$partitioning;
--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@ -148,9 +148,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY RANGE
--disable_query_log
if ($with_partitioning)
{
#--disable_query_log
eval SET @aux = 'PARTITION BY RANGE(f_int1)
(PARTITION parta VALUES LESS THAN (0)
$data_directory
@ -171,13 +171,13 @@ PARTITION partf VALUES LESS THAN $MAX_VALUE
$data_directory
$index_directory)';
let $partitioning= `SELECT @aux`;
#--enable_query_log
}
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@ -185,9 +185,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY RANGE -- SUBPARTITION BY HASH
--disable_query_log
if ($with_partitioning)
{
--disable_query_log
eval SET @aux =
'PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
(PARTITION parta VALUES LESS THAN (0)
@ -203,13 +203,13 @@ PARTITION partd VALUES LESS THAN $MAX_VALUE
$data_directory
$index_directory)';
let $partitioning= `SELECT @aux`;
--enable_query_log
}
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@ -217,9 +217,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY RANGE -- SUBPARTITION BY KEY
--disable_query_log
if ($with_partitioning)
{
--disable_query_log
eval SET @aux = 'PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
(PARTITION part1 VALUES LESS THAN (0)
$data_directory
@ -238,13 +238,13 @@ $data_directory
$index_directory
(SUBPARTITION subpart41, SUBPARTITION subpart42))';
let $partitioning= `SELECT @aux`;
--enable_query_log
}
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@ -252,9 +252,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY LIST -- SUBPARTITION BY HASH
--disable_query_log
if ($with_partitioning)
{
--disable_query_log
eval SET @aux =
'PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
(PARTITION part1 VALUES IN (0)
@ -290,13 +290,13 @@ eval SET @aux =
$data_directory
$index_directory))';
let $partitioning= `SELECT @aux`;
--enable_query_log
}
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@ -304,9 +304,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY LIST -- SUBPARTITION BY KEY
--disable_query_log
if ($with_partitioning)
{
--disable_query_log
eval SET @aux =
'PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int1) SUBPARTITIONS $sub_part_no
@ -320,13 +320,13 @@ SUBPARTITION BY KEY(f_int1) SUBPARTITIONS $sub_part_no
$data_directory
$index_directory)';
let $partitioning= `SELECT @aux`;
--enable_query_log
}
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc

View file

@ -43,41 +43,3 @@ insert into t2 values ('1,2,3'),('2,3,4'),('3,4,5'),('4,5,6'),('5,6,7'),('6,7,8'
select count(*) from t2;
select * from t2 order by a;
drop table t2;
eval create table t3 (a set (
'1','2','3','4','5','6','7','8','9','0'
) not null, primary key(a)) engine=$engine
partition by range (cast(a as unsigned)) subpartition by key (a) subpartitions 3 (
partition pa9 values less than (10),
partition pa18 values less than (19),
partition pa27 values less than (28),
partition pa36 values less than (37),
partition pa64 values less than (65),
partition pa128 values less than (129),
partition pa256 values less than (257),
partition pa512 values less than (513),
partition pa768 values less than (769),
partition pa1024 values less than (1025)
);
show create table t3;
#insert into t3 values ('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9'),('0');
#insert into t3 values ('1,2'),('2,3'),('3,4'),('4,5'),('5,6'),('6,7'),('7,8'),('8,9'),('9,0'),('0,1');
#insert into t3 values ('1,2,3'),('2,3,4'),('3,4,5'),('4,5,6'),('5,6,7'),('6,7,8'),('7,8,9'),('8,9,0'),('9,0,1'),('0,1,2');
select count(*) from t3;
select * from t3 order by a;
drop table t3;
eval create table t4 (a set (
'1','2','3') not null, primary key(a)) engine=$engine
partition by list (cast(a as unsigned)) subpartition by key (a) subpartitions 3 (
partition pa9 values in (1,2,3,4,5,6,7,8,9),
partition pa18 values in (10,11,12,13,14,15,16,17,18),
partition pa27 values in (19,20,21,22,23,24,25,26,27)
);
show create table t4;
#insert into t4 values ('1'),('2'),('3');
#insert into t4 values ('1,2'),('2,3'),('3,1');
#insert into t4 values ('1,2,3');
select count(*) from t4;
select * from t4 order by a;
drop table t4;

View file

@ -83,14 +83,9 @@ eval insert into t3 values ($val1);
eval insert into t3 values ($val2);
eval insert into t3 values ($val3);
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/parts/inc/$infile' into table t4;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/parts/inc/$infile' into table t5;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/parts/inc/$infile' into table t6;
eval load data infile '../std_data_ln/parts/$infile' into table t4;
eval load data infile '../std_data_ln/parts/$infile' into table t5;
eval load data infile '../std_data_ln/parts/$infile' into table t6;
eval select $sqlfunc from t1 order by col1;

View file

@ -331,13 +331,13 @@ $column_list
PARTITION BY RANGE(f_int1)
( PARTITION part1 VALUES LESS THAN (NULL),
PARTITION part2 VALUES LESS THAN (1000));
--echo # 3.5.1.2 VALUE LESS THAN (CAST(NULL AS SIGNED INTEGER)) is not allowed
--echo # 3.5.1.2 VALUE LESS THAN (NULL) is not allowed
--error 1064
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY RANGE(f_int1)
( PARTITION part1 VALUES LESS THAN (CAST(NULL AS SIGNED INTEGER)),
( PARTITION part1 VALUES LESS THAN (NULL),
PARTITION part2 VALUES LESS THAN (1000));
--echo # 3.5.2 NULL in LIST partitioning clause
--echo # 3.5.2.1 VALUE IN (NULL)
@ -349,14 +349,14 @@ PARTITION BY LIST(MOD(f_int1,2))
PARTITION part2 VALUES IN (0),
PARTITION part3 VALUES IN (1));
DROP TABLE t1;
--echo # 3.5.2.2 VALUE IN (CAST(NULL AS SIGNED INTEGER))
--echo # 3.5.2.2 VALUE IN (NULL)
# Attention: It is intended that there is no partition with
# VALUES IN (0), because there was a time where NULL was treated as zero
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY LIST(MOD(f_int1,2))
( PARTITION part1 VALUES IN (CAST(NULL AS SIGNED INTEGER)),
( PARTITION part1 VALUES IN (NULL),
PARTITION part3 VALUES IN (1));
--source suite/parts/inc/partition_layout_check1.inc
# --source include/partition_layout_check1.inc
@ -368,7 +368,7 @@ eval CREATE TABLE t1 (
$column_list
)
PARTITION BY LIST(MOD(f_int1,2))
( PARTITION part1 VALUES IN (CAST(NULL AS SIGNED INTEGER)),
( PARTITION part1 VALUES IN (NULL),
PARTITION part2 VALUES IN (0),
PARTITION part3 VALUES IN (1));
--source suite/parts/inc/partition_layout_check1.inc

View file

@ -28,15 +28,15 @@ eval SET @my_errno= $mysql_errno ;
let $run= `SELECT @my_errno = 0`;
# Expected error codes are
# 0
# 1064 ERROR 42000: You have an error in your SQL syntax
# Reason: assign -1 partitions
# 1486 ERROR HY000: Too many partitions (including subpartitions) were defined
# 1491 ERROR HY000: Number of partitions = 0 is not an allowed value
let $unexpected_error= `SELECT @my_errno NOT IN (0,1064,1487,1492)`;
# 1064 ER_PARSE_ERROR
# Reason: assign -1 partitions
# 1496 ER_TOO_MANY_PARTITIONS_ERROR
# 1501 ER_NO_PARTS_ERROR
let $unexpected_error= `SELECT @my_errno NOT IN (0,1064,1496,1501)`;
if ($unexpected_error)
{
--echo # The last command got an unexepected error response.
--echo # Expected/handled SQL codes are 0,1064,1487,1492
--echo # Expected/handled SQL codes are 0,1064,1496,1501
SELECT '# SQL code we got was: ' AS "", @my_errno AS "";
--echo # Sorry, have to abort.
exit;
@ -66,15 +66,15 @@ eval SET @my_errno= $mysql_errno ;
let $run= `SELECT @my_errno = 0`;
# Expected error codes are
# 0
# 1064 ERROR 42000: You have an error in your SQL syntax
# Reason: assign -1 subpartitions
# 1487 ERROR HY000: Too many partitions (including subpartitions) were defined
# 1492 ERROR HY000: Number of partitions = 0 is not an allowed value
let $unexpected_error= `SELECT @my_errno NOT IN (0,1064,1487,1492)`;
# 1064 ER_PARSE_ERROR
# Reason: assign -1 partitions
# 1496 ER_TOO_MANY_PARTITIONS_ERROR
# 1501 ER_NO_PARTS_ERROR
let $unexpected_error= `SELECT @my_errno NOT IN (0,1064,1496,1501)`;
if ($unexpected_error)
{
--echo # The last command got an unexepected error response.
--echo # Expected/handled SQL codes are 0,1064,1487,1492
--echo # Expected/handled SQL codes are 0,1064,1496,1501
SELECT '# SQL code we got was: ' AS "", @my_errno AS "";
--echo # Sorry, have to abort.
exit;

View file

@ -46,7 +46,7 @@ select * from t2;
drop table t2;
eval create table t3 (a time not null, primary key(a)) engine=$engine
partition by range (cast(second(a) as unsigned)) subpartition by key (a)
partition by range (second(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (16),
partition quarter2 values less than (31),
@ -66,7 +66,7 @@ select * from t3;
drop table t3;
eval create table t4 (a time not null, primary key(a)) engine=$engine
partition by list (cast(second(a) as unsigned)) subpartition by key (a)
partition by list (second(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
partition quarter2 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),

View file

@ -46,7 +46,7 @@ select * from t2;
drop table t2;
eval create table t3 (a timestamp not null, primary key(a)) engine=$engine
partition by range (cast(month(a) as unsigned)) subpartition by key (a)
partition by range (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (4),
partition quarter2 values less than (7),
@ -66,7 +66,7 @@ select * from t3;
drop table t3;
eval create table t4 (a timestamp not null, primary key(a)) engine=$engine
partition by list (cast(month(a) as unsigned)) subpartition by key (a)
partition by list (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (0,1,2,3),
partition quarter2 values in (4,5,6),

View file

@ -12,6 +12,16 @@
# Change: #
################################################################################
--echo
--echo This test relies on the CAST() function for partitioning, which
--echo is not allowed. Not deleting it yet, as it may have some useful
--echo bits in it. See Bug #30581, "partition_value tests use disallowed
--echo CAST() function"
--echo
--disable_parsing
--echo
--echo #========================================================================
--echo # Calculation of "exotic" results within the partition function
@ -155,3 +165,5 @@ VALUES(NULL,NULL,NULL,NULL,NULL);
eval SELECT COUNT(*) = 1 FROM t1 WHERE f_char2 IS NULL;
DROP TABLE t1;
#
--enable_parsing

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -64,7 +64,7 @@ t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.frm
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where
@ -78,15 +78,15 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
ALTER TABLE t1 ADD PARTITION (PARTITION part2);
ERROR HY000: Partition management on a not partitioned table is not possible
# 1.1.2 Assign HASH partitioning
ALTER TABLE t1 PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER));
ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) */
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
@ -95,51 +95,30 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
# check read row by row success: 1
# 1.1.3 Assign other HASH partitioning to already partitioned table
# + test and switch back + test
ALTER TABLE t1 PARTITION BY HASH(CAST(f_varchar AS SIGNED INTEGER));
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '20 '
Warning 1292 Truncated incorrect INTEGER value: '19 '
Warning 1292 Truncated incorrect INTEGER value: '18 '
Warning 1292 Truncated incorrect INTEGER value: '17 '
Warning 1292 Truncated incorrect INTEGER value: '16 '
Warning 1292 Truncated incorrect INTEGER value: '15 '
Warning 1292 Truncated incorrect INTEGER value: '14 '
Warning 1292 Truncated incorrect INTEGER value: '13 '
Warning 1292 Truncated incorrect INTEGER value: '12 '
Warning 1292 Truncated incorrect INTEGER value: '11 '
Warning 1292 Truncated incorrect INTEGER value: '10 '
Warning 1292 Truncated incorrect INTEGER value: '9 '
Warning 1292 Truncated incorrect INTEGER value: '8 '
Warning 1292 Truncated incorrect INTEGER value: '7 '
Warning 1292 Truncated incorrect INTEGER value: '6 '
Warning 1292 Truncated incorrect INTEGER value: '5 '
Warning 1292 Truncated incorrect INTEGER value: '4 '
Warning 1292 Truncated incorrect INTEGER value: '3 '
Warning 1292 Truncated incorrect INTEGER value: '2 '
Warning 1292 Truncated incorrect INTEGER value: '1 '
ALTER TABLE t1 PARTITION BY HASH(DAYOFYEAR(f_date));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(f_varchar AS SIGNED INTEGER)) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (DAYOFYEAR(f_date)) */
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
ALTER TABLE t1 PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER));
ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) */
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
@ -158,9 +137,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where
@ -177,9 +156,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where
@ -193,9 +172,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB, PARTITION p7 ENGINE = InnoDB) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB, PARTITION p7 ENGINE = InnoDB) */
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 3 Using where
@ -221,9 +200,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB) */
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where
@ -236,9 +215,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB) */
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where
@ -251,9 +230,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB) */
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where
@ -266,9 +245,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where
@ -281,9 +260,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where
@ -296,9 +275,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB) */
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where
@ -311,9 +290,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB) */
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
@ -331,7 +310,7 @@ t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.frm
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where
@ -370,7 +349,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.frm
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where
@ -392,8 +371,8 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
@ -416,8 +395,8 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where
@ -435,8 +414,8 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where
@ -454,8 +433,8 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB, PARTITION p7 ENGINE = InnoDB) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where
@ -480,8 +459,8 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where
@ -498,8 +477,8 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 3 Using where
@ -516,8 +495,8 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 10 Using where
@ -534,8 +513,8 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where
@ -552,8 +531,8 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where
@ -570,8 +549,8 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where
@ -588,8 +567,8 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
@ -610,7 +589,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.frm
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where

View file

@ -64,9 +64,9 @@ t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.MYD
MYSQLTEST_VARDIR/master-data/test/t1.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where
@ -80,17 +80,17 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
ALTER TABLE t1 ADD PARTITION (PARTITION part2);
ERROR HY000: Partition management on a not partitioned table is not possible
# 1.1.2 Assign HASH partitioning
ALTER TABLE t1 PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER));
ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) */
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
@ -99,55 +99,34 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
# check read row by row success: 1
# 1.1.3 Assign other HASH partitioning to already partitioned table
# + test and switch back + test
ALTER TABLE t1 PARTITION BY HASH(CAST(f_varchar AS SIGNED INTEGER));
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '20'
Warning 1292 Truncated incorrect INTEGER value: '19'
Warning 1292 Truncated incorrect INTEGER value: '18'
Warning 1292 Truncated incorrect INTEGER value: '17'
Warning 1292 Truncated incorrect INTEGER value: '16'
Warning 1292 Truncated incorrect INTEGER value: '15'
Warning 1292 Truncated incorrect INTEGER value: '14'
Warning 1292 Truncated incorrect INTEGER value: '13'
Warning 1292 Truncated incorrect INTEGER value: '12'
Warning 1292 Truncated incorrect INTEGER value: '11'
Warning 1292 Truncated incorrect INTEGER value: '10'
Warning 1292 Truncated incorrect INTEGER value: '90'
Warning 1292 Truncated incorrect INTEGER value: '80'
Warning 1292 Truncated incorrect INTEGER value: '70'
Warning 1292 Truncated incorrect INTEGER value: '60'
Warning 1292 Truncated incorrect INTEGER value: '50'
Warning 1292 Truncated incorrect INTEGER value: '40'
Warning 1292 Truncated incorrect INTEGER value: '30'
Warning 1292 Truncated incorrect INTEGER value: '20'
Warning 1292 Truncated incorrect INTEGER value: '10'
ALTER TABLE t1 PARTITION BY HASH(DAYOFYEAR(f_date));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(f_varchar AS SIGNED INTEGER)) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (DAYOFYEAR(f_date)) */
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
ALTER TABLE t1 PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER));
ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) */
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
@ -166,15 +145,15 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where
@ -191,17 +170,17 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where
@ -215,25 +194,25 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM, PARTITION p7 ENGINE = MyISAM) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p7.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p7.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM, PARTITION p7 ENGINE = MyISAM) */
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#p7.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p7.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 3 Using where
@ -259,23 +238,23 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM) */
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where
@ -288,21 +267,21 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM) */
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where
@ -315,19 +294,19 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM) */
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where
@ -340,17 +319,17 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where
@ -363,15 +342,15 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where
@ -384,13 +363,13 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM) */
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where
@ -403,11 +382,11 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM) */
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
@ -425,9 +404,9 @@ t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.MYD
MYSQLTEST_VARDIR/master-data/test/t1.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where
@ -460,9 +439,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.MYD
MYSQLTEST_VARDIR/master-data/test/t1.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where
@ -484,10 +463,10 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
@ -510,14 +489,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where
@ -535,16 +514,16 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where
@ -562,24 +541,24 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM, PARTITION p7 ENGINE = MyISAM) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p7.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p7.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#p7.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p7.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where
@ -604,22 +583,22 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where
@ -636,20 +615,20 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 3 Using where
@ -666,18 +645,18 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 10 Using where
@ -694,16 +673,16 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where
@ -720,14 +699,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where
@ -744,12 +723,12 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where
@ -766,10 +745,10 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM) */
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
@ -790,9 +769,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYD
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYI
/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
MYSQLTEST_VARDIR/master-data/test/t1.MYD
MYSQLTEST_VARDIR/master-data/test/t1.MYI
MYSQLTEST_VARDIR/master-data/test/t1.frm
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -186,7 +186,7 @@ a
1971-01-01 00:00:59
drop table t2;
create table t3 (a timestamp not null, primary key(a)) engine='InnoDB'
partition by range (cast(month(a) as unsigned)) subpartition by key (a)
partition by range (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (4),
partition quarter2 values less than (7),
@ -198,7 +198,7 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */
12 inserts;
insert into t3 values (date_add('1970-01-01 00:00:00',interval 12-1 month));
insert into t3 values (date_add('1970-01-01 00:00:00',interval 11-1 month));
@ -233,7 +233,7 @@ a
1970-12-01 00:00:00
drop table t3;
create table t4 (a timestamp not null, primary key(a)) engine='InnoDB'
partition by list (cast(month(a) as unsigned)) subpartition by key (a)
partition by list (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (0,1,2,3),
partition quarter2 values in (4,5,6),
@ -245,7 +245,7 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (0,1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (0,1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */
12 inserts;
insert into t4 values (date_add('1970-01-01 00:00:00',interval 12-1 month));
insert into t4 values (date_add('1970-01-01 00:00:00',interval 11-1 month));
@ -517,7 +517,7 @@ a
1970-03-28
drop table t2;
create table t3 (a date not null, primary key(a)) engine='InnoDB'
partition by range (cast(month(a) as unsigned)) subpartition by key (a)
partition by range (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (4),
partition quarter2 values less than (7),
@ -529,7 +529,7 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` date NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */
12 inserts;
insert into t3 values (adddate(19700101,interval 12-1 month));
insert into t3 values (adddate(19700101,interval 11-1 month));
@ -562,7 +562,7 @@ a
1970-12-01
drop table t3;
create table t4 (a date not null, primary key(a)) engine='InnoDB'
partition by list (cast(month(a) as unsigned)) subpartition by key (a)
partition by list (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (1,2,3),
partition quarter2 values in (4,5,6),
@ -574,7 +574,7 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` date NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */
12 inserts;
insert into t4 values (adddate(19700101,interval 12-1 month));
insert into t4 values (adddate(19700101,interval 11-1 month));
@ -794,7 +794,7 @@ a
00:01:59
drop table t2;
create table t3 (a time not null, primary key(a)) engine='InnoDB'
partition by range (cast(second(a) as unsigned)) subpartition by key (a)
partition by range (second(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (16),
partition quarter2 values less than (31),
@ -806,7 +806,7 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` time NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(second(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (16) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (31) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (46) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (61) ENGINE = InnoDB) */
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (second(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (16) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (31) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (46) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (61) ENGINE = InnoDB) */
59 inserts;
insert into t3 values (100000+59);
insert into t3 values (100000+58);
@ -933,7 +933,7 @@ a
10:00:59
drop table t3;
create table t4 (a time not null, primary key(a)) engine='InnoDB'
partition by list (cast(second(a) as unsigned)) subpartition by key (a)
partition by list (second(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
partition quarter2 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
@ -945,7 +945,7 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` time NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(second(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (second(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
59 inserts;
insert into t4 values (100000+59);
insert into t4 values (100000+58);
@ -1259,7 +1259,7 @@ a
1970-01-01 00:00:59
drop table t2;
create table t3 (a datetime not null, primary key(a)) engine='InnoDB'
partition by range (cast(month(a) as unsigned)) subpartition by key (a)
partition by range (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (4),
partition quarter2 values less than (7),
@ -1271,7 +1271,7 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` datetime NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */
12 inserts;
insert into t3 values (adddate(19700101000000,interval 12-1 month));
insert into t3 values (adddate(19700101000000,interval 11-1 month));
@ -1304,7 +1304,7 @@ a
1970-12-01 00:00:00
drop table t3;
create table t4 (a datetime not null, primary key(a)) engine='InnoDB'
partition by list (cast(month(a) as unsigned)) subpartition by key (a)
partition by list (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (1,2,3),
partition quarter2 values in (4,5,6),
@ -1316,7 +1316,7 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` datetime NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */
12 inserts;
insert into t4 values (adddate(19700101000000,interval 12-1 month));
insert into t4 values (adddate(19700101000000,interval 11-1 month));

View file

@ -186,7 +186,7 @@ a
1971-01-01 00:00:59
drop table t2;
create table t3 (a timestamp not null, primary key(a)) engine='MyISAM'
partition by range (cast(month(a) as unsigned)) subpartition by key (a)
partition by range (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (4),
partition quarter2 values less than (7),
@ -198,7 +198,7 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */
12 inserts;
insert into t3 values (date_add('1970-01-01 00:00:00',interval 12-1 month));
insert into t3 values (date_add('1970-01-01 00:00:00',interval 11-1 month));
@ -233,7 +233,7 @@ a
1970-12-01 00:00:00
drop table t3;
create table t4 (a timestamp not null, primary key(a)) engine='MyISAM'
partition by list (cast(month(a) as unsigned)) subpartition by key (a)
partition by list (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (0,1,2,3),
partition quarter2 values in (4,5,6),
@ -245,7 +245,7 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (0,1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (0,1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */
12 inserts;
insert into t4 values (date_add('1970-01-01 00:00:00',interval 12-1 month));
insert into t4 values (date_add('1970-01-01 00:00:00',interval 11-1 month));
@ -517,7 +517,7 @@ a
1970-03-28
drop table t2;
create table t3 (a date not null, primary key(a)) engine='MyISAM'
partition by range (cast(month(a) as unsigned)) subpartition by key (a)
partition by range (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (4),
partition quarter2 values less than (7),
@ -529,7 +529,7 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` date NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */
12 inserts;
insert into t3 values (adddate(19700101,interval 12-1 month));
insert into t3 values (adddate(19700101,interval 11-1 month));
@ -562,7 +562,7 @@ a
1970-12-01
drop table t3;
create table t4 (a date not null, primary key(a)) engine='MyISAM'
partition by list (cast(month(a) as unsigned)) subpartition by key (a)
partition by list (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (1,2,3),
partition quarter2 values in (4,5,6),
@ -574,7 +574,7 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` date NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */
12 inserts;
insert into t4 values (adddate(19700101,interval 12-1 month));
insert into t4 values (adddate(19700101,interval 11-1 month));
@ -794,7 +794,7 @@ a
00:01:59
drop table t2;
create table t3 (a time not null, primary key(a)) engine='MyISAM'
partition by range (cast(second(a) as unsigned)) subpartition by key (a)
partition by range (second(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (16),
partition quarter2 values less than (31),
@ -806,7 +806,7 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` time NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(second(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (31) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (46) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (61) ENGINE = MyISAM) */
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (second(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (31) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (46) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (61) ENGINE = MyISAM) */
59 inserts;
insert into t3 values (100000+59);
insert into t3 values (100000+58);
@ -933,7 +933,7 @@ a
10:00:59
drop table t3;
create table t4 (a time not null, primary key(a)) engine='MyISAM'
partition by list (cast(second(a) as unsigned)) subpartition by key (a)
partition by list (second(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
partition quarter2 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
@ -945,7 +945,7 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` time NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(second(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (second(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
59 inserts;
insert into t4 values (100000+59);
insert into t4 values (100000+58);
@ -1259,7 +1259,7 @@ a
1970-01-01 00:00:59
drop table t2;
create table t3 (a datetime not null, primary key(a)) engine='MyISAM'
partition by range (cast(month(a) as unsigned)) subpartition by key (a)
partition by range (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (4),
partition quarter2 values less than (7),
@ -1271,7 +1271,7 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` datetime NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */
12 inserts;
insert into t3 values (adddate(19700101000000,interval 12-1 month));
insert into t3 values (adddate(19700101000000,interval 11-1 month));
@ -1304,7 +1304,7 @@ a
1970-12-01 00:00:00
drop table t3;
create table t4 (a datetime not null, primary key(a)) engine='MyISAM'
partition by list (cast(month(a) as unsigned)) subpartition by key (a)
partition by list (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (1,2,3),
partition quarter2 values in (4,5,6),
@ -1316,7 +1316,7 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` datetime NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */
12 inserts;
insert into t4 values (adddate(19700101000000,interval 12-1 month));
insert into t4 values (adddate(19700101000000,interval 11-1 month));

View file

@ -87,95 +87,3 @@ select count(*) from t2;
count(*)
3072
drop table t2;
create table t3 (a decimal(18,9) not null, primary key(a)) engine='InnoDB'
partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 2 (
partition pa2 values less than (2),
partition pa4 values less than (4),
partition pa6 values less than (6),
partition pa8 values less than (8),
partition pa10 values less than (10)
);
show create table t3;
Table Create Table
t3 CREATE TABLE `t3` (
`a` decimal(18,9) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa2 VALUES LESS THAN (2) ENGINE = InnoDB, PARTITION pa4 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION pa6 VALUES LESS THAN (6) ENGINE = InnoDB, PARTITION pa8 VALUES LESS THAN (8) ENGINE = InnoDB, PARTITION pa10 VALUES LESS THAN (10) ENGINE = InnoDB) */
9*3 inserts;
insert into t3 values (9);
insert into t3 values (9+0.333333333);
insert into t3 values (9+0.755555555);
insert into t3 values (8);
insert into t3 values (8+0.333333333);
insert into t3 values (8+0.755555555);
insert into t3 values (7);
insert into t3 values (7+0.333333333);
insert into t3 values (7+0.755555555);
insert into t3 values (6);
insert into t3 values (6+0.333333333);
insert into t3 values (6+0.755555555);
insert into t3 values (5);
insert into t3 values (5+0.333333333);
insert into t3 values (5+0.755555555);
insert into t3 values (4);
insert into t3 values (4+0.333333333);
insert into t3 values (4+0.755555555);
insert into t3 values (3);
insert into t3 values (3+0.333333333);
insert into t3 values (3+0.755555555);
insert into t3 values (2);
insert into t3 values (2+0.333333333);
insert into t3 values (2+0.755555555);
insert into t3 values (1);
insert into t3 values (1+0.333333333);
insert into t3 values (1+0.755555555);
select count(*) from t3;
count(*)
27
drop table t3;
create table t4 (a decimal(18,9) not null, primary key(a)) engine='InnoDB'
partition by list (cast(floor(a) as signed)) subpartition by key (a) subpartitions 2 (
partition pa2 values in (1,2),
partition pa4 values in (3,4),
partition pa6 values in (5,6),
partition pa8 values in (7,8),
partition pa10 values in (9,10)
);
show create table t4;
Table Create Table
t4 CREATE TABLE `t4` (
`a` decimal(18,9) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa2 VALUES IN (1,2) ENGINE = InnoDB, PARTITION pa4 VALUES IN (3,4) ENGINE = InnoDB, PARTITION pa6 VALUES IN (5,6) ENGINE = InnoDB, PARTITION pa8 VALUES IN (7,8) ENGINE = InnoDB, PARTITION pa10 VALUES IN (9,10) ENGINE = InnoDB) */
9*3 inserts;
insert into t4 values (9);
insert into t4 values (9+0.333333333);
insert into t4 values (9+0.755555555);
insert into t4 values (8);
insert into t4 values (8+0.333333333);
insert into t4 values (8+0.755555555);
insert into t4 values (7);
insert into t4 values (7+0.333333333);
insert into t4 values (7+0.755555555);
insert into t4 values (6);
insert into t4 values (6+0.333333333);
insert into t4 values (6+0.755555555);
insert into t4 values (5);
insert into t4 values (5+0.333333333);
insert into t4 values (5+0.755555555);
insert into t4 values (4);
insert into t4 values (4+0.333333333);
insert into t4 values (4+0.755555555);
insert into t4 values (3);
insert into t4 values (3+0.333333333);
insert into t4 values (3+0.755555555);
insert into t4 values (2);
insert into t4 values (2+0.333333333);
insert into t4 values (2+0.755555555);
insert into t4 values (1);
insert into t4 values (1+0.333333333);
insert into t4 values (1+0.755555555);
select count(*) from t4;
count(*)
27
drop table t4;

View file

@ -87,95 +87,3 @@ select count(*) from t2;
count(*)
196605
drop table t2;
create table t3 (a decimal(18,9) not null, primary key(a)) engine='MYISAM'
partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 2 (
partition pa2 values less than (2),
partition pa4 values less than (4),
partition pa6 values less than (6),
partition pa8 values less than (8),
partition pa10 values less than (10)
);
show create table t3;
Table Create Table
t3 CREATE TABLE `t3` (
`a` decimal(18,9) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa2 VALUES LESS THAN (2) ENGINE = MyISAM, PARTITION pa4 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION pa6 VALUES LESS THAN (6) ENGINE = MyISAM, PARTITION pa8 VALUES LESS THAN (8) ENGINE = MyISAM, PARTITION pa10 VALUES LESS THAN (10) ENGINE = MyISAM) */
9*3 inserts;
insert into t3 values (9);
insert into t3 values (9+0.333333333);
insert into t3 values (9+0.755555555);
insert into t3 values (8);
insert into t3 values (8+0.333333333);
insert into t3 values (8+0.755555555);
insert into t3 values (7);
insert into t3 values (7+0.333333333);
insert into t3 values (7+0.755555555);
insert into t3 values (6);
insert into t3 values (6+0.333333333);
insert into t3 values (6+0.755555555);
insert into t3 values (5);
insert into t3 values (5+0.333333333);
insert into t3 values (5+0.755555555);
insert into t3 values (4);
insert into t3 values (4+0.333333333);
insert into t3 values (4+0.755555555);
insert into t3 values (3);
insert into t3 values (3+0.333333333);
insert into t3 values (3+0.755555555);
insert into t3 values (2);
insert into t3 values (2+0.333333333);
insert into t3 values (2+0.755555555);
insert into t3 values (1);
insert into t3 values (1+0.333333333);
insert into t3 values (1+0.755555555);
select count(*) from t3;
count(*)
27
drop table t3;
create table t4 (a decimal(18,9) not null, primary key(a)) engine='MYISAM'
partition by list (cast(floor(a) as signed)) subpartition by key (a) subpartitions 2 (
partition pa2 values in (1,2),
partition pa4 values in (3,4),
partition pa6 values in (5,6),
partition pa8 values in (7,8),
partition pa10 values in (9,10)
);
show create table t4;
Table Create Table
t4 CREATE TABLE `t4` (
`a` decimal(18,9) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa2 VALUES IN (1,2) ENGINE = MyISAM, PARTITION pa4 VALUES IN (3,4) ENGINE = MyISAM, PARTITION pa6 VALUES IN (5,6) ENGINE = MyISAM, PARTITION pa8 VALUES IN (7,8) ENGINE = MyISAM, PARTITION pa10 VALUES IN (9,10) ENGINE = MyISAM) */
9*3 inserts;
insert into t4 values (9);
insert into t4 values (9+0.333333333);
insert into t4 values (9+0.755555555);
insert into t4 values (8);
insert into t4 values (8+0.333333333);
insert into t4 values (8+0.755555555);
insert into t4 values (7);
insert into t4 values (7+0.333333333);
insert into t4 values (7+0.755555555);
insert into t4 values (6);
insert into t4 values (6+0.333333333);
insert into t4 values (6+0.755555555);
insert into t4 values (5);
insert into t4 values (5+0.333333333);
insert into t4 values (5+0.755555555);
insert into t4 values (4);
insert into t4 values (4+0.333333333);
insert into t4 values (4+0.755555555);
insert into t4 values (3);
insert into t4 values (3+0.333333333);
insert into t4 values (3+0.755555555);
insert into t4 values (2);
insert into t4 values (2+0.333333333);
insert into t4 values (2+0.755555555);
insert into t4 values (1);
insert into t4 values (1+0.333333333);
insert into t4 values (1+0.755555555);
select count(*) from t4;
count(*)
27
drop table t4;

View file

@ -89,152 +89,6 @@ select count(*) from t2;
count(*)
49152
drop table t2;
create table t3 (a float not null, primary key(a)) engine='MYISAM'
partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 (
partition pa1 values less than (3),
partition pa3 values less than (6),
partition pa10 values less than (10)
);
show create table t3;
Table Create Table
t3 CREATE TABLE `t3` (
`a` float NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION pa1 VALUES LESS THAN (3) ENGINE = MyISAM, PARTITION pa3 VALUES LESS THAN (6) ENGINE = MyISAM, PARTITION pa10 VALUES LESS THAN (10) ENGINE = MyISAM) */
9*3 inserts;
insert into t3 values (9);
insert into t3 values (9+0.33);
insert into t3 values (9+0.75);
insert into t3 values (8);
insert into t3 values (8+0.33);
insert into t3 values (8+0.75);
insert into t3 values (7);
insert into t3 values (7+0.33);
insert into t3 values (7+0.75);
insert into t3 values (6);
insert into t3 values (6+0.33);
insert into t3 values (6+0.75);
insert into t3 values (5);
insert into t3 values (5+0.33);
insert into t3 values (5+0.75);
insert into t3 values (4);
insert into t3 values (4+0.33);
insert into t3 values (4+0.75);
insert into t3 values (3);
insert into t3 values (3+0.33);
insert into t3 values (3+0.75);
insert into t3 values (2);
insert into t3 values (2+0.33);
insert into t3 values (2+0.75);
insert into t3 values (1);
insert into t3 values (1+0.33);
insert into t3 values (1+0.75);
select count(*) from t3;
count(*)
27
select * from t3;
a
1
1.33
1.75
2
2.33
2.75
3
3.33
3.75
4
4.33
4.75
5
5.33
5.75
6
6.33
6.75
7
7.33
7.75
8
8.33
8.75
9
9.33
9.75
drop table t3;
create table t4 (a float not null, primary key(a)) engine='MYISAM'
partition by list (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 (
partition pa1 values in (1,2,3),
partition pa3 values in (4,5,6),
partition pa10 values in (7,8,9,10)
);
show create table t4;
Table Create Table
t4 CREATE TABLE `t4` (
`a` float NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION pa1 VALUES IN (1,2,3) ENGINE = MyISAM, PARTITION pa3 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION pa10 VALUES IN (7,8,9,10) ENGINE = MyISAM) */
9*3 inserts;
insert into t4 values (9);
insert into t4 values (9+0.33);
insert into t4 values (9+0.75);
insert into t4 values (8);
insert into t4 values (8+0.33);
insert into t4 values (8+0.75);
insert into t4 values (7);
insert into t4 values (7+0.33);
insert into t4 values (7+0.75);
insert into t4 values (6);
insert into t4 values (6+0.33);
insert into t4 values (6+0.75);
insert into t4 values (5);
insert into t4 values (5+0.33);
insert into t4 values (5+0.75);
insert into t4 values (4);
insert into t4 values (4+0.33);
insert into t4 values (4+0.75);
insert into t4 values (3);
insert into t4 values (3+0.33);
insert into t4 values (3+0.75);
insert into t4 values (2);
insert into t4 values (2+0.33);
insert into t4 values (2+0.75);
insert into t4 values (1);
insert into t4 values (1+0.33);
insert into t4 values (1+0.75);
select count(*) from t4;
count(*)
27
select * from t4;
a
1
1.33
1.75
2
2.33
2.75
3
3.33
3.75
4
4.33
4.75
5
5.33
5.75
6
6.33
6.75
7
7.33
7.75
8
8.33
8.75
9
9.33
9.75
drop table t4;
create table t1 (a double not null, primary key(a)) engine='MYISAM'
partition by key (a) (
partition pa1 DATA DIRECTORY =
@ -318,149 +172,3 @@ select count(*) from t2;
count(*)
49152
drop table t2;
create table t3 (a double not null, primary key(a)) engine='MYISAM'
partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 (
partition pa1 values less than (3),
partition pa3 values less than (6),
partition pa10 values less than (10)
);
show create table t3;
Table Create Table
t3 CREATE TABLE `t3` (
`a` double NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION pa1 VALUES LESS THAN (3) ENGINE = MyISAM, PARTITION pa3 VALUES LESS THAN (6) ENGINE = MyISAM, PARTITION pa10 VALUES LESS THAN (10) ENGINE = MyISAM) */
9*3 inserts;
insert into t3 values (9);
insert into t3 values (9+0.33);
insert into t3 values (9+0.75);
insert into t3 values (8);
insert into t3 values (8+0.33);
insert into t3 values (8+0.75);
insert into t3 values (7);
insert into t3 values (7+0.33);
insert into t3 values (7+0.75);
insert into t3 values (6);
insert into t3 values (6+0.33);
insert into t3 values (6+0.75);
insert into t3 values (5);
insert into t3 values (5+0.33);
insert into t3 values (5+0.75);
insert into t3 values (4);
insert into t3 values (4+0.33);
insert into t3 values (4+0.75);
insert into t3 values (3);
insert into t3 values (3+0.33);
insert into t3 values (3+0.75);
insert into t3 values (2);
insert into t3 values (2+0.33);
insert into t3 values (2+0.75);
insert into t3 values (1);
insert into t3 values (1+0.33);
insert into t3 values (1+0.75);
select count(*) from t3;
count(*)
27
select * from t3;
a
1
1.33
1.75
2
2.33
2.75
3
3.33
3.75
4
4.33
4.75
5
5.33
5.75
6
6.33
6.75
7
7.33
7.75
8
8.33
8.75
9
9.33
9.75
drop table t3;
create table t4 (a double not null, primary key(a)) engine='MYISAM'
partition by list (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 (
partition pa1 values in (1,2,3),
partition pa3 values in (4,5,6),
partition pa10 values in (7,8,9,10)
);
show create table t4;
Table Create Table
t4 CREATE TABLE `t4` (
`a` double NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION pa1 VALUES IN (1,2,3) ENGINE = MyISAM, PARTITION pa3 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION pa10 VALUES IN (7,8,9,10) ENGINE = MyISAM) */
9*3 inserts;
insert into t4 values (9);
insert into t4 values (9+0.33);
insert into t4 values (9+0.75);
insert into t4 values (8);
insert into t4 values (8+0.33);
insert into t4 values (8+0.75);
insert into t4 values (7);
insert into t4 values (7+0.33);
insert into t4 values (7+0.75);
insert into t4 values (6);
insert into t4 values (6+0.33);
insert into t4 values (6+0.75);
insert into t4 values (5);
insert into t4 values (5+0.33);
insert into t4 values (5+0.75);
insert into t4 values (4);
insert into t4 values (4+0.33);
insert into t4 values (4+0.75);
insert into t4 values (3);
insert into t4 values (3+0.33);
insert into t4 values (3+0.75);
insert into t4 values (2);
insert into t4 values (2+0.33);
insert into t4 values (2+0.75);
insert into t4 values (1);
insert into t4 values (1+0.33);
insert into t4 values (1+0.75);
select count(*) from t4;
count(*)
27
select * from t4;
a
1
1.33
1.75
2
2.33
2.75
3
3.33
3.75
4
4.33
4.75
5
5.33
5.75
6
6.33
6.75
7
7.33
7.75
8
8.33
8.75
9
9.33
9.75
drop table t4;

View file

@ -620,7 +620,7 @@ PARTITION BY RANGE(f_int1)
PARTITION part2 VALUES LESS THAN (1000));
ERROR 42000: Not allowed to use NULL value in VALUES LESS THAN near '),
PARTITION part2 VALUES LESS THAN (1000))' at line 9
# 3.5.1.2 VALUE LESS THAN (CAST(NULL AS SIGNED INTEGER)) is not allowed
# 3.5.1.2 VALUE LESS THAN (NULL) is not allowed
CREATE TABLE t1 (
f_int1 INTEGER,
f_int2 INTEGER,
@ -629,7 +629,7 @@ f_char2 CHAR(20),
f_charbig VARCHAR(1000)
)
PARTITION BY RANGE(f_int1)
( PARTITION part1 VALUES LESS THAN (CAST(NULL AS SIGNED INTEGER)),
( PARTITION part1 VALUES LESS THAN (NULL),
PARTITION part2 VALUES LESS THAN (1000));
ERROR 42000: Not allowed to use NULL value in VALUES LESS THAN near '),
PARTITION part2 VALUES LESS THAN (1000))' at line 9
@ -647,7 +647,7 @@ PARTITION BY LIST(MOD(f_int1,2))
PARTITION part2 VALUES IN (0),
PARTITION part3 VALUES IN (1));
DROP TABLE t1;
# 3.5.2.2 VALUE IN (CAST(NULL AS SIGNED INTEGER))
# 3.5.2.2 VALUE IN (NULL)
CREATE TABLE t1 (
f_int1 INTEGER,
f_int2 INTEGER,
@ -656,7 +656,7 @@ f_char2 CHAR(20),
f_charbig VARCHAR(1000)
)
PARTITION BY LIST(MOD(f_int1,2))
( PARTITION part1 VALUES IN (CAST(NULL AS SIGNED INTEGER)),
( PARTITION part1 VALUES IN (NULL),
PARTITION part3 VALUES IN (1));
create_command
SHOW CREATE TABLE t1;
@ -679,7 +679,7 @@ f_char2 CHAR(20),
f_charbig VARCHAR(1000)
)
PARTITION BY LIST(MOD(f_int1,2))
( PARTITION part1 VALUES IN (CAST(NULL AS SIGNED INTEGER)),
( PARTITION part1 VALUES IN (NULL),
PARTITION part2 VALUES IN (0),
PARTITION part3 VALUES IN (1));
create_command

View file

@ -620,7 +620,7 @@ PARTITION BY RANGE(f_int1)
PARTITION part2 VALUES LESS THAN (1000));
ERROR 42000: Not allowed to use NULL value in VALUES LESS THAN near '),
PARTITION part2 VALUES LESS THAN (1000))' at line 9
# 3.5.1.2 VALUE LESS THAN (CAST(NULL AS SIGNED INTEGER)) is not allowed
# 3.5.1.2 VALUE LESS THAN (NULL) is not allowed
CREATE TABLE t1 (
f_int1 INTEGER,
f_int2 INTEGER,
@ -629,7 +629,7 @@ f_char2 CHAR(20),
f_charbig VARCHAR(1000)
)
PARTITION BY RANGE(f_int1)
( PARTITION part1 VALUES LESS THAN (CAST(NULL AS SIGNED INTEGER)),
( PARTITION part1 VALUES LESS THAN (NULL),
PARTITION part2 VALUES LESS THAN (1000));
ERROR 42000: Not allowed to use NULL value in VALUES LESS THAN near '),
PARTITION part2 VALUES LESS THAN (1000))' at line 9
@ -647,7 +647,7 @@ PARTITION BY LIST(MOD(f_int1,2))
PARTITION part2 VALUES IN (0),
PARTITION part3 VALUES IN (1));
DROP TABLE t1;
# 3.5.2.2 VALUE IN (CAST(NULL AS SIGNED INTEGER))
# 3.5.2.2 VALUE IN (NULL)
CREATE TABLE t1 (
f_int1 INTEGER,
f_int2 INTEGER,
@ -656,7 +656,7 @@ f_char2 CHAR(20),
f_charbig VARCHAR(1000)
)
PARTITION BY LIST(MOD(f_int1,2))
( PARTITION part1 VALUES IN (CAST(NULL AS SIGNED INTEGER)),
( PARTITION part1 VALUES IN (NULL),
PARTITION part3 VALUES IN (1));
create_command
SHOW CREATE TABLE t1;
@ -687,7 +687,7 @@ f_char2 CHAR(20),
f_charbig VARCHAR(1000)
)
PARTITION BY LIST(MOD(f_int1,2))
( PARTITION part1 VALUES IN (CAST(NULL AS SIGNED INTEGER)),
( PARTITION part1 VALUES IN (NULL),
PARTITION part2 VALUES IN (0),
PARTITION part3 VALUES IN (1));
create_command

View file

@ -6,6 +6,8 @@ ndb_partition_range : cannot create t1
partition_bit_ndb : cannot create t1
partition_int_ndb : cannot create t1
partition_syntax_ndb : cannot create t1
partition_value_myisam : Bug#30581 partition_value tests use disallowed CAST() function
partition_value_innodb : Bug#30581 partition_value tests use disallowed CAST() function
partition_value_ndb : cannot create t1
partition_basic_ndb : cannot create t1
partition_alter1_ndb : timeout. Needs too much time.
@ -13,3 +15,6 @@ partition_alter2_ndb : cannot create t1
partition_char_innodb : crash. Bug? More investigations
partition_sessions : needs system_3_init.inc
partition_engine_ndb : cannot create t1
part_supported_sql_func_ndb : cannot create t1
rpl_ndb_dd_partitions : cannot create t1
partition_float_innodb : Bug#30583 Partition on DOUBLE key + INNODB + count(*) == crash

View file

@ -36,6 +36,7 @@ let $debug= 0;
##### Storage engine to be tested
let $engine= 'InnoDB';
--source include/have_innodb.inc
##### max rows to be inserted
let $maxrows=65535;

View file

@ -36,6 +36,7 @@ let $debug= 0;
##### Storage engine to be tested
let $engine= 'InnoDB';
--source include/have_innodb.inc
##### max rows to be inserted
let $maxrows=1024;

View file

@ -36,6 +36,8 @@ let $debug= 0;
##### Storage engine to be tested
let $engine= 'InnoDB';
--source include/have_innodb.inc
##### number of rows to be inserted
let $maxrows=1024;

View file

@ -36,6 +36,8 @@ let $debug= 0;
##### Storage engine to be tested
let $engine= 'InnoDB';
--source include/have_innodb.inc
##### Number of row to be inserted.
let $maxrows=1024;

View file

@ -36,6 +36,7 @@ let $debug= 0;
##### Storage engine to be tested
let $engine= 'InnoDB';
--source include/have_innodb.inc
##### max rows to be inserted
let $maxrows=1024;

View file

@ -36,6 +36,7 @@ let $debug= 0;
##### Storage engine to be tested
let $engine= 'InnoDB';
--source include/have_innodb.inc
#------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines

View file

@ -1,3 +1,4 @@
--source include/have_partition.inc
--source include/have_innodb.inc
--source include/master-slave.inc

View file

@ -5458,6 +5458,7 @@ void ha_partition::get_auto_increment(ulonglong offset, ulonglong increment,
for (pos=m_file, end= m_file+ m_tot_parts; pos != end ; pos++)
{
first_value_part= *first_value;
(*pos)->get_auto_increment(offset, increment, nb_desired_values,
&first_value_part, &nb_reserved_values_part);
if (first_value_part == ~(ulonglong)(0)) // error in one partition

View file

@ -211,6 +211,7 @@ dict_boot(void)
dict_table_t* table;
dict_index_t* index;
dict_hdr_t* dict_hdr;
mem_heap_t* heap;
mtr_t mtr;
mtr_start(&mtr);
@ -218,6 +219,8 @@ dict_boot(void)
/* Create the hash tables etc. */
dict_init();
heap = mem_heap_create(450);
mutex_enter(&(dict_sys->mutex));
/* Get the dictionary header */
@ -244,19 +247,20 @@ dict_boot(void)
/*-------------------------*/
table = dict_mem_table_create("SYS_TABLES", DICT_HDR_SPACE, 8, 0);
dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, "ID", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, "N_COLS", DATA_INT, 0, 4);
dict_mem_table_add_col(table, "TYPE", DATA_INT, 0, 4);
dict_mem_table_add_col(table, "MIX_ID", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, "MIX_LEN", DATA_INT, 0, 4);
dict_mem_table_add_col(table, "CLUSTER_NAME", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, "SPACE", DATA_INT, 0, 4);
dict_mem_table_add_col(table, heap, "NAME", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, heap, "ID", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, heap, "N_COLS", DATA_INT, 0, 4);
dict_mem_table_add_col(table, heap, "TYPE", DATA_INT, 0, 4);
dict_mem_table_add_col(table, heap, "MIX_ID", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, heap, "MIX_LEN", DATA_INT, 0, 4);
dict_mem_table_add_col(table, heap, "CLUSTER_NAME", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, heap, "SPACE", DATA_INT, 0, 4);
table->id = DICT_TABLES_ID;
dict_table_add_to_cache(table);
dict_table_add_to_cache(table, heap);
dict_sys->sys_tables = table;
mem_heap_empty(heap);
index = dict_mem_index_create("SYS_TABLES", "CLUST_IND",
DICT_HDR_SPACE,
@ -283,18 +287,19 @@ dict_boot(void)
/*-------------------------*/
table = dict_mem_table_create("SYS_COLUMNS", DICT_HDR_SPACE, 7, 0);
dict_mem_table_add_col(table, "TABLE_ID", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, "POS", DATA_INT, 0, 4);
dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, "MTYPE", DATA_INT, 0, 4);
dict_mem_table_add_col(table, "PRTYPE", DATA_INT, 0, 4);
dict_mem_table_add_col(table, "LEN", DATA_INT, 0, 4);
dict_mem_table_add_col(table, "PREC", DATA_INT, 0, 4);
dict_mem_table_add_col(table, heap, "TABLE_ID", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, heap, "POS", DATA_INT, 0, 4);
dict_mem_table_add_col(table, heap, "NAME", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, heap, "MTYPE", DATA_INT, 0, 4);
dict_mem_table_add_col(table, heap, "PRTYPE", DATA_INT, 0, 4);
dict_mem_table_add_col(table, heap, "LEN", DATA_INT, 0, 4);
dict_mem_table_add_col(table, heap, "PREC", DATA_INT, 0, 4);
table->id = DICT_COLUMNS_ID;
dict_table_add_to_cache(table);
dict_table_add_to_cache(table, heap);
dict_sys->sys_columns = table;
mem_heap_empty(heap);
index = dict_mem_index_create("SYS_COLUMNS", "CLUST_IND",
DICT_HDR_SPACE,
@ -311,13 +316,13 @@ dict_boot(void)
/*-------------------------*/
table = dict_mem_table_create("SYS_INDEXES", DICT_HDR_SPACE, 7, 0);
dict_mem_table_add_col(table, "TABLE_ID", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, "ID", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, "N_FIELDS", DATA_INT, 0, 4);
dict_mem_table_add_col(table, "TYPE", DATA_INT, 0, 4);
dict_mem_table_add_col(table, "SPACE", DATA_INT, 0, 4);
dict_mem_table_add_col(table, "PAGE_NO", DATA_INT, 0, 4);
dict_mem_table_add_col(table, heap, "TABLE_ID", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, heap, "ID", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, heap, "NAME", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, heap, "N_FIELDS", DATA_INT, 0, 4);
dict_mem_table_add_col(table, heap, "TYPE", DATA_INT, 0, 4);
dict_mem_table_add_col(table, heap, "SPACE", DATA_INT, 0, 4);
dict_mem_table_add_col(table, heap, "PAGE_NO", DATA_INT, 0, 4);
/* The '+ 2' below comes from the 2 system fields */
#if DICT_SYS_INDEXES_PAGE_NO_FIELD != 6 + 2
@ -331,8 +336,9 @@ dict_boot(void)
#endif
table->id = DICT_INDEXES_ID;
dict_table_add_to_cache(table);
dict_table_add_to_cache(table, heap);
dict_sys->sys_indexes = table;
mem_heap_empty(heap);
index = dict_mem_index_create("SYS_INDEXES", "CLUST_IND",
DICT_HDR_SPACE,
@ -349,13 +355,14 @@ dict_boot(void)
/*-------------------------*/
table = dict_mem_table_create("SYS_FIELDS", DICT_HDR_SPACE, 3, 0);
dict_mem_table_add_col(table, "INDEX_ID", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, "POS", DATA_INT, 0, 4);
dict_mem_table_add_col(table, "COL_NAME", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, heap, "INDEX_ID", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, heap, "POS", DATA_INT, 0, 4);
dict_mem_table_add_col(table, heap, "COL_NAME", DATA_BINARY, 0, 0);
table->id = DICT_FIELDS_ID;
dict_table_add_to_cache(table);
dict_table_add_to_cache(table, heap);
dict_sys->sys_fields = table;
mem_heap_free(heap);
index = dict_mem_index_create("SYS_FIELDS", "CLUST_IND",
DICT_HDR_SPACE,

View file

@ -960,7 +960,7 @@ dict_create_table_step(
if (node->state == TABLE_ADD_TO_CACHE) {
dict_table_add_to_cache(node->table);
dict_table_add_to_cache(node->table, node->heap);
err = DB_SUCCESS;
}

View file

@ -410,14 +410,27 @@ dict_table_get_col_name(
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
s = table->col_names;
for (i = 0; i < col_nr; i++) {
s += strlen(s) + 1;
if (s) {
for (i = 0; i < col_nr; i++) {
s += strlen(s) + 1;
}
}
return(s);
}
/************************************************************************
Acquire the autoinc lock.*/
void
dict_table_autoinc_lock(
/*====================*/
dict_table_t* table)
{
mutex_enter(&table->autoinc_mutex);
}
/************************************************************************
Initializes the autoinc counter. It is not an error to initialize an already
initialized counter. */
@ -428,54 +441,8 @@ dict_table_autoinc_initialize(
dict_table_t* table, /* in: table */
ib_longlong value) /* in: next value to assign to a row */
{
mutex_enter(&(table->autoinc_mutex));
table->autoinc_inited = TRUE;
table->autoinc = value;
mutex_exit(&(table->autoinc_mutex));
}
/************************************************************************
Gets the next autoinc value (== autoinc counter value), 0 if not yet
initialized. If initialized, increments the counter by 1. */
ib_longlong
dict_table_autoinc_get(
/*===================*/
/* out: value for a new row, or 0 */
dict_table_t* table) /* in: table */
{
ib_longlong value;
mutex_enter(&(table->autoinc_mutex));
if (!table->autoinc_inited) {
value = 0;
} else {
value = table->autoinc;
table->autoinc = table->autoinc + 1;
}
mutex_exit(&(table->autoinc_mutex));
return(value);
}
/************************************************************************
Decrements the autoinc counter value by 1. */
void
dict_table_autoinc_decrement(
/*=========================*/
dict_table_t* table) /* in: table */
{
mutex_enter(&(table->autoinc_mutex));
table->autoinc = table->autoinc - 1;
mutex_exit(&(table->autoinc_mutex));
}
/************************************************************************
@ -490,32 +457,6 @@ dict_table_autoinc_read(
{
ib_longlong value;
mutex_enter(&(table->autoinc_mutex));
if (!table->autoinc_inited) {
value = 0;
} else {
value = table->autoinc;
}
mutex_exit(&(table->autoinc_mutex));
return(value);
}
/************************************************************************
Peeks the autoinc counter value, 0 if not yet initialized. Does not
increment the counter. The read not protected by any mutex! */
ib_longlong
dict_table_autoinc_peek(
/*====================*/
/* out: value of the counter */
dict_table_t* table) /* in: table */
{
ib_longlong value;
if (!table->autoinc_inited) {
value = 0;
@ -527,7 +468,7 @@ dict_table_autoinc_peek(
}
/************************************************************************
Updates the autoinc counter if the value supplied is equal or bigger than the
Updates the autoinc counter if the value supplied is greater than the
current value. If not inited, does nothing. */
void
@ -537,15 +478,21 @@ dict_table_autoinc_update(
dict_table_t* table, /* in: table */
ib_longlong value) /* in: value which was assigned to a row */
{
mutex_enter(&(table->autoinc_mutex));
if (table->autoinc_inited && value > table->autoinc) {
if (table->autoinc_inited) {
if (value >= table->autoinc) {
table->autoinc = value + 1;
}
table->autoinc = value;
}
}
mutex_exit(&(table->autoinc_mutex));
/************************************************************************
Release the autoinc lock.*/
void
dict_table_autoinc_unlock(
/*======================*/
dict_table_t* table) /* in: release autoinc lock for this table */
{
mutex_exit(&table->autoinc_mutex);
}
/************************************************************************
@ -842,28 +789,18 @@ dict_table_get(
}
/**************************************************************************
Adds a table object to the dictionary cache. */
Adds system columns to a table object. */
void
dict_table_add_to_cache(
/*====================*/
dict_table_t* table) /* in: table */
dict_table_add_system_columns(
/*==========================*/
dict_table_t* table, /* in/out: table */
mem_heap_t* heap) /* in: temporary heap */
{
ulint fold;
ulint id_fold;
ulint i;
ulint row_len;
ut_ad(table);
ut_ad(mutex_own(&(dict_sys->mutex)));
ut_ad(table->n_def == table->n_cols - DATA_N_SYS_COLS);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
ut_ad(table->cached == FALSE);
fold = ut_fold_string(table->name);
id_fold = ut_fold_dulint(table->id);
table->cached = TRUE;
ut_ad(!table->cached);
/* NOTE: the system columns MUST be added in the following order
(so that they can be indexed by the numerical value of DATA_ROW_ID,
@ -871,19 +808,19 @@ dict_table_add_to_cache(
The clustered index will not always physically contain all
system columns. */
dict_mem_table_add_col(table, "DB_ROW_ID", DATA_SYS,
dict_mem_table_add_col(table, heap, "DB_ROW_ID", DATA_SYS,
DATA_ROW_ID | DATA_NOT_NULL,
DATA_ROW_ID_LEN);
#if DATA_ROW_ID != 0
#error "DATA_ROW_ID != 0"
#endif
dict_mem_table_add_col(table, "DB_TRX_ID", DATA_SYS,
dict_mem_table_add_col(table, heap, "DB_TRX_ID", DATA_SYS,
DATA_TRX_ID | DATA_NOT_NULL,
DATA_TRX_ID_LEN);
#if DATA_TRX_ID != 1
#error "DATA_TRX_ID != 1"
#endif
dict_mem_table_add_col(table, "DB_ROLL_PTR", DATA_SYS,
dict_mem_table_add_col(table, heap, "DB_ROLL_PTR", DATA_SYS,
DATA_ROLL_PTR | DATA_NOT_NULL,
DATA_ROLL_PTR_LEN);
#if DATA_ROLL_PTR != 2
@ -895,10 +832,34 @@ dict_table_add_to_cache(
#if DATA_N_SYS_COLS != 3
#error "DATA_N_SYS_COLS != 3"
#endif
}
/**************************************************************************
Adds a table object to the dictionary cache. */
void
dict_table_add_to_cache(
/*====================*/
dict_table_t* table, /* in: table */
mem_heap_t* heap) /* in: temporary heap */
{
ulint fold;
ulint id_fold;
ulint i;
ulint row_len;
/* The lower limit for what we consider a "big" row */
#define BIG_ROW_SIZE 1024
ut_ad(mutex_own(&(dict_sys->mutex)));
dict_table_add_system_columns(table, heap);
table->cached = TRUE;
fold = ut_fold_string(table->name);
id_fold = ut_fold_dulint(table->id);
row_len = 0;
for (i = 0; i < table->n_def; i++) {
ulint col_len = dict_col_get_max_size(

View file

@ -423,7 +423,8 @@ dict_load_columns(
ut_a(name_of_col_is(sys_columns, sys_index, 8, "PREC"));
dict_mem_table_add_col(table, name, mtype, prtype, col_len);
dict_mem_table_add_col(table, heap, name,
mtype, prtype, col_len);
btr_pcur_move_to_next_user_rec(&pcur, &mtr);
}
@ -746,7 +747,7 @@ dict_load_table(
ut_ad(mutex_own(&(dict_sys->mutex)));
heap = mem_heap_create(1000);
heap = mem_heap_create(32000);
mtr_start(&mtr);
@ -852,7 +853,9 @@ err_exit:
dict_load_columns(table, heap);
dict_table_add_to_cache(table);
dict_table_add_to_cache(table, heap);
mem_heap_empty(heap);
dict_load_indexes(table, heap);

View file

@ -90,6 +90,15 @@ dict_mem_table_create(
mutex_create(&table->autoinc_mutex, SYNC_DICT_AUTOINC_MUTEX);
table->autoinc_inited = FALSE;
/* The actual increment value will be set by MySQL, we simply
default to 1 here.*/
table->autoinc_increment = 1;
/* The number of transactions that are either waiting on the
AUTOINC lock or have been granted the lock. */
table->n_waiting_or_granted_auto_inc_locks = 0;
#ifdef UNIV_DEBUG
table->magic_n = DICT_TABLE_MAGIC_N;
#endif /* UNIV_DEBUG */
@ -108,18 +117,11 @@ dict_mem_table_free(
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
mutex_free(&(table->autoinc_mutex));
if (table->col_names && (table->n_def < table->n_cols)) {
ut_free((void*)table->col_names);
}
mem_heap_free(table->heap);
}
/********************************************************************
Add 'name' to end of the col_names array (see dict_table_t::col_names). Call
ut_free on col_names (if not NULL), allocate new array (if heap, from it,
otherwise with ut_malloc), and copy col_names + name to it. */
Append 'name' to 'col_names' (@see dict_table_t::col_names). */
static
const char*
dict_add_col_name(
@ -129,21 +131,19 @@ dict_add_col_name(
NULL */
ulint cols, /* in: number of existing columns */
const char* name, /* in: new column name */
mem_heap_t* heap) /* in: heap, or NULL */
mem_heap_t* heap) /* in: heap */
{
ulint i;
ulint old_len;
ulint new_len;
ulint total_len;
const char* s;
char* res;
ulint old_len;
ulint new_len;
ulint total_len;
char* res;
ut_a(((cols == 0) && !col_names) || ((cols > 0) && col_names));
ut_a(*name);
ut_ad(!cols == !col_names);
/* Find out length of existing array. */
if (col_names) {
s = col_names;
const char* s = col_names;
ulint i;
for (i = 0; i < cols; i++) {
s += strlen(s) + 1;
@ -157,11 +157,7 @@ dict_add_col_name(
new_len = strlen(name) + 1;
total_len = old_len + new_len;
if (heap) {
res = mem_heap_alloc(heap, total_len);
} else {
res = ut_malloc(total_len);
}
res = mem_heap_alloc(heap, total_len);
if (old_len > 0) {
memcpy(res, col_names, old_len);
@ -169,10 +165,6 @@ dict_add_col_name(
memcpy(res + old_len, name, new_len);
if (col_names) {
ut_free((char*)col_names);
}
return(res);
}
@ -183,7 +175,8 @@ void
dict_mem_table_add_col(
/*===================*/
dict_table_t* table, /* in: table */
const char* name, /* in: column name */
mem_heap_t* heap, /* in: temporary memory heap, or NULL */
const char* name, /* in: column name, or NULL */
ulint mtype, /* in: main datatype */
ulint prtype, /* in: precise type */
ulint len) /* in: precision */
@ -191,21 +184,32 @@ dict_mem_table_add_col(
dict_col_t* col;
ulint mbminlen;
ulint mbmaxlen;
mem_heap_t* heap;
ulint i;
ut_ad(table && name);
ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
ut_ad(!heap == !name);
table->n_def++;
i = table->n_def++;
heap = table->n_def < table->n_cols ? NULL : table->heap;
table->col_names = dict_add_col_name(table->col_names,
table->n_def - 1,
name, heap);
if (name) {
if (UNIV_UNLIKELY(table->n_def == table->n_cols)) {
heap = table->heap;
}
if (UNIV_LIKELY(i) && UNIV_UNLIKELY(!table->col_names)) {
/* All preceding column names are empty. */
char* s = mem_heap_alloc(heap, table->n_def);
memset(s, 0, table->n_def);
table->col_names = s;
}
col = (dict_col_t*) dict_table_get_nth_col(table, table->n_def - 1);
table->col_names = dict_add_col_name(table->col_names,
i, name, heap);
}
col->ind = table->n_def - 1;
col = (dict_col_t*) dict_table_get_nth_col(table, i);
col->ind = i;
col->ord_part = 0;
col->mtype = (unsigned int) mtype;
@ -318,7 +322,7 @@ dict_mem_index_add_field(
{
dict_field_t* field;
ut_ad(index && name);
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
index->n_def++;

File diff suppressed because it is too large Load diff

View file

@ -32,7 +32,10 @@ typedef struct st_innobase_share {
} INNOBASE_SHARE;
struct dict_index_struct;
struct row_prebuilt_struct;
typedef struct dict_index_struct dict_index_t;
typedef struct row_prebuilt_struct row_prebuilt_t;
/* The class defining a handle to an Innodb table */
@ -70,6 +73,11 @@ class ha_innobase: public handler
int change_active_index(uint keynr);
int general_fetch(uchar* buf, uint direction, uint match_mode);
int innobase_read_and_init_auto_inc(longlong* ret);
ulong innobase_autoinc_lock();
ulong innobase_set_max_autoinc(ulonglong auto_inc);
ulong innobase_reset_autoinc(ulonglong auto_inc);
ulong innobase_get_auto_increment(ulonglong* value);
dict_index_t* innobase_get_index(uint keynr);
/* Init values for the class: */
public:

View file

@ -462,7 +462,8 @@ ibuf_data_init_for_space(
page_t* root;
page_t* header_page;
mtr_t mtr;
char buf[50];
char* buf;
mem_heap_t* heap;
dict_table_t* table;
dict_index_t* index;
ulint n_used;
@ -516,16 +517,20 @@ ibuf_data_init_for_space(
ibuf_exit();
heap = mem_heap_create(450);
buf = mem_heap_alloc(heap, 50);
sprintf(buf, "SYS_IBUF_TABLE_%lu", (ulong) space);
/* use old-style record format for the insert buffer */
table = dict_mem_table_create(buf, space, 2, 0);
dict_mem_table_add_col(table, "PAGE_NO", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, "TYPES", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, heap, "PAGE_NO", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, heap, "TYPES", DATA_BINARY, 0, 0);
table->id = ut_dulint_add(DICT_IBUF_ID_MIN, space);
dict_table_add_to_cache(table);
dict_table_add_to_cache(table, heap);
mem_heap_free(heap);
index = dict_mem_index_create(
buf, "CLUST_IND", space,
@ -1139,7 +1144,7 @@ ibuf_dummy_index_add_col(
ulint len) /* in: length of the column */
{
ulint i = index->table->n_def;
dict_mem_table_add_col(index->table, "DUMMY",
dict_mem_table_add_col(index->table, NULL, NULL,
dtype_get_mtype(type),
dtype_get_prtype(type),
dtype_get_len(type));
@ -1161,11 +1166,6 @@ ibuf_dummy_index_free(
dict_mem_table_free(table);
}
void
dict_index_print_low(
/*=================*/
dict_index_t* index); /* in: index */
/*************************************************************************
Builds the entry to insert into a non-clustered index when we have the
corresponding record in an ibuf index. */

View file

@ -171,6 +171,13 @@ dict_col_name_is_reserved(
/* out: TRUE if name is reserved */
const char* name); /* in: column name */
/************************************************************************
Acquire the autoinc lock.*/
void
dict_table_autoinc_lock(
/*====================*/
dict_table_t* table); /* in: table */
/************************************************************************
Initializes the autoinc counter. It is not an error to initialize an already
initialized counter. */
@ -180,22 +187,6 @@ dict_table_autoinc_initialize(
dict_table_t* table, /* in: table */
ib_longlong value); /* in: next value to assign to a row */
/************************************************************************
Gets the next autoinc value (== autoinc counter value), 0 if not yet
initialized. If initialized, increments the counter by 1. */
ib_longlong
dict_table_autoinc_get(
/*===================*/
/* out: value for a new row, or 0 */
dict_table_t* table); /* in: table */
/************************************************************************
Decrements the autoinc counter value by 1. */
void
dict_table_autoinc_decrement(
/*=========================*/
dict_table_t* table); /* in: table */
/************************************************************************
Reads the next autoinc value (== autoinc counter value), 0 if not yet
initialized. */
@ -205,15 +196,6 @@ dict_table_autoinc_read(
/* out: value for a new row, or 0 */
dict_table_t* table); /* in: table */
/************************************************************************
Peeks the autoinc counter value, 0 if not yet initialized. Does not
increment the counter. The read not protected by any mutex! */
ib_longlong
dict_table_autoinc_peek(
/*====================*/
/* out: value of the counter */
dict_table_t* table); /* in: table */
/************************************************************************
Updates the autoinc counter if the value supplied is equal or bigger than the
current value. If not inited, does nothing. */
@ -223,13 +205,29 @@ dict_table_autoinc_update(
dict_table_t* table, /* in: table */
ib_longlong value); /* in: value which was assigned to a row */
/************************************************************************
Release the autoinc lock.*/
void
dict_table_autoinc_unlock(
/*======================*/
dict_table_t* table); /* in: table */
/**************************************************************************
Adds system columns to a table object. */
void
dict_table_add_system_columns(
/*==========================*/
dict_table_t* table, /* in/out: table */
mem_heap_t* heap); /* in: temporary heap */
/**************************************************************************
Adds a table object to the dictionary cache. */
void
dict_table_add_to_cache(
/*====================*/
dict_table_t* table); /* in: table */
dict_table_t* table, /* in: table */
mem_heap_t* heap); /* in: temporary heap */
/**************************************************************************
Removes a table object from the dictionary cache. */

View file

@ -72,7 +72,8 @@ void
dict_mem_table_add_col(
/*===================*/
dict_table_t* table, /* in: table */
const char* name, /* in: column name */
mem_heap_t* heap, /* in: temporary memory heap, or NULL */
const char* name, /* in: column name, or NULL */
ulint mtype, /* in: main datatype */
ulint prtype, /* in: precise type */
ulint len); /* in: precision */
@ -314,11 +315,11 @@ struct dict_table_struct{
unsigned n_cols:10;/* number of columns */
dict_col_t* cols; /* array of column descriptions */
const char* col_names;
/* n_def column names packed in an
"name1\0name2\0...nameN\0" array. until
n_def reaches n_cols, this is allocated with
ut_malloc, and the final size array is
allocated through the table's heap. */
/* Column names packed in a character string
"name1\0name2\0...nameN\0". Until
the string contains n_cols, it will be
allocated from a temporary heap. The final
string will be allocated from table->heap. */
hash_node_t name_hash; /* hash chain node */
hash_node_t id_hash; /* hash chain node */
UT_LIST_BASE_NODE_T(dict_index_t)
@ -410,6 +411,21 @@ struct dict_table_struct{
SELECT MAX(auto inc column) */
ib_longlong autoinc;/* autoinc counter value to give to the
next inserted row */
ib_longlong autoinc_increment;
/* The increment step of the auto increment
column. Value must be greater than or equal
to 1 */
ulong n_waiting_or_granted_auto_inc_locks;
/* This counter is used to track the number
of granted and pending autoinc locks on this
table. This value is set after acquiring the
kernel mutex but we peek the contents to
determine whether other transactions have
acquired the AUTOINC lock or not. Of course
only one transaction can be granted the
lock but there can be multiple waiters. */
#ifdef UNIV_DEBUG
ulint magic_n;/* magic number */
# define DICT_TABLE_MAGIC_N 76333786

View file

@ -609,7 +609,7 @@ lock_validate(void);
/* out: TRUE if ok */
/*************************************************************************
Return approximate number or record locks (bits set in the bitmap) for
this transaction. Since delete-marked records maybe removed, the
this transaction. Since delete-marked records may be removed, the
record count will not be precise. */
ulint

View file

@ -271,15 +271,19 @@ mem_heap_free_heap_top(
ut_ad(mem_block_get_start(block) <= mem_block_get_free(block));
/* In the debug version erase block from top up */
mem_erase_buf(old_top, (byte*)block + block->len - old_top);
{
ulint len = (byte*)block + block->len - old_top;
mem_erase_buf(old_top, len);
UNIV_MEM_FREE(old_top, len);
}
/* Update allocated memory count */
mutex_enter(&mem_hash_mutex);
mem_current_allocated_memory -= (total_size - size);
mutex_exit(&mem_hash_mutex);
#endif
#else /* UNIV_MEM_DEBUG */
UNIV_MEM_FREE(old_top, (byte*)block + block->len - old_top);
#endif /* UNIV_MEM_DEBUG */
/* If free == start, we may free the block if it is not the first
one */

View file

@ -670,6 +670,7 @@ struct row_prebuilt_struct {
to this heap */
mem_heap_t* old_vers_heap; /* memory heap where a previous
version is built in consistent read */
ulonglong last_value; /* last value of AUTO-INC interval */
ulint magic_n2; /* this should be the same as
magic_n */
};

View file

@ -171,7 +171,17 @@ row_search_check_if_query_cache_permitted(
trx_t* trx, /* in: transaction object */
const char* norm_name); /* in: concatenation of database name,
'/' char, table name */
/***********************************************************************
Read the max AUTOINC value from an index. */
ulint
row_search_max_autoinc(
/*===================*/
/* out: DB_SUCCESS if all OK else
error code */
dict_index_t* index, /* in: index to search */
const char* col_name, /* in: autoinc column name */
ib_longlong* value); /* out: AUTOINC value read */
/* A structure for caching column values for prefetched rows */
struct sel_buf_struct{

View file

@ -231,7 +231,7 @@ rw_lock_s_lock_func(
owns an s-lock here, it may end up in a deadlock with another thread
which requests an x-lock here. Therefore, we will forbid recursive
s-locking of a latch: the following assert will warn the programmer
of the possibility of a tjis kind of deadlock. If we want to implement
of the possibility of this kind of a deadlock. If we want to implement
safe recursive s-locking, we should keep in a list the thread ids of
the threads which have s-locked a latch. This would use some CPU
time. */

View file

@ -482,31 +482,6 @@ struct trx_struct{
ib_longlong mysql_log_offset;/* if MySQL binlog is used, this field
contains the end offset of the binlog
entry */
const char* mysql_master_log_file_name;
/* if the database server is a MySQL
replication slave, we have here the
master binlog name up to which
replication has processed; otherwise
this is a pointer to a null
character */
ib_longlong mysql_master_log_pos;
/* if the database server is a MySQL
replication slave, this is the
position in the log file up to which
replication has processed */
/* A MySQL variable mysql_thd->synchronous_repl tells if we have
to use synchronous replication. See ha_innodb.cc. */
char* repl_wait_binlog_name;/* NULL, or if synchronous MySQL
replication is used, the binlog name
up to which we must communicate the
binlog to the slave, before returning
from a commit; this is the same as
mysql_log_file_name, but we allocate
and copy the name to a separate buffer
here */
ib_longlong repl_wait_binlog_pos;/* see above at
repl_wait_binlog_name */
os_thread_id_t mysql_thread_id;/* id of the MySQL thread associated
with this transaction object */
ulint mysql_process_no;/* since in Linux, 'top' reports
@ -681,6 +656,9 @@ struct trx_struct{
trx_undo_arr_t* undo_no_arr; /* array of undo numbers of undo log
records which are currently processed
by a rollback operation */
ulint n_autoinc_rows; /* no. of AUTO-INC rows required for
an SQL statement. This is useful for
multi-row INSERTs */
/*------------------------------*/
char detailed_error[256]; /* detailed error message for last
error, or empty. */

View file

@ -63,7 +63,7 @@ ut_test_malloc(
/* out: TRUE if succeeded */
ulint n); /* in: try to allocate this many bytes */
/**************************************************************************
Frees a memory bloock allocated with ut_malloc. */
Frees a memory block allocated with ut_malloc. */
void
ut_free(

View file

@ -3386,6 +3386,10 @@ lock_table_create(
ut_ad(table && trx);
ut_ad(mutex_own(&kernel_mutex));
if ((type_mode & LOCK_MODE_MASK) == LOCK_AUTO_INC) {
++table->n_waiting_or_granted_auto_inc_locks;
}
if (type_mode == LOCK_AUTO_INC) {
/* Only one trx can have the lock on the table
at a time: we may use the memory preallocated
@ -3436,6 +3440,9 @@ lock_table_remove_low(
if (lock == trx->auto_inc_lock) {
trx->auto_inc_lock = NULL;
ut_a(table->n_waiting_or_granted_auto_inc_locks > 0);
--table->n_waiting_or_granted_auto_inc_locks;
}
UT_LIST_REMOVE(trx_locks, trx->trx_locks, lock);

View file

@ -115,7 +115,7 @@ dulint recv_max_page_lsn;
Initialize crash recovery environment. Can be called iff
recv_needed_recovery == FALSE. */
static
void
void
recv_init_crash_recovery(void);
/*===========================*/
@ -2450,7 +2450,7 @@ void
recv_init_crash_recovery(void)
/*==========================*/
{
ut_a(!recv_needed_recovery);
ut_a(!recv_needed_recovery);
recv_needed_recovery = TRUE;
@ -2481,7 +2481,6 @@ recv_init_crash_recovery(void)
"InnoDB: buffer...\n");
trx_sys_doublewrite_init_or_restore_pages(TRUE);
}
}
/************************************************************
@ -2805,7 +2804,7 @@ recv_recovery_from_checkpoint_start(
recv_synchronize_groups(up_to_date_group);
if (!recv_needed_recovery) {
ut_a(ut_dulint_cmp(checkpoint_lsn,
ut_a(ut_dulint_cmp(checkpoint_lsn,
recv_sys->recovered_lsn) == 0);
} else {

View file

@ -517,8 +517,9 @@ mlog_parse_index(
n = mach_read_from_2(ptr);
ptr += 2;
n_uniq = mach_read_from_2(ptr);
ptr += 2;
ut_ad(n_uniq <= n);
if (end_ptr < ptr + (n + 1) * 2) {
if (end_ptr < ptr + n * 2) {
return(NULL);
}
} else {
@ -531,18 +532,18 @@ mlog_parse_index(
ind->table = table;
ind->n_uniq = (unsigned int) n_uniq;
if (n_uniq != n) {
ut_a(n_uniq + DATA_ROLL_PTR <= n);
ind->type = DICT_CLUSTERED;
}
/* avoid ut_ad(index->cached) in dict_index_get_n_unique_in_tree */
ind->cached = TRUE;
if (comp) {
for (i = 0; i < n; i++) {
ulint len = mach_read_from_2(ptr += 2);
ulint len = mach_read_from_2(ptr);
ptr += 2;
/* The high-order bit of len is the NOT NULL flag;
the rest is 0 or 0x7fff for variable-length fields,
and 1..0x7ffe for fixed-length fields. */
dict_mem_table_add_col(
table, "DUMMY",
table, NULL, NULL,
((len + 1) & 0x7fff) <= 1
? DATA_BINARY : DATA_FIXBINARY,
len & 0x8000 ? DATA_NOT_NULL : 0,
@ -552,8 +553,23 @@ mlog_parse_index(
dict_table_get_nth_col(table, i),
0);
}
ptr += 2;
dict_table_add_system_columns(table, table->heap);
if (n_uniq != n) {
/* Identify DB_TRX_ID and DB_ROLL_PTR in the index. */
ut_a(DATA_TRX_ID_LEN
== dict_index_get_nth_col(ind, DATA_TRX_ID - 1
+ n_uniq)->len);
ut_a(DATA_ROLL_PTR_LEN
== dict_index_get_nth_col(ind, DATA_ROLL_PTR - 1
+ n_uniq)->len);
ind->fields[DATA_TRX_ID - 1 + n_uniq].col
= &table->cols[n + DATA_TRX_ID];
ind->fields[DATA_ROLL_PTR - 1 + n_uniq].col
= &table->cols[n + DATA_ROLL_PTR];
}
}
/* avoid ut_ad(index->cached) in dict_index_get_n_unique_in_tree */
ind->cached = TRUE;
*index = ind;
return(ptr);
}

View file

@ -1640,7 +1640,8 @@ pars_create_table(
while (column) {
dtype = dfield_get_type(que_node_get_val(column));
dict_mem_table_add_col(table, column->name, dtype->mtype,
dict_mem_table_add_col(table, table->heap,
column->name, dtype->mtype,
dtype->prtype, dtype->len);
column->resolved = TRUE;
column->token_type = SYM_COLUMN;

View file

@ -655,6 +655,8 @@ row_create_prebuilt(
prebuilt->old_vers_heap = NULL;
prebuilt->last_value = 0;
return(prebuilt);
}
@ -2894,6 +2896,8 @@ next_rec:
dict_table_change_id_in_cache(table, new_id);
}
/* MySQL calls ha_innobase::reset_auto_increment() which does
the same thing. */
dict_table_autoinc_initialize(table, 0);
dict_update_statistics(table);

View file

@ -4519,3 +4519,169 @@ row_search_check_if_query_cache_permitted(
return(ret);
}
/***********************************************************************
Read the AUTOINC column from the current row. */
static
ib_longlong
row_search_autoinc_read_column(
/*===========================*/
/* out: value read from the column */
dict_index_t* index, /* in: index to read from */
const rec_t* rec, /* in: current rec */
ulint col_no, /* in: column number */
ibool unsigned_type) /* in: signed or unsigned flag */
{
ulint len;
byte* ptr;
const byte* data;
ib_longlong value;
mem_heap_t* heap = NULL;
byte dest[sizeof(value)];
ulint offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_;
*offsets_ = sizeof offsets_ / sizeof *offsets_;
/* TODO: We have to cast away the const of rec for now. This needs
to be fixed later.*/
offsets = rec_get_offsets(
(rec_t*) rec, index, offsets, ULINT_UNDEFINED, &heap);
/* TODO: We have to cast away the const of rec for now. This needs
to be fixed later.*/
data = rec_get_nth_field((rec_t*)rec, offsets, col_no, &len);
ut_a(len != UNIV_SQL_NULL);
ut_a(len <= sizeof value);
/* Convert integer data from Innobase to a little-endian format,
sign bit restored to normal */
for (ptr = dest + len; ptr != dest; ++data) {
--ptr;
*ptr = *data;
}
if (!unsigned_type) {
dest[len - 1] ^= 128;
}
/* The assumption here is that the AUTOINC value can't be negative.*/
switch (len) {
case 8:
value = *(ib_longlong*) ptr;
break;
case 4:
value = *(ib_uint32_t*) ptr;
break;
case 2:
value = *(uint16 *) ptr;
break;
case 1:
value = *ptr;
break;
default:
ut_error;
}
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
ut_a(value >= 0);
return(value);
}
/***********************************************************************
Get the last row. */
static
const rec_t*
row_search_autoinc_get_rec(
/*=======================*/
/* out: current rec or NULL */
btr_pcur_t* pcur, /* in: the current cursor */
mtr_t* mtr) /* in: mini transaction */
{
do {
const rec_t* rec = btr_pcur_get_rec(pcur);
if (page_rec_is_user_rec(rec)) {
return(rec);
}
} while (btr_pcur_move_to_prev(pcur, mtr));
return(NULL);
}
/***********************************************************************
Read the max AUTOINC value from an index. */
ulint
row_search_max_autoinc(
/*===================*/
/* out: DB_SUCCESS if all OK else
error code, DB_RECORD_NOT_FOUND if
column name can't be found in index */
dict_index_t* index, /* in: index to search */
const char* col_name, /* in: name of autoinc column */
ib_longlong* value) /* out: AUTOINC value read */
{
ulint i;
ulint n_cols;
dict_field_t* dfield = NULL;
ulint error = DB_SUCCESS;
n_cols = dict_index_get_n_ordering_defined_by_user(index);
/* Search the index for the AUTOINC column name */
for (i = 0; i < n_cols; ++i) {
dfield = dict_index_get_nth_field(index, i);
if (strcmp(col_name, dfield->name) == 0) {
break;
}
}
*value = 0;
/* Must find the AUTOINC column name */
if (i < n_cols && dfield) {
mtr_t mtr;
btr_pcur_t pcur;
mtr_start(&mtr);
/* Open at the high/right end (FALSE), and INIT
cursor (TRUE) */
btr_pcur_open_at_index_side(
FALSE, index, BTR_SEARCH_LEAF, &pcur, TRUE, &mtr);
if (page_get_n_recs(btr_pcur_get_page(&pcur)) > 0) {
const rec_t* rec;
rec = row_search_autoinc_get_rec(&pcur, &mtr);
if (rec != NULL) {
ibool unsigned_type = (
dfield->col->prtype & DATA_UNSIGNED);
*value = row_search_autoinc_read_column(
index, rec, i, unsigned_type);
}
}
btr_pcur_close(&pcur);
mtr_commit(&mtr);
} else {
error = DB_RECORD_NOT_FOUND;
}
return(error);
}

View file

@ -907,7 +907,7 @@ srv_init(void)
/* create dummy table and index for old-style infimum and supremum */
table = dict_mem_table_create("SYS_DUMMY1",
DICT_HDR_SPACE, 1, 0);
dict_mem_table_add_col(table, "DUMMY", DATA_CHAR,
dict_mem_table_add_col(table, NULL, NULL, DATA_CHAR,
DATA_ENGLISH | DATA_NOT_NULL, 8);
srv_sys->dummy_ind1 = dict_mem_index_create(
@ -918,7 +918,7 @@ srv_init(void)
/* create dummy table and index for new-style infimum and supremum */
table = dict_mem_table_create("SYS_DUMMY2",
DICT_HDR_SPACE, 1, DICT_TF_COMPACT);
dict_mem_table_add_col(table, "DUMMY", DATA_CHAR,
dict_mem_table_add_col(table, NULL, NULL, DATA_CHAR,
DATA_ENGLISH | DATA_NOT_NULL, 8);
srv_sys->dummy_ind2 = dict_mem_index_create(
"SYS_DUMMY2", "SYS_DUMMY2", DICT_HDR_SPACE, 0, 1);

View file

@ -646,6 +646,7 @@ trx_sys_update_mysql_binlog_offset(
MLOG_4BYTES, mtr);
}
#ifdef UNIV_HOTBACKUP
/*********************************************************************
Prints to stderr the MySQL binlog info in the system header if the
magic number shows it valid. */
@ -677,6 +678,7 @@ trx_sys_print_mysql_binlog_offset_from_page(
+ TRX_SYS_MYSQL_LOG_NAME);
}
}
#endif /* UNIV_HOTBACKUP */
/*********************************************************************
Stores the MySQL binlog offset info in the trx system header if

View file

@ -139,11 +139,6 @@ trx_create(
trx->mysql_log_file_name = NULL;
trx->mysql_log_offset = 0;
trx->mysql_master_log_file_name = "";
trx->mysql_master_log_pos = 0;
trx->repl_wait_binlog_name = NULL;
trx->repl_wait_binlog_pos = 0;
mutex_create(&trx->undo_mutex, SYNC_TRX_UNDO);
@ -195,6 +190,8 @@ trx_create(
memset(&trx->xid, 0, sizeof(trx->xid));
trx->xid.formatID = -1;
trx->n_autoinc_rows = 0;
trx_reset_new_rec_lock_info(trx);
return(trx);
@ -323,11 +320,6 @@ trx_free(
trx_undo_arr_free(trx->undo_no_arr);
}
if (trx->repl_wait_binlog_name != NULL) {
mem_free(trx->repl_wait_binlog_name);
}
ut_a(UT_LIST_GET_LEN(trx->signals) == 0);
ut_a(UT_LIST_GET_LEN(trx->reply_signals) == 0);
@ -807,14 +799,6 @@ trx_commit_off_kernel(
trx->mysql_log_file_name = NULL;
}
if (trx->mysql_master_log_file_name[0] != '\0') {
/* This database server is a MySQL replication slave */
trx_sys_update_mysql_binlog_offset(
trx->mysql_master_log_file_name,
trx->mysql_master_log_pos,
TRX_SYS_MYSQL_MASTER_LOG_INFO, &mtr);
}
/* The following call commits the mini-transaction, making the
whole transaction committed in the file-based world, at this
log sequence number. The transaction becomes 'durable' when