~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/suite/ndb/r/ndb_partition_list.result

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
drop table if exists t1;
 
2
CREATE TABLE t1 ( f_int1 INTEGER NOT NULL, f_int2 INTEGER NOT NULL, 
 
3
f_char1 CHAR(10),
 
4
f_char2 CHAR(10), f_charbig VARCHAR(1000),
 
5
PRIMARY KEY (f_int1,f_int2))
 
6
ENGINE = NDB
 
7
PARTITION BY LIST(MOD(f_int1 + f_int2,4)) 
 
8
(PARTITION part_3 VALUES IN (-3),
 
9
PARTITION part_2 VALUES IN (-2),
 
10
PARTITION part_1 VALUES IN (-1),
 
11
PARTITION part0 VALUES IN (0),
 
12
PARTITION part1 VALUES IN (1),
 
13
PARTITION part2 VALUES IN (2),
 
14
PARTITION part3 VALUES IN (3,4,5));
 
15
INSERT INTO t1 SET f_int1 = -2, f_int2 = 20, f_char1 = '20', f_char2 = '20', f_charbig = '===20===';
 
16
INSERT INTO t1 SET f_int1 = 1, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
 
17
INSERT INTO t1 SET f_int1 = 2, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
 
18
INSERT INTO t1 SET f_int1 = 3, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
 
19
INSERT INTO t1 SET f_int1 = 4, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
 
20
INSERT INTO t1 SET f_int1 = 5, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
 
21
INSERT INTO t1 SET f_int1 = 20, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
 
22
SELECT * FROM t1 ORDER BY f_int1;
 
23
f_int1  f_int2  f_char1 f_char2 f_charbig
 
24
-2      20      20      20      ===20===
 
25
1       1       1       1       ===1===
 
26
2       1       1       1       ===1===
 
27
3       1       1       1       ===1===
 
28
4       1       1       1       ===1===
 
29
5       1       1       1       ===1===
 
30
20      1       1       1       ===1===
 
31
DROP TABLE t1;
 
32
CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, f_char1 CHAR(10), 
 
33
f_char2 CHAR(10), f_charbig VARCHAR(1000))
 
34
ENGINE = NDB
 
35
PARTITION BY LIST(f_int1) 
 
36
(PARTITION part_1 VALUES IN (-1),
 
37
PARTITION part0 VALUES IN (0,1),
 
38
PARTITION part1 VALUES IN (2));
 
39
INSERT INTO t1 SET f_int1 = -1, f_int2 = 20, f_char1 = '20', f_char2 = '20', f_charbig = '===20===';
 
40
INSERT INTO t1 SET f_int1 = 0, f_int2 = 20, f_char1 = '20', f_char2 = '20', f_charbig = '===20===';
 
41
INSERT INTO t1 SET f_int1 = 1, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
 
42
INSERT INTO t1 SET f_int1 = 2, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
 
43
INSERT INTO t1 SET f_int1 = 20, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
 
44
ERROR HY000: Table has no partition for value 20
 
45
SELECT * FROM t1 ORDER BY f_int1;
 
46
f_int1  f_int2  f_char1 f_char2 f_charbig
 
47
-1      20      20      20      ===20===
 
48
0       20      20      20      ===20===
 
49
1       1       1       1       ===1===
 
50
2       1       1       1       ===1===
 
51
DROP TABLE t1;