summaryrefslogtreecommitdiff
path: root/mysql-test/suite/ndb/t/ndb_partition_error.test
blob: 9db2a6a6f6d15ac7dd950d59e8bcd1db06e45d66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
-- source include/have_ndb.inc
#--disable_abort_on_error
#
# Simple test for the partition storage engine
# Focuses on range partitioning tests
# 
#-- source include/have_partition.inc

--disable_warnings
drop table if exists t1;
--enable_warnings

--disable_query_log
set new=on;
--enable_query_log
#
# Partition by range, generate node group error
#
--error 1005
CREATE TABLE t1 (
a int not null,
b int not null,
c int not null,
primary key(a,b),
index (a))
engine = ndb
partition by range (a)
partitions 3
(partition x1 values less than (5) nodegroup 12,
 partition x2 values less than (10) nodegroup 13,
 partition x3 values less than (20) nodegroup 14);
show warnings;

#
# Partition by range, create normal valid table 
#
CREATE TABLE t1 (
a int not null,
b int not null,
c int not null,
primary key(a))
engine = ndb
partition by range (a)
partitions 3
(partition x1 values less than (5),
 partition x2 values less than (10),
 partition x3 values less than (20));

drop table t1;

#
# Bug #17763 mysqld cores with list partitioning if update to missing partition
#
CREATE TABLE t1 (id INT) ENGINE=NDB
  PARTITION BY LIST(id)
   (PARTITION p0 VALUES IN (2, 4),
    PARTITION p1 VALUES IN (42, 142));
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 ER_NO_PARTITION_FOR_GIVEN_VALUE
insert into t1 values (NULL,1,1);
drop table t1;