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

« back to all changes in this revision

Viewing changes to mysql-test/suite/ndb/r/ndb_bitfield.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 (
 
3
pk1 int not null primary key,
 
4
b bit(64)
 
5
) engine=ndbcluster;
 
6
show create table t1;
 
7
Table   Create Table
 
8
t1      CREATE TABLE `t1` (
 
9
  `pk1` int(11) NOT NULL,
 
10
  `b` bit(64) DEFAULT NULL,
 
11
  PRIMARY KEY (`pk1`)
 
12
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
 
13
insert into t1 values 
 
14
(0,b'1111111111111111111111111111111111111111111111111111111111111111'),
 
15
(1,b'1000000000000000000000000000000000000000000000000000000000000000'),
 
16
(2,b'0000000000000000000000000000000000000000000000000000000000000001'),
 
17
(3,b'1010101010101010101010101010101010101010101010101010101010101010'),
 
18
(4,b'0101010101010101010101010101010101010101010101010101010101010101');
 
19
select hex(b) from t1 order by pk1;
 
20
hex(b)
 
21
FFFFFFFFFFFFFFFF
 
22
8000000000000000
 
23
1
 
24
AAAAAAAAAAAAAAAA
 
25
5555555555555555
 
26
drop table t1;
 
27
create table t1 (
 
28
pk1 int not null primary key,
 
29
b bit(9)
 
30
) engine=ndbcluster;
 
31
insert into t1 values 
 
32
(0,b'000000000'),
 
33
(1,b'000000001'),
 
34
(2,b'000000010'),
 
35
(3,b'000000011'),
 
36
(4,b'000000100');
 
37
select hex(b) from t1 order by pk1;
 
38
hex(b)
 
39
0
 
40
1
 
41
2
 
42
3
 
43
4
 
44
update t1 set b = b + b'101010101';
 
45
select hex(b) from t1 order by pk1;
 
46
hex(b)
 
47
155
 
48
156
 
49
157
 
50
158
 
51
159
 
52
drop table t1;
 
53
create table t1 (a bit(7), b bit(9)) engine = ndbcluster;
 
54
insert into t1 values 
 
55
(94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),    
 
56
(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),   
 
57
(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),    
 
58
(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),
 
59
(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),   
 
60
(44, 307), (68, 454), (57, 135);
 
61
select a+0 from t1 order by a;
 
62
a+0
 
63
0
 
64
4
 
65
5
 
66
9
 
67
23
 
68
24
 
69
28
 
70
29
 
71
30
 
72
31
 
73
34
 
74
44
 
75
49
 
76
56
 
77
57
 
78
59
 
79
60
 
80
61
 
81
68
 
82
68
 
83
75
 
84
77
 
85
78
 
86
79
 
87
87
 
88
88
 
89
94
 
90
94
 
91
104
 
92
106
 
93
108
 
94
111
 
95
116
 
96
118
 
97
119
 
98
122
 
99
123
 
100
127
 
101
select b+0 from t1 order by b;
 
102
b+0
 
103
36
 
104
42
 
105
46
 
106
67
 
107
83
 
108
118
 
109
123
 
110
133
 
111
135
 
112
152
 
113
177
 
114
178
 
115
188
 
116
202
 
117
206
 
118
245
 
119
280
 
120
307
 
121
343
 
122
345
 
123
349
 
124
351
 
125
363
 
126
368
 
127
368
 
128
379
 
129
380
 
130
390
 
131
398
 
132
399
 
133
403
 
134
411
 
135
411
 
136
438
 
137
446
 
138
454
 
139
468
 
140
499
 
141
drop table t1;
 
142
create table t1 (
 
143
dummyKey INTEGER NOT NULL,
 
144
a001 TINYINT,
 
145
a010 TINYINT,
 
146
a012 TINYINT,
 
147
a015 TINYINT,
 
148
a016 TINYINT,
 
149
a017 TINYINT,
 
150
a019 TINYINT,
 
151
a029 TINYINT,
 
152
a030 TINYINT,
 
153
a031 TINYINT,
 
154
a032 TINYINT,
 
155
a042 TINYINT,
 
156
a043 TINYINT,
 
157
a044 TINYINT,
 
158
a3001 TINYINT,
 
159
a3002 TINYINT,
 
160
a3003 TINYINT,
 
161
a3004 TINYINT,
 
162
a3005 TINYINT,
 
163
a3021 TINYINT,
 
164
a3022 TINYINT,
 
165
a BIT(6),
 
166
b BIT(6),
 
167
c BIT(6),
 
168
d TINYINT,
 
169
e TINYINT,
 
170
f TINYINT,
 
171
g TINYINT,
 
172
h TINYINT,
 
173
i TINYINT,
 
174
j TINYINT,
 
175
k TINYINT,
 
176
l TINYINT,
 
177
m TINYINT,
 
178
n TINYINT,
 
179
o TINYINT,
 
180
a034 TINYINT,
 
181
PRIMARY KEY USING HASH (dummyKey) ) engine=ndb;
 
182
INSERT INTO `t1` VALUES
 
183
(1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000001',b'111111',b'111110',4,5,5,5,5,5,5,5,5,5,3,2,1),
 
184
(2,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000010',b'000000',b'111101',4,5,5,5,5,5,5,5,5,5,3,2,1),
 
185
(3,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000100',b'001111',b'111011',4,5,5,5,5,5,5,5,5,5,3,2,1),
 
186
(4,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'001000',b'110000',b'110111',4,5,5,5,5,5,5,5,5,5,3,2,1),
 
187
(5,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'010000',b'100001',b'101111',4,5,5,5,5,5,5,5,5,5,3,2,1),
 
188
(6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'100000',b'010010',b'011111',4,5,5,5,5,5,5,5,5,5,3,2,1),
 
189
(7,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000000',b'001100',b'111111',4,5,5,5,5,5,5,5,5,5,3,2,1),
 
190
(8,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'000000',b'000000',4,5,5,5,5,5,5,5,5,5,3,2,1);
 
191
INSERT INTO `t1` VALUES (1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x01,0x3F,0x3E,4,5,5,5,5,5,5,5,5,5,3,2,1);
 
192
INSERT INTO `t1` VALUES (2,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x02,0x00,0x3D,4,5,5,5,5,5,5,5,5,5,3,2,1);
 
193
INSERT INTO `t1` VALUES (3,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x04,0x0F,0x3B,4,5,5,5,5,5,5,5,5,5,3,2,1);
 
194
INSERT INTO `t1` VALUES (4,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x08,0x30,0x37,4,5,5,5,5,5,5,5,5,5,3,2,1);
 
195
INSERT INTO `t1` VALUES (5,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x10,0x21,0x2F,4,5,5,5,5,5,5,5,5,5,3,2,1);
 
196
INSERT INTO `t1` VALUES (6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x20,0x12,0x1F,4,5,5,5,5,5,5,5,5,5,3,2,1);
 
197
INSERT INTO `t1` VALUES (7,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x00,0x0C,0x3F,4,5,5,5,5,5,5,5,5,5,3,2,1);
 
198
INSERT INTO `t1` VALUES (8,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x3F,0x00,0x00,4,5,5,5,5,5,5,5,5,5,3,2,1);
 
199
drop table t1;
 
200
create table t1 (
 
201
pk1 bit(9) not null primary key,
 
202
b int
 
203
) engine=ndbcluster;
 
204
ERROR HY000: Can't create table 'test.t1' (errno: 906)
 
205
show warnings;
 
206
Level   Code    Message
 
207
Error   1296    Got error 906 'Unsupported attribute type in index' from NDB
 
208
Error   1005    Can't create table 'test.t1' (errno: 906)
 
209
create table t1 (
 
210
pk1 int not null primary key,
 
211
b bit(9),
 
212
key(b)
 
213
) engine=ndbcluster;
 
214
ERROR HY000: Can't create table 'test.t1' (errno: 906)
 
215
show warnings;
 
216
Level   Code    Message
 
217
Error   1296    Got error 906 'Unsupported attribute type in index' from NDB
 
218
Error   1005    Can't create table 'test.t1' (errno: 906)
 
219
create table t1 (
 
220
pk1 int primary key,
 
221
b bit(32) not null
 
222
) engine=ndbcluster;
 
223
insert into t1 values (1,1);
 
224
drop table t1;