Loading mysql-test/r/ndb_partition_error.result +9 −0 Original line number Diff line number Diff line Loading @@ -36,3 +36,12 @@ INSERT INTO t1 VALUES (2); UPDATE t1 SET id=5 WHERE id=2; ERROR HY000: Table has no partition for value 5 DROP TABLE t1; create table t1 (a int,b int, c int) engine = ndb partition by list(a) partitions 2 (partition x123 values in (11, 12), partition x234 values in (5, 1)); insert into t1 values (NULL,1,1); ERROR HY000: Table has no partition for value NULL drop table t1; mysql-test/r/partition.result +49 −0 Original line number Diff line number Diff line Loading @@ -373,4 +373,53 @@ end// call p()// drop procedure p// drop table t1// create table t1 (a int,b int,c int,key(a,b)) partition by range (a) partitions 3 (partition x1 values less than (0) tablespace ts1, partition x2 values less than (10) tablespace ts2, partition x3 values less than maxvalue tablespace ts3); insert into t1 values (NULL, 1, 1); insert into t1 values (0, 1, 1); insert into t1 values (12, 1, 1); select partition_name, partition_description, table_rows from information_schema.partitions where table_schema ='test'; partition_name partition_description table_rows x1 0 1 x2 10 1 x3 MAXVALUE 1 drop table t1; create table t1 (a int,b int, c int) partition by list(a) partitions 2 (partition x123 values in (11,12), partition x234 values in (1 ,NULL, NULL)); ERROR HY000: Multiple definition of same constant in list partitioning create table t1 (a int,b int, c int) partition by list(a) partitions 2 (partition x123 values in (11, NULL), partition x234 values in (1 ,NULL)); ERROR HY000: Multiple definition of same constant in list partitioning create table t1 (a int,b int, c int) partition by list(a) partitions 2 (partition x123 values in (11, 12), partition x234 values in (5, 1)); insert into t1 values (NULL,1,1); ERROR HY000: Table has no partition for value NULL drop table t1; create table t1 (a int,b int, c int) partition by list(a) partitions 2 (partition x123 values in (11, 12), partition x234 values in (NULL, 1)); insert into t1 values (11,1,6); insert into t1 values (NULL,1,1); select partition_name, partition_description, table_rows from information_schema.partitions where table_schema ='test'; partition_name partition_description table_rows x123 11,12 1 x234 NULL,1 1 drop table t1; End of 5.1 tests mysql-test/t/ndb_partition_error.test +13 −0 Original line number Diff line number Diff line Loading @@ -56,3 +56,16 @@ INSERT INTO t1 VALUES (2); --error ER_NO_PARTITION_FOR_GIVEN_VALUE UPDATE t1 SET id=5 WHERE id=2; DROP TABLE t1; # # NULL for LIST partition # create table t1 (a int,b int, c int) engine = ndb partition by list(a) partitions 2 (partition x123 values in (11, 12), partition x234 values in (5, 1)); --error 1504 insert into t1 values (NULL,1,1); drop table t1; mysql-test/t/partition.test +57 −0 Original line number Diff line number Diff line Loading @@ -483,4 +483,61 @@ drop procedure p// drop table t1// delimiter ;// # # Bug #15447 Partitions: NULL is treated as zero # # NULL for RANGE partition create table t1 (a int,b int,c int,key(a,b)) partition by range (a) partitions 3 (partition x1 values less than (0) tablespace ts1, partition x2 values less than (10) tablespace ts2, partition x3 values less than maxvalue tablespace ts3); insert into t1 values (NULL, 1, 1); insert into t1 values (0, 1, 1); insert into t1 values (12, 1, 1); select partition_name, partition_description, table_rows from information_schema.partitions where table_schema ='test'; drop table t1; # NULL for LIST partition --error 1473 create table t1 (a int,b int, c int) partition by list(a) partitions 2 (partition x123 values in (11,12), partition x234 values in (1 ,NULL, NULL)); --error 1473 create table t1 (a int,b int, c int) partition by list(a) partitions 2 (partition x123 values in (11, NULL), partition x234 values in (1 ,NULL)); create table t1 (a int,b int, c int) partition by list(a) partitions 2 (partition x123 values in (11, 12), partition x234 values in (5, 1)); --error 1504 insert into t1 values (NULL,1,1); drop table t1; create table t1 (a int,b int, c int) partition by list(a) partitions 2 (partition x123 values in (11, 12), partition x234 values in (NULL, 1)); insert into t1 values (11,1,6); insert into t1 values (NULL,1,1); select partition_name, partition_description, table_rows from information_schema.partitions where table_schema ='test'; drop table t1; --echo End of 5.1 tests sql/ha_ndbcluster.cc +1 −0 Original line number Diff line number Diff line Loading @@ -6028,6 +6028,7 @@ void ha_ndbcluster::print_error(int error, myf errflag) { char buf[100]; my_error(ER_NO_PARTITION_FOR_GIVEN_VALUE, MYF(0), m_part_info->part_expr->null_value ? "NULL" : llstr(m_part_info->part_expr->val_int(), buf)); } else Loading Loading
mysql-test/r/ndb_partition_error.result +9 −0 Original line number Diff line number Diff line Loading @@ -36,3 +36,12 @@ INSERT INTO t1 VALUES (2); UPDATE t1 SET id=5 WHERE id=2; ERROR HY000: Table has no partition for value 5 DROP TABLE t1; create table t1 (a int,b int, c int) engine = ndb partition by list(a) partitions 2 (partition x123 values in (11, 12), partition x234 values in (5, 1)); insert into t1 values (NULL,1,1); ERROR HY000: Table has no partition for value NULL drop table t1;
mysql-test/r/partition.result +49 −0 Original line number Diff line number Diff line Loading @@ -373,4 +373,53 @@ end// call p()// drop procedure p// drop table t1// create table t1 (a int,b int,c int,key(a,b)) partition by range (a) partitions 3 (partition x1 values less than (0) tablespace ts1, partition x2 values less than (10) tablespace ts2, partition x3 values less than maxvalue tablespace ts3); insert into t1 values (NULL, 1, 1); insert into t1 values (0, 1, 1); insert into t1 values (12, 1, 1); select partition_name, partition_description, table_rows from information_schema.partitions where table_schema ='test'; partition_name partition_description table_rows x1 0 1 x2 10 1 x3 MAXVALUE 1 drop table t1; create table t1 (a int,b int, c int) partition by list(a) partitions 2 (partition x123 values in (11,12), partition x234 values in (1 ,NULL, NULL)); ERROR HY000: Multiple definition of same constant in list partitioning create table t1 (a int,b int, c int) partition by list(a) partitions 2 (partition x123 values in (11, NULL), partition x234 values in (1 ,NULL)); ERROR HY000: Multiple definition of same constant in list partitioning create table t1 (a int,b int, c int) partition by list(a) partitions 2 (partition x123 values in (11, 12), partition x234 values in (5, 1)); insert into t1 values (NULL,1,1); ERROR HY000: Table has no partition for value NULL drop table t1; create table t1 (a int,b int, c int) partition by list(a) partitions 2 (partition x123 values in (11, 12), partition x234 values in (NULL, 1)); insert into t1 values (11,1,6); insert into t1 values (NULL,1,1); select partition_name, partition_description, table_rows from information_schema.partitions where table_schema ='test'; partition_name partition_description table_rows x123 11,12 1 x234 NULL,1 1 drop table t1; End of 5.1 tests
mysql-test/t/ndb_partition_error.test +13 −0 Original line number Diff line number Diff line Loading @@ -56,3 +56,16 @@ INSERT INTO t1 VALUES (2); --error ER_NO_PARTITION_FOR_GIVEN_VALUE UPDATE t1 SET id=5 WHERE id=2; DROP TABLE t1; # # NULL for LIST partition # create table t1 (a int,b int, c int) engine = ndb partition by list(a) partitions 2 (partition x123 values in (11, 12), partition x234 values in (5, 1)); --error 1504 insert into t1 values (NULL,1,1); drop table t1;
mysql-test/t/partition.test +57 −0 Original line number Diff line number Diff line Loading @@ -483,4 +483,61 @@ drop procedure p// drop table t1// delimiter ;// # # Bug #15447 Partitions: NULL is treated as zero # # NULL for RANGE partition create table t1 (a int,b int,c int,key(a,b)) partition by range (a) partitions 3 (partition x1 values less than (0) tablespace ts1, partition x2 values less than (10) tablespace ts2, partition x3 values less than maxvalue tablespace ts3); insert into t1 values (NULL, 1, 1); insert into t1 values (0, 1, 1); insert into t1 values (12, 1, 1); select partition_name, partition_description, table_rows from information_schema.partitions where table_schema ='test'; drop table t1; # NULL for LIST partition --error 1473 create table t1 (a int,b int, c int) partition by list(a) partitions 2 (partition x123 values in (11,12), partition x234 values in (1 ,NULL, NULL)); --error 1473 create table t1 (a int,b int, c int) partition by list(a) partitions 2 (partition x123 values in (11, NULL), partition x234 values in (1 ,NULL)); create table t1 (a int,b int, c int) partition by list(a) partitions 2 (partition x123 values in (11, 12), partition x234 values in (5, 1)); --error 1504 insert into t1 values (NULL,1,1); drop table t1; create table t1 (a int,b int, c int) partition by list(a) partitions 2 (partition x123 values in (11, 12), partition x234 values in (NULL, 1)); insert into t1 values (11,1,6); insert into t1 values (NULL,1,1); select partition_name, partition_description, table_rows from information_schema.partitions where table_schema ='test'; drop table t1; --echo End of 5.1 tests
sql/ha_ndbcluster.cc +1 −0 Original line number Diff line number Diff line Loading @@ -6028,6 +6028,7 @@ void ha_ndbcluster::print_error(int error, myf errflag) { char buf[100]; my_error(ER_NO_PARTITION_FOR_GIVEN_VALUE, MYF(0), m_part_info->part_expr->null_value ? "NULL" : llstr(m_part_info->part_expr->val_int(), buf)); } else Loading