1include/master-slave.inc
2[connection master]
3CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0',
4`nom` char(4) default NULL,
5`prenom` char(4) default NULL,
6PRIMARY KEY  (`nid`))
7ENGINE=ndbcluster DEFAULT CHARSET=latin1;
8INSERT INTO t1 VALUES(1,"XYZ1","ABC1");
9select * from t1 order by nid;
10nid	nom	prenom
111	XYZ1	ABC1
12select * from t1 order by nid;
13nid	nom	prenom
141	XYZ1	ABC1
15delete from t1;
16INSERT INTO t1 VALUES(1,"XYZ2","ABC2");
17select * from t1 order by nid;
18nid	nom	prenom
191	XYZ2	ABC2
20select * from t1 order by nid;
21nid	nom	prenom
221	XYZ2	ABC2
23delete from t1;
24insert into t1 values(1,"AA", "AA");
25insert into t1 values(2,"BB", "BB");
26insert into t1 values(3,"CC", "CC");
27insert into t1 values(4,"DD", "DD");
28begin;
29delete from t1 where nid = 1;
30insert into t1 values (1,"A2", "A2");
31update t1 set nom="B2" where nid = 2;
32delete from t1 where nid = 2;
33update t1 set nom = "D2" where nid = 4;
34delete from t1 where nid = 4;
35insert into t1 values (4, "D3", "D3");
36update t1 set nom = "D4" where nid = 4;
37insert into t1 values (5, "EE", "EE");
38delete from t1 where nid = 5;
39commit;
40select * from t1 order by 1;
41nid	nom	prenom
421	A2	A2
433	CC	CC
444	D4	D3
45select * from t1 order by 1;
46nid	nom	prenom
471	A2	A2
483	CC	CC
494	D4	D3
50DROP table t1;
51CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0',
52`nom` char(4) default NULL,
53`prenom` char(4) default NULL)
54ENGINE=ndbcluster DEFAULT CHARSET=latin1;
55INSERT INTO t1 VALUES(1,"XYZ1","ABC1"),(2,"AAA","BBB"),(3,"CCC","DDD");
56select * from t1 order by nid;
57nid	nom	prenom
581	XYZ1	ABC1
592	AAA	BBB
603	CCC	DDD
61select * from t1 order by nid;
62nid	nom	prenom
631	XYZ1	ABC1
642	AAA	BBB
653	CCC	DDD
66delete from t1 where nid = 2;
67INSERT INTO t1 VALUES(4,"EEE","FFF");
68select * from t1 order by nid;
69nid	nom	prenom
701	XYZ1	ABC1
713	CCC	DDD
724	EEE	FFF
73select * from t1 order by nid;
74nid	nom	prenom
751	XYZ1	ABC1
763	CCC	DDD
774	EEE	FFF
78UPDATE t1 set nid=nid+1;
79UPDATE t1 set nom="CCP" where nid = 4;
80select * from t1 order by nid;
81nid	nom	prenom
822	XYZ1	ABC1
834	CCP	DDD
845	EEE	FFF
85select * from t1 order by nid;
86nid	nom	prenom
872	XYZ1	ABC1
884	CCP	DDD
895	EEE	FFF
90DROP table t1;
91CREATE TABLE `t1` (
92`prid` int(10) unsigned NOT NULL,
93`id_type` enum('IMSI','SIP') NOT NULL,
94`fkimssub` varchar(50) NOT NULL,
95`user_id` varchar(20) DEFAULT NULL,
96`password` varchar(20) DEFAULT NULL,
97`ptg_nbr` varchar(20) DEFAULT NULL,
98`old_tmsi` int(10) unsigned DEFAULT NULL,
99`new_tmsi` int(10) unsigned DEFAULT NULL,
100`dev_capability` int(10) unsigned DEFAULT NULL,
101`dev_oid` bigint(20) unsigned DEFAULT NULL,
102`lac_cell_id` bigint(20) unsigned DEFAULT NULL,
103`ms_classmark1` int(10) unsigned DEFAULT NULL,
104`cipher_key` int(10) unsigned DEFAULT NULL,
105`priid_master` int(10) unsigned DEFAULT NULL,
106PRIMARY KEY (`prid`),
107UNIQUE KEY `fkimssub` (`fkimssub`,`ptg_nbr`) USING HASH
108) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
109Warnings:
110Warning	1121	Ndb does not support unique index on NULL valued attributes, index access with NULL value will become full table scan
111INSERT INTO `t1` VALUES (183342,'IMSI','config3_sub_2Privates_3Publics_imssub_36668','user_id_73336','user_id_73336','73336',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(47617,'IMSI','config3_sub_2Privates_3Publics_imssub_9523','user_id_19046','user_id_19046','19046',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(200332,'IMSI','config3_sub_2Privates_3Publics_imssub_40066','user_id_80132','user_id_80132','80132',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(478882,'IMSI','config3_sub_2Privates_3Publics_imssub_95776','user_id_191552','user_id_191552','191552',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(490146,'IMSI','config3_sub_2Privates_3Publics_imssub_98029','user_id_196057','user_id_196057','196057',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(499301,'IMSI','config3_sub_2Privates_3Publics_imssub_99860','user_id_199719','user_id_199719','199719',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(506101,'IMSI','config3_sub_2Privates_3Publics_imssub_101220','user_id_202439','user_id_202439','202439',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(510142,'IMSI','config3_sub_2Privates_3Publics_imssub_102028','user_id_204056','user_id_204056','204056',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(515871,'IMSI','config3_sub_2Privates_3Publics_imssub_103174','user_id_206347','user_id_206347','206347',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(209842,'IMSI','config3_sub_2Privates_3Publics_imssub_41968','user_id_83936','user_id_83936','83936',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(365902,'IMSI','config3_sub_2Privates_3Publics_imssub_73180','user_id_146360','user_id_146360','146360',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(11892,'IMSI','config3_sub_2Privates_3Publics_imssub_2378','user_id_4756','user_id_4756','4756',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL);
112select count(*) from t1;
113count(*)
11412
115select count(*) from t1;
116count(*)
11712
118update t1 set dev_oid=dev_oid+1;
119select count(*) from t1;
120count(*)
12112
122select count(*) from t1;
123count(*)
12412
125DROP table t1;
126CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0',
127`nom` char(4) default NULL,
128`prenom` char(4) default NULL,
129PRIMARY KEY USING HASH (`nid`))
130ENGINE=ndbcluster DEFAULT CHARSET=latin1;
131INSERT INTO t1 VALUES(1,"XYZ1","ABC1");
132**** On Slave ****
133BEGIN;
134UPDATE t1 SET `nom`="LOCK" WHERE `nid`=1;
135set GLOBAL slave_transaction_retries=1;
136**** On Master ****
137UPDATE t1 SET `nom`="DEAD" WHERE `nid`=1;
138**** On Slave ****
139include/wait_for_slave_sql_error.inc [errno=1205 ]
140set GLOBAL slave_transaction_retries=10;
141include/start_slave.inc
142select * from t1 order by nid;
143nid	nom	prenom
1441	LOCK	ABC1
145COMMIT;
146select * from t1 order by nid;
147nid	nom	prenom
1481	DEAD	ABC1
149DROP TABLE t1;
150CREATE TABLE t1 (c1 INT KEY) ENGINE=NDB;
151INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
152ALTER TABLE t1 ADD c2 INT;
153Warnings:
154Warning	1478	Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
155SELECT * FROM t1 ORDER BY c1;
156c1	c2
1571	NULL
1582	NULL
1593	NULL
1604	NULL
1615	NULL
1626	NULL
1637	NULL
1648	NULL
1659	NULL
16610	NULL
167INSERT INTO t1 VALUES (11,11),(12,12),(13,13),(14,14);
168SELECT * FROM t1 ORDER BY c1;
169c1	c2
1701	NULL
1712	NULL
1723	NULL
1734	NULL
1745	NULL
1756	NULL
1767	NULL
1778	NULL
1789	NULL
17910	NULL
18011	11
18112	12
18213	13
18314	14
184ALTER TABLE t1 CHANGE c2 c2 TEXT CHARACTER SET utf8;
185ALTER TABLE t1 CHANGE c2 c2 BLOB;
186SELECT * FROM t1 ORDER BY c1 LIMIT 5;
187c1	c2
1881	NULL
1892	NULL
1903	NULL
1914	NULL
1925	NULL
193TRUNCATE t1;
194SELECT count(*) FROM t1;
195count(*)
1960
197INSERT INTO t1 VALUES (101,NULL),(102,NULL),(103,NULL),(104,NULL),(105,NULL),(106,NULL),(107,NULL),(108,NULL),(109,NULL),(1010,NULL);
198SELECT count(*) FROM t1;
199count(*)
20010
201SELECT c1 FROM t1 ORDER BY c1 LIMIT 5;
202c1
203101
204102
205103
206104
207105
208DROP TABLE t1;
209create table t1 (a int primary key,
210b00 int,b01 int,b02 int,b03 int,b04 int,b05 int,b06 int,b07 int,
211b08 int,b09 int,b10 int,b11 int,b12 int,b13 int,b14 int,b15 int,
212b16 int,b17 int,b18 int,b19 int,b20 int,b21 int,b22 int,b23 int,
213b24 int,b25 int,b26 int,b27 int,b28 int,b29 int,b30 int,b31 int,
214b32 int,b33 int,b34 int,b35 int,b36 int,b37 int,b38 int,b39 int,
215b40 int,b41 int,b42 int,b43 int,b44 int,b45 int,b46 int,b47 int,
216b48 int,b49 int,b50 int,b51 int,b52 int,b53 int,b54 int,b55 int,
217b56 int,b57 int,b58 int,b59 int,b60 int,b61 int,b62 int,b63 int,
218b64 int,b65 int,b66 int,b67 int,b68 int,b69 int,b70 int) engine=ndb;
219insert into t1 (a,b00) values (1,1);
220update t1 set b00 = 2 where a = 1;
221update t1 set b66 = 1 where a = 1;
222select b00 from t1;
223b00
2241
225select b00 from t1;
226b00
2272
228DROP TABLE t1;
229create table t1 ( c499 int, c498 int, c497 int, c496 int, c495 int, c494 int, c493 int, c492 int, c491 int, c490 int, c489 int, c488 int, c487 int, c486 int, c485 int, c484 int, c483 int, c482 int, c481 int, c480 int, c479 int, c478 int, c477 int, c476 int, c475 int, c474 int, c473 int, c472 int, c471 int, c470 int, c469 int, c468 int, c467 int, c466 int, c465 int, c464 int, c463 int, c462 int, c461 int, c460 int, c459 int, c458 int, c457 int, c456 int, c455 int, c454 int, c453 int, c452 int, c451 int, c450 int, c449 int, c448 int, c447 int, c446 int, c445 int, c444 int, c443 int, c442 int, c441 int, c440 int, c439 int, c438 int, c437 int, c436 int, c435 int, c434 int, c433 int, c432 int, c431 int, c430 int, c429 int, c428 int, c427 int, c426 int, c425 int, c424 int, c423 int, c422 int, c421 int, c420 int, c419 int, c418 int, c417 int, c416 int, c415 int, c414 int, c413 int, c412 int, c411 int, c410 int, c409 int, c408 int, c407 int, c406 int, c405 int, c404 int, c403 int, c402 int, c401 int, c400 int, c399 int, c398 int, c397 int, c396 int, c395 int, c394 int, c393 int, c392 int, c391 int, c390 int, c389 int, c388 int, c387 int, c386 int, c385 int, c384 int, c383 int, c382 int, c381 int, c380 int, c379 int, c378 int, c377 int, c376 int, c375 int, c374 int, c373 int, c372 int, c371 int, c370 int, c369 int, c368 int, c367 int, c366 int, c365 int, c364 int, c363 int, c362 int, c361 int, c360 int, c359 int, c358 int, c357 int, c356 int, c355 int, c354 int, c353 int, c352 int, c351 int, c350 int, c349 int, c348 int, c347 int, c346 int, c345 int, c344 int, c343 int, c342 int, c341 int, c340 int, c339 int, c338 int, c337 int, c336 int, c335 int, c334 int, c333 int, c332 int, c331 int, c330 int, c329 int, c328 int, c327 int, c326 int, c325 int, c324 int, c323 int, c322 int, c321 int, c320 int, c319 int, c318 int, c317 int, c316 int, c315 int, c314 int, c313 int, c312 int, c311 int, c310 int, c309 int, c308 int, c307 int, c306 int, c305 int, c304 int, c303 int, c302 int, c301 int, c300 int, c299 int, c298 int, c297 int, c296 int, c295 int, c294 int, c293 int, c292 int, c291 int, c290 int, c289 int, c288 int, c287 int, c286 int, c285 int, c284 int, c283 int, c282 int, c281 int, c280 int, c279 int, c278 int, c277 int, c276 int, c275 int, c274 int, c273 int, c272 int, c271 int, c270 int, c269 int, c268 int, c267 int, c266 int, c265 int, c264 int, c263 int, c262 int, c261 int, c260 int, c259 int, c258 int, c257 int, c256 int, c255 int, c254 int, c253 int, c252 int, c251 int, c250 int, c249 int, c248 int, c247 int, c246 int, c245 int, c244 int, c243 int, c242 int, c241 int, c240 int, c239 int, c238 int, c237 int, c236 int, c235 int, c234 int, c233 int, c232 int, c231 int, c230 int, c229 int, c228 int, c227 int, c226 int, c225 int, c224 int, c223 int, c222 int, c221 int, c220 int, c219 int, c218 int, c217 int, c216 int, c215 int, c214 int, c213 int, c212 int, c211 int, c210 int, c209 int, c208 int, c207 int, c206 int, c205 int, c204 int, c203 int, c202 int, c201 int, c200 int, c199 int, c198 int, c197 int, c196 int, c195 int, c194 int, c193 int, c192 int, c191 int, c190 int, c189 int, c188 int, c187 int, c186 int, c185 int, c184 int, c183 int, c182 int, c181 int, c180 int, c179 int, c178 int, c177 int, c176 int, c175 int, c174 int, c173 int, c172 int, c171 int, c170 int, c169 int, c168 int, c167 int, c166 int, c165 int, c164 int, c163 int, c162 int, c161 int, c160 int, c159 int, c158 int, c157 int, c156 int, c155 int, c154 int, c153 int, c152 int, c151 int, c150 int, c149 int, c148 int, c147 int, c146 int, c145 int, c144 int, c143 int, c142 int, c141 int, c140 int, c139 int, c138 int, c137 int, c136 int, c135 int, c134 int, c133 int, c132 int, c131 int, c130 int, c129 int, c128 int, c127 int, c126 int, c125 int, c124 int, c123 int, c122 int, c121 int, c120 int, c119 int, c118 int, c117 int, c116 int, c115 int, c114 int, c113 int, c112 int, c111 int, c110 int, c109 int, c108 int, c107 int, c106 int, c105 int, c104 int, c103 int, c102 int, c101 int, c100 int, c99 int, c98 int, c97 int, c96 int, c95 int, c94 int, c93 int, c92 int, c91 int, c90 int, c89 int, c88 int, c87 int, c86 int, c85 int, c84 int, c83 int, c82 int, c81 int, c80 int, c79 int, c78 int, c77 int, c76 int, c75 int, c74 int, c73 int, c72 int, c71 int, c70 int, c69 int, c68 int, c67 int, c66 int, c65 int, c64 int, c63 int, c62 int, c61 int, c60 int, c59 int, c58 int, c57 int, c56 int, c55 int, c54 int, c53 int, c52 int, c51 int, c50 int, c49 int, c48 int, c47 int, c46 int, c45 int, c44 int, c43 int, c42 int, c41 int, c40 int, c39 int, c38 int, c37 int, c36 int, c35 int, c34 int, c33 int, c32 int, c31 int, c30 int, c29 int, c28 int, c27 int, c26 int, c25 int, c24 int, c23 int, c22 int, c21 int, c20 int, c19 int, c18 int, c17 int, c16 int, c15 int, c14 int, c13 int, c12 int, c11 int, c10 int, c9 int, c8 int, c7 int, c6 int, c5 int, c4 int, c3 int, c2 int, c1 int, c500 varchar(10000), primary key using hash(c1)) engine=ndb partition by key(c1);
230set @v10 = '0123456789';
231set @v100 = concat(@v10,@v10,@v10,@v10,@v10,@v10,@v10,@v10,@v10,@v10);
232set @v1000 =concat(@v100,@v100,@v100,@v100,@v100,@v100,@v100,@v100,@v100,@v100);
233set @v10000 = concat(@v1000,@v1000,@v1000,@v1000,@v1000,@v1000,@v1000,@v1000,@v1000,@v1000);
234set @v13000 = concat(@v10000, @v1000,@v1000,@v1000);
235insert into t1 (c1,c500) values (1,@v10000), (2,@v10000), (3,@v10000);
236alter offline table t1 modify c1 int auto_increment;
237alter online table t1 add column c501 bit(1) column_format DYNAMIC;
238alter online table t1 add column c502 varchar(2000);
239ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 14000. You have to change some columns to TEXT or BLOBs
240select length(c500) from t1 order by 1;
241length(c500)
24210000
24310000
24410000
245delete from t1;
246drop table t1;
247create table t1 (a int primary key, b varchar(13000)) engine = ndb;
248insert into t1 values (1,@v13000), (2,@v13000);
249select length(b) from t1 order by 1;
250length(b)
25113000
25213000
253drop table t1;
254include/rpl_end.inc
255