mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into serg.mylan:/usr/home/serg/Abk/m51
This commit is contained in:
46
mysql-test/r/ndb_loaddatalocal.result
Normal file
46
mysql-test/r/ndb_loaddatalocal.result
Normal file
@ -0,0 +1,46 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
create table t1(a int) engine=myisam;
|
||||
select * into outfile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
|
||||
drop table t1;
|
||||
create table t1(a int) engine=ndb;
|
||||
load data local infile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
10000
|
||||
drop table t1;
|
||||
create table t1(a int) engine=myisam;
|
||||
insert into t1 values (1), (2), (2), (3);
|
||||
select * into outfile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
|
||||
drop table t1;
|
||||
create table t1(a int primary key) engine=ndb;
|
||||
load data local infile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
|
||||
select * from t1 order by a;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
drop table t1;
|
||||
create table t1(a int) engine=myisam;
|
||||
insert into t1 values (1), (1), (2), (3);
|
||||
select * into outfile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
|
||||
drop table t1;
|
||||
create table t1(a int primary key) engine=ndb;
|
||||
load data local infile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
|
||||
select * from t1 order by a;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
drop table t1;
|
||||
create table t1(a int) engine=myisam;
|
||||
insert into t1 values (1), (2), (3), (3);
|
||||
select * into outfile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
|
||||
drop table t1;
|
||||
create table t1(a int primary key) engine=ndb;
|
||||
load data local infile 'MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
|
||||
select * from t1 order by a;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
drop table t1;
|
@ -1,4 +1,33 @@
|
||||
drop table if exists t1;
|
||||
create table t1 (a bigint)
|
||||
partition by range (a)
|
||||
(partition p0 values less than (0xFFFFFFFFFFFFFFFF),
|
||||
partition p1 values less than (10));
|
||||
ERROR 42000: VALUES value must be of same type as partition function near '),
|
||||
partition p1 values less than (10))' at line 3
|
||||
create table t1 (a bigint)
|
||||
partition by list (a)
|
||||
(partition p0 values in (0xFFFFFFFFFFFFFFFF),
|
||||
partition p1 values in (10));
|
||||
ERROR 42000: VALUES value must be of same type as partition function near '),
|
||||
partition p1 values in (10))' at line 3
|
||||
create table t1 (a bigint unsigned)
|
||||
partition by range (a)
|
||||
(partition p0 values less than (100),
|
||||
partition p1 values less than MAXVALUE);
|
||||
insert into t1 values (1);
|
||||
drop table t1;
|
||||
create table t1 (a bigint unsigned)
|
||||
partition by hash (a);
|
||||
insert into t1 values (0xFFFFFFFFFFFFFFFD);
|
||||
insert into t1 values (0xFFFFFFFFFFFFFFFE);
|
||||
select * from t1 where (a + 1) < 10;
|
||||
a
|
||||
select * from t1 where (a + 1) > 10;
|
||||
a
|
||||
18446744073709551613
|
||||
18446744073709551614
|
||||
drop table t1;
|
||||
create table t1 (a int)
|
||||
engine = csv
|
||||
partition by list (a)
|
||||
@ -779,6 +808,18 @@ insert into t1 values (null);
|
||||
select * from t1 where f1 is null;
|
||||
f1
|
||||
NULL
|
||||
select * from t1 where f1 < 1;
|
||||
f1
|
||||
select * from t1 where f1 <= NULL;
|
||||
f1
|
||||
select * from t1 where f1 < NULL;
|
||||
f1
|
||||
select * from t1 where f1 >= NULL;
|
||||
f1
|
||||
select * from t1 where f1 > NULL;
|
||||
f1
|
||||
select * from t1 where f1 > 1;
|
||||
f1
|
||||
drop table t1;
|
||||
create table t1 (f1 smallint)
|
||||
partition by range (f1) (partition p0 values less than (0));
|
||||
@ -865,6 +906,16 @@ SHOW TABLE STATUS;
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
t1 MyISAM 10 Dynamic 0 0 0 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
|
||||
DROP TABLE t1;
|
||||
create table t1 (a bigint unsigned)
|
||||
partition by list (a)
|
||||
(partition p0 values in (0-1));
|
||||
ERROR HY000: Partition constant is out of partition function domain
|
||||
create table t1 (a bigint unsigned)
|
||||
partition by range (a)
|
||||
(partition p0 values less than (10));
|
||||
insert into t1 values (0xFFFFFFFFFFFFFFFF);
|
||||
ERROR HY000: Table has no partition for value 18446744073709551615
|
||||
drop table t1;
|
||||
create table t1 (a int)
|
||||
partition by list (a)
|
||||
(partition `s1 s2` values in (0));
|
||||
|
@ -554,6 +554,10 @@ PARTITION BY RANGE (a) (PARTITION p1 VALUES LESS THAN(5));
|
||||
insert into t1 values (10);
|
||||
ERROR HY000: Table has no partition for value 10
|
||||
drop table t1;
|
||||
create table t1 (a bigint unsigned)
|
||||
partition by range (a)
|
||||
(partition p0 values less than (-1));
|
||||
ERROR HY000: Partition constant is out of partition function domain
|
||||
create table t1 (v varchar(12))
|
||||
partition by range (ascii(v))
|
||||
(partition p0 values less than (10));
|
||||
|
@ -363,6 +363,33 @@ SELECT COUNT(*) FROM t1 WHERE c3 < '2000-12-31';
|
||||
COUNT(*)
|
||||
10
|
||||
DROP TABLE t1;
|
||||
create table t1 (a bigint unsigned)
|
||||
partition by range (a)
|
||||
(partition p0 values less than (10),
|
||||
partition p1 values less than (0));
|
||||
ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
|
||||
create table t1 (a bigint unsigned)
|
||||
partition by range (a)
|
||||
(partition p0 values less than (0),
|
||||
partition p1 values less than (10));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` bigint(20) unsigned DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM)
|
||||
drop table t1;
|
||||
create table t1 (a bigint unsigned)
|
||||
partition by range (a)
|
||||
(partition p0 values less than (2),
|
||||
partition p1 values less than (10));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` bigint(20) unsigned DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (2) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM)
|
||||
insert into t1 values (0xFFFFFFFFFFFFFFFF);
|
||||
ERROR HY000: Table has no partition for value 18446744073709551615
|
||||
drop table t1;
|
||||
create table t1 (a int)
|
||||
partition by range (MOD(a,3))
|
||||
subpartition by hash(a)
|
||||
|
70
mysql-test/t/ndb_loaddatalocal.test
Normal file
70
mysql-test/t/ndb_loaddatalocal.test
Normal file
@ -0,0 +1,70 @@
|
||||
-- source include/have_ndb.inc
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
create table t1(a int) engine=myisam;
|
||||
let $1=10000;
|
||||
disable_query_log;
|
||||
set SQL_LOG_BIN=0;
|
||||
while ($1)
|
||||
{
|
||||
insert into t1 values(1);
|
||||
dec $1;
|
||||
}
|
||||
set SQL_LOG_BIN=1;
|
||||
enable_query_log;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
eval select * into outfile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
|
||||
#This will generate a 20KB file, now test LOAD DATA LOCAL
|
||||
drop table t1;
|
||||
|
||||
create table t1(a int) engine=ndb;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
eval load data local infile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
|
||||
select count(*) from t1;
|
||||
system rm $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile ;
|
||||
drop table t1;
|
||||
|
||||
create table t1(a int) engine=myisam;
|
||||
insert into t1 values (1), (2), (2), (3);
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
eval select * into outfile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
|
||||
drop table t1;
|
||||
|
||||
create table t1(a int primary key) engine=ndb;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
eval load data local infile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
|
||||
system rm $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile;
|
||||
select * from t1 order by a;
|
||||
drop table t1;
|
||||
|
||||
create table t1(a int) engine=myisam;
|
||||
insert into t1 values (1), (1), (2), (3);
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
eval select * into outfile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
|
||||
drop table t1;
|
||||
|
||||
create table t1(a int primary key) engine=ndb;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
eval load data local infile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
|
||||
system rm $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile;
|
||||
select * from t1 order by a;
|
||||
drop table t1;
|
||||
|
||||
create table t1(a int) engine=myisam;
|
||||
insert into t1 values (1), (2), (3), (3);
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
eval select * into outfile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' from t1;
|
||||
drop table t1;
|
||||
|
||||
create table t1(a int primary key) engine=ndb;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
eval load data local infile '$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
|
||||
system rm $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile;
|
||||
select * from t1 order by a;
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
@ -9,6 +9,35 @@
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
# BUG 16002: Handle unsigned integer functions properly
|
||||
#
|
||||
--error 1064
|
||||
create table t1 (a bigint)
|
||||
partition by range (a)
|
||||
(partition p0 values less than (0xFFFFFFFFFFFFFFFF),
|
||||
partition p1 values less than (10));
|
||||
--error 1064
|
||||
create table t1 (a bigint)
|
||||
partition by list (a)
|
||||
(partition p0 values in (0xFFFFFFFFFFFFFFFF),
|
||||
partition p1 values in (10));
|
||||
|
||||
create table t1 (a bigint unsigned)
|
||||
partition by range (a)
|
||||
(partition p0 values less than (100),
|
||||
partition p1 values less than MAXVALUE);
|
||||
insert into t1 values (1);
|
||||
drop table t1;
|
||||
|
||||
create table t1 (a bigint unsigned)
|
||||
partition by hash (a);
|
||||
insert into t1 values (0xFFFFFFFFFFFFFFFD);
|
||||
insert into t1 values (0xFFFFFFFFFFFFFFFE);
|
||||
select * from t1 where (a + 1) < 10;
|
||||
select * from t1 where (a + 1) > 10;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug 19307: CSV engine crashes
|
||||
#
|
||||
@ -19,6 +48,7 @@ partition by list (a)
|
||||
(partition p0 values in (null));
|
||||
|
||||
#
|
||||
# Added test case
|
||||
#
|
||||
create table t1 (a int)
|
||||
partition by key(a)
|
||||
@ -919,6 +949,12 @@ create table t1 (f1 smallint)
|
||||
partition by list (f1) (partition p0 values in (null));
|
||||
insert into t1 values (null);
|
||||
select * from t1 where f1 is null;
|
||||
select * from t1 where f1 < 1;
|
||||
select * from t1 where f1 <= NULL;
|
||||
select * from t1 where f1 < NULL;
|
||||
select * from t1 where f1 >= NULL;
|
||||
select * from t1 where f1 > NULL;
|
||||
select * from t1 where f1 > 1;
|
||||
drop table t1;
|
||||
|
||||
create table t1 (f1 smallint)
|
||||
@ -985,6 +1021,23 @@ PARTITION p2 VALUES LESS THAN (30) ENGINE = MyISAM);
|
||||
SHOW TABLE STATUS;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
#BUG 16002 Erroneus handling of unsigned partition functions
|
||||
#
|
||||
--error ER_PARTITION_CONST_DOMAIN_ERROR
|
||||
create table t1 (a bigint unsigned)
|
||||
partition by list (a)
|
||||
(partition p0 values in (0-1));
|
||||
|
||||
create table t1 (a bigint unsigned)
|
||||
partition by range (a)
|
||||
(partition p0 values less than (10));
|
||||
|
||||
--error ER_NO_PARTITION_FOR_GIVEN_VALUE
|
||||
insert into t1 values (0xFFFFFFFFFFFFFFFF);
|
||||
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
#BUG 18750 Problems with partition names
|
||||
#
|
||||
|
@ -748,6 +748,10 @@ CREATE TABLE t1(a int)
|
||||
insert into t1 values (10);
|
||||
drop table t1;
|
||||
|
||||
--error ER_PARTITION_CONST_DOMAIN_ERROR
|
||||
create table t1 (a bigint unsigned)
|
||||
partition by range (a)
|
||||
(partition p0 values less than (-1));
|
||||
#
|
||||
# Bug 18198 Partitions: Verify that erroneus partition functions doesn't work
|
||||
#
|
||||
|
@ -388,6 +388,31 @@ SELECT COUNT(*) FROM t1 WHERE c3 BETWEEN '1996-12-31' AND '2000-12-31';
|
||||
SELECT COUNT(*) FROM t1 WHERE c3 < '2000-12-31';
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# BUG 16002: Unsigned partition functions not handled correctly
|
||||
#
|
||||
--error ER_RANGE_NOT_INCREASING_ERROR
|
||||
create table t1 (a bigint unsigned)
|
||||
partition by range (a)
|
||||
(partition p0 values less than (10),
|
||||
partition p1 values less than (0));
|
||||
|
||||
create table t1 (a bigint unsigned)
|
||||
partition by range (a)
|
||||
(partition p0 values less than (0),
|
||||
partition p1 values less than (10));
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
create table t1 (a bigint unsigned)
|
||||
partition by range (a)
|
||||
(partition p0 values less than (2),
|
||||
partition p1 values less than (10));
|
||||
show create table t1;
|
||||
--error ER_NO_PARTITION_FOR_GIVEN_VALUE
|
||||
insert into t1 values (0xFFFFFFFFFFFFFFFF);
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# BUG 18962 Errors in DROP PARTITION
|
||||
#
|
||||
|
Reference in New Issue
Block a user