1select count(*) from information_schema.columns; 2count(*) 3# 4CREATE LOGFILE GROUP lg1 5ADD UNDOFILE 'undofile.dat' 6INITIAL_SIZE 16M 7UNDO_BUFFER_SIZE = 1M 8ENGINE=MYISAM; 9ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP' 10ALTER LOGFILE GROUP lg1 11ADD UNDOFILE 'undofile02.dat' 12INITIAL_SIZE = 4M 13ENGINE=XYZ; 14ERROR 42000: Unknown storage engine 'XYZ' 15CREATE TABLESPACE ts1 16ADD DATAFILE 'datafile.dat' 17USE LOGFILE GROUP lg1 18INITIAL_SIZE 12M; 19ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP' 20CREATE LOGFILE GROUP lg1 21ADD UNDOFILE 'undofile.dat' 22INITIAL_SIZE 5K 23UNDO_BUFFER_SIZE = 1M 24ENGINE=NDB; 25ERROR HY000: Failed to create UNDOFILE 26set default_storage_engine=ndb; 27CREATE LOGFILE GROUP lg1 28ADD UNDOFILE 'undofile.dat' 29INITIAL_SIZE 16M 30UNDO_BUFFER_SIZE = 1M; 31ALTER LOGFILE GROUP lg1 32ADD UNDOFILE 'undofile02.dat' 33INITIAL_SIZE = 4M 34ENGINE=NDB; 35set default_storage_engine=myisam; 36CREATE TABLESPACE ts1 37ADD DATAFILE 'datafile.dat' 38USE LOGFILE GROUP lg1 39INITIAL_SIZE 12M 40ENGINE NDB; 41ALTER TABLESPACE ts1 42ADD DATAFILE 'datafile02.dat' 43INITIAL_SIZE = 4M 44ENGINE=NDB; 45CREATE TABLE t1 46(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL) 47TABLESPACE ts1 STORAGE DISK 48ENGINE=NDB 49PARTITION BY KEY() PARTITIONS 8; 50SHOW CREATE TABLE t1; 51Table Create Table 52t1 CREATE TABLE `t1` ( 53 `pk1` int(11) NOT NULL, 54 `b` int(11) NOT NULL, 55 `c` int(11) NOT NULL, 56 PRIMARY KEY (`pk1`) 57) /*!50100 TABLESPACE `ts1` STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 58/*!50100 PARTITION BY KEY () 59PARTITIONS 8 */ 60INSERT INTO t1 VALUES (0, 0, 0); 61SELECT * FROM t1; 62pk1 b c 630 0 0 64INSERT INTO t1 VALUES 65(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), 66(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10), 67(11,11,11),(12,12,12),(13,13,13),(14,14,14),(15,15,15), 68(16,16,16),(17,17,17),(18,18,18),(19,19,19),(20,20,20), 69(21,21,21),(22,22,22),(23,23,23),(24,24,24),(25,25,25), 70(26,26,26),(27,27,27),(28,28,28),(29,29,29),(30,30,30), 71(31,31,31),(32,32,32),(33,33,33),(34,34,34),(35,35,35), 72(36,36,36),(37,37,37),(38,38,38),(39,39,39),(40,40,40), 73(41,41,41),(42,42,42),(43,43,43),(44,44,44),(45,45,45), 74(46,46,46),(47,47,47),(48,48,48),(49,49,49),(50,50,50), 75(51,51,51),(52,52,52),(53,53,53),(54,54,54),(55,55,55), 76(56,56,56),(57,57,57),(58,58,58),(59,59,59),(60,60,60), 77(61,61,61),(62,62,62),(63,63,63),(64,64,64),(65,65,65), 78(66,66,66),(67,67,67),(68,68,68),(69,69,69),(70,70,70), 79(71,71,71),(72,72,72),(73,73,73),(74,74,74),(75,75,75), 80(76,76,76),(77,77,77),(78,78,78),(79,79,79),(80,80,80), 81(81,81,81),(82,82,82),(83,83,83),(84,84,84),(85,85,85), 82(86,86,86),(87,87,87),(88,88,88),(89,89,89),(90,90,90), 83(91,91,91),(92,92,92),(93,93,93),(94,94,94),(95,95,95), 84(96,96,96),(97,97,97),(98,98,98),(99,99,99),(100,100,100), 85(101,101,101),(102,102,102),(103,103,103),(104,104,104),(105,105,105), 86(106,106,106),(107,107,107),(108,108,108),(109,109,109),(110,110,110), 87(111,111,111),(112,112,112),(113,113,113),(114,114,114),(115,115,115), 88(116,116,116),(117,117,117),(118,118,118),(119,119,119),(120,120,120), 89(121,121,121),(122,122,122),(123,123,123),(124,124,124),(125,125,125), 90(126,126,126),(127,127,127),(128,128,128),(129,129,129),(130,130,130), 91(131,131,131),(132,132,132),(133,133,133),(134,134,134),(135,135,135), 92(136,136,136),(137,137,137),(138,138,138),(139,139,139),(140,140,140), 93(141,141,141),(142,142,142),(143,143,143),(144,144,144),(145,145,145), 94(146,146,146),(147,147,147),(148,148,148),(149,149,149),(150,150,150), 95(151,151,151),(152,152,152),(153,153,153),(154,154,154),(155,155,155), 96(156,156,156),(157,157,157),(158,158,158),(159,159,159),(160,160,160), 97(161,161,161),(162,162,162),(163,163,163),(164,164,164),(165,165,165), 98(166,166,166),(167,167,167),(168,168,168),(169,169,169),(170,170,170), 99(171,171,171),(172,172,172),(173,173,173),(174,174,174),(175,175,175), 100(176,176,176),(177,177,177),(178,178,178),(179,179,179),(180,180,180), 101(181,181,181),(182,182,182),(183,183,183),(184,184,184),(185,185,185), 102(186,186,186),(187,187,187),(188,188,188),(189,189,189),(190,190,190), 103(191,191,191),(192,192,192),(193,193,193),(194,194,194),(195,195,195), 104(196,196,196),(197,197,197),(198,198,198),(199,199,199),(200,200,200), 105(201,201,201),(202,202,202),(203,203,203),(204,204,204),(205,205,205), 106(206,206,206),(207,207,207),(208,208,208),(209,209,209),(210,210,210), 107(211,211,211),(212,212,212),(213,213,213),(214,214,214),(215,215,215), 108(216,216,216),(217,217,217),(218,218,218),(219,219,219),(220,220,220), 109(221,221,221),(222,222,222),(223,223,223),(224,224,224),(225,225,225), 110(226,226,226),(227,227,227),(228,228,228),(229,229,229),(230,230,230), 111(231,231,231),(232,232,232),(233,233,233),(234,234,234),(235,235,235), 112(236,236,236),(237,237,237),(238,238,238),(239,239,239),(240,240,240), 113(241,241,241),(242,242,242),(243,243,243),(244,244,244),(245,245,245), 114(246,246,246),(247,247,247),(248,248,248),(249,249,249),(250,250,250), 115(251,251,251),(252,252,252),(253,253,253),(254,254,254),(255,255,255), 116(256,256,256),(257,257,257),(258,258,258),(259,259,259),(260,260,260), 117(261,261,261),(262,262,262),(263,263,263),(264,264,264),(265,265,265), 118(266,266,266),(267,267,267),(268,268,268),(269,269,269),(270,270,270), 119(271,271,271),(272,272,272),(273,273,273),(274,274,274),(275,275,275), 120(276,276,276),(277,277,277),(278,278,278),(279,279,279),(280,280,280), 121(281,281,281),(282,282,282),(283,283,283),(284,284,284),(285,285,285), 122(286,286,286),(287,287,287),(288,288,288),(289,289,289),(290,290,290), 123(291,291,291),(292,292,292),(293,293,293),(294,294,294),(295,295,295), 124(296,296,296),(297,297,297),(298,298,298),(299,299,299),(300,300,300), 125(301,301,301),(302,302,302),(303,303,303),(304,304,304),(305,305,305), 126(306,306,306),(307,307,307),(308,308,308),(309,309,309),(310,310,310), 127(311,311,311),(312,312,312),(313,313,313),(314,314,314),(315,315,315), 128(316,316,316),(317,317,317),(318,318,318),(319,319,319),(320,320,320), 129(321,321,321),(322,322,322),(323,323,323),(324,324,324),(325,325,325), 130(326,326,326),(327,327,327),(328,328,328),(329,329,329),(330,330,330), 131(331,331,331),(332,332,332),(333,333,333),(334,334,334),(335,335,335), 132(336,336,336),(337,337,337),(338,338,338),(339,339,339),(340,340,340), 133(341,341,341),(342,342,342),(343,343,343),(344,344,344),(345,345,345), 134(346,346,346),(347,347,347),(348,348,348),(349,349,349),(350,350,350), 135(351,351,351),(352,352,352),(353,353,353),(354,354,354),(355,355,355), 136(356,356,356),(357,357,357),(358,358,358),(359,359,359),(360,360,360), 137(361,361,361),(362,362,362),(363,363,363),(364,364,364),(365,365,365), 138(366,366,366),(367,367,367),(368,368,368),(369,369,369),(370,370,370), 139(371,371,371),(372,372,372),(373,373,373),(374,374,374),(375,375,375), 140(376,376,376),(377,377,377),(378,378,378),(379,379,379),(380,380,380), 141(381,381,381),(382,382,382),(383,383,383),(384,384,384),(385,385,385), 142(386,386,386),(387,387,387),(388,388,388),(389,389,389),(390,390,390), 143(391,391,391),(392,392,392),(393,393,393),(394,394,394),(395,395,395), 144(396,396,396),(397,397,397),(398,398,398),(399,399,399),(400,400,400), 145(401,401,401),(402,402,402),(403,403,403),(404,404,404),(405,405,405), 146(406,406,406),(407,407,407),(408,408,408),(409,409,409),(410,410,410), 147(411,411,411),(412,412,412),(413,413,413),(414,414,414),(415,415,415), 148(416,416,416),(417,417,417),(418,418,418),(419,419,419),(420,420,420), 149(421,421,421),(422,422,422),(423,423,423),(424,424,424),(425,425,425), 150(426,426,426),(427,427,427),(428,428,428),(429,429,429),(430,430,430), 151(431,431,431),(432,432,432),(433,433,433),(434,434,434),(435,435,435), 152(436,436,436),(437,437,437),(438,438,438),(439,439,439),(440,440,440), 153(441,441,441),(442,442,442),(443,443,443),(444,444,444),(445,445,445), 154(446,446,446),(447,447,447),(448,448,448),(449,449,449),(450,450,450), 155(451,451,451),(452,452,452),(453,453,453),(454,454,454),(455,455,455), 156(456,456,456),(457,457,457),(458,458,458),(459,459,459),(460,460,460), 157(461,461,461),(462,462,462),(463,463,463),(464,464,464),(465,465,465), 158(466,466,466),(467,467,467),(468,468,468),(469,469,469),(470,470,470), 159(471,471,471),(472,472,472),(473,473,473),(474,474,474),(475,475,475), 160(476,476,476),(477,477,477),(478,478,478),(479,479,479),(480,480,480), 161(481,481,481),(482,482,482),(483,483,483),(484,484,484),(485,485,485), 162(486,486,486),(487,487,487),(488,488,488),(489,489,489),(490,490,490), 163(491,491,491),(492,492,492),(493,493,493),(494,494,494),(495,495,495), 164(496,496,496),(497,497,497),(498,498,498),(499,499,499),(500, 500, 500); 165SELECT COUNT(*) FROM t1; 166COUNT(*) 167501 168SELECT table_name, 169SUM(table_rows), 170SUM(data_length), 171MAX(max_data_length), 172SUM(data_free) 173FROM INFORMATION_SCHEMA.partitions 174WHERE table_name='t1' 175GROUP BY table_name; 176table_name SUM(table_rows) SUM(data_length) MAX(max_data_length) SUM(data_free) 177t1 501 262144 1048576 8345820 178SELECT table_name, table_rows, data_length, max_data_length, data_free 179FROM information_schema.tables 180WHERE table_name='t1'; 181table_name table_rows data_length max_data_length data_free 182t1 501 262144 8388608 8345820 183CREATE LOGFILE GROUP lg2 184ADD UNDOFILE 'x.dat' 185INITIAL_SIZE 10y 186ENGINE = NDB; 187ERROR HY000: A size parameter was incorrectly specified, either number or on the form 10M 188CREATE LOGFILE GROUP lg2 189ADD UNDOFILE 'x.dat' 190INITIAL_SIZE 10MB 191ENGINE = NDB; 192ERROR HY000: A size parameter was incorrectly specified, either number or on the form 10M 193CREATE LOGFILE GROUP lg2 194ADD UNDOFILE 'x.dat' 195INITIAL_SIZE 10 MB 196ENGINE = NDB; 197ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MB 198ENGINE = NDB' at line 3 199CREATE LOGFILE GROUP lg2 200ADD UNDOFILE 'x.dat' 201INITIAL_SIZE 10 M 202ENGINE = NDB; 203ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'M 204ENGINE = NDB' at line 3 205CREATE LOGFILE GROUP lg2 206ADD UNDOFILE 'x.dat' 207INITIAL_SIZE 1000000000000K 208ENGINE = NDB; 209ERROR HY000: The size number was correct but we don't allow the digit part to be more than 2 billion 210DROP TABLE t1; 211create tablespace ts2 212add datafile 'datafile2_1.dat' 213use logfile group lg1 214initial_size 12M 215engine ndb; 216CREATE TABLE City ( 217ID int(11) NOT NULL AUTO_INCREMENT, 218Name char(35) NOT NULL, 219CountryCode char(3) NOT NULL, 220District char(20) NOT NULL, 221Population int(11) NOT NULL, 222PRIMARY KEY (ID) 223) ENGINE=ndbcluster 224tablespace ts2 225storage disk; 226create table t1 (a int primary key, b int) 227engine = ndbcluster tablespace ts2 storage disk; 228insert into t1 values (1,1); 229alter tablespace ts2 230drop datafile 'datafile2_1.dat' 231engine ndb; 232ERROR HY000: Failed to alter: DROP DATAFILE 233drop table t1; 234alter tablespace ts2 235drop datafile 'datafile2_1.dat' 236engine ndb; 237insert 238into City (Name,CountryCode,District,Population) 239values ('BeiJing','CN','Beijing',2000); 240ERROR HY000: Got error 1602 'No datafile in tablespace' from NDBCLUSTER 241drop tablespace ts2 242engine ndb; 243ERROR HY000: Failed to drop TABLESPACE 244drop table City; 245drop tablespace ts2 246engine ndb; 247CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE = NDB; 248INSERT INTO t1 VALUES (1,'1','1'), (2,'2','2'), (3,'3','3'); 249BEGIN; 250UPDATE t1 SET b = '2' WHERE a = 1; 251SELECT b FROM t1 WHERE a = 1; 252b 2532 254SELECT * FROM t1 WHERE a = 1; 255a b c 2561 2 1 257UPDATE t1 SET c = '2' WHERE a = 1; 258SELECT b FROM t1 WHERE a = 1; 259b 2602 261SELECT * FROM t1 WHERE a = 1; 262a b c 2631 2 2 264UPDATE t1 SET b = '3' WHERE a = 1; 265SELECT b FROM t1 WHERE a = 1; 266b 2673 268SELECT * FROM t1 WHERE a = 1; 269a b c 2701 3 2 271COMMIT; 272SELECT * FROM t1 ORDER BY 1; 273a b c 2741 3 2 2752 2 2 2763 3 3 277BEGIN; 278UPDATE t1 SET c = '3' WHERE a = 1; 279SELECT b FROM t1 WHERE a = 1; 280b 2813 282SELECT * FROM t1 WHERE a = 1; 283a b c 2841 3 3 285UPDATE t1 SET b = '4' WHERE a = 1; 286SELECT b FROM t1 WHERE a = 1; 287b 2884 289SELECT * FROM t1 WHERE a = 1; 290a b c 2911 4 3 292UPDATE t1 SET c = '4' WHERE a = 1; 293SELECT b FROM t1 WHERE a = 1; 294b 2954 296SELECT * FROM t1 WHERE a = 1; 297a b c 2981 4 4 299COMMIT; 300SELECT * FROM t1 ORDER BY 1; 301a b c 3021 4 4 3032 2 2 3043 3 3 305UPDATE t1 SET b = '5' WHERE a = 1; 306SELECT * FROM t1 ORDER BY 1; 307a b c 3081 5 4 3092 2 2 3103 3 3 311UPDATE t1 SET b = '6' WHERE b = '5'; 312SELECT * FROM t1 ORDER BY 1; 313a b c 3141 6 4 3152 2 2 3163 3 3 317UPDATE t1 SET b = '7'WHERE c = '4'; 318SELECT * FROM t1 ORDER BY 1; 319a b c 3201 7 4 3212 2 2 3223 3 3 323UPDATE t1 SET c = '5' WHERE a = 1; 324SELECT * FROM t1 ORDER BY 1; 325a b c 3261 7 5 3272 2 2 3283 3 3 329UPDATE t1 SET c = '6' WHERE b = '7'; 330SELECT * FROM t1 ORDER BY 1; 331a b c 3321 7 6 3332 2 2 3343 3 3 335UPDATE t1 SET c = '7' WHERE c = '6'; 336SELECT * FROM t1 ORDER BY 1; 337a b c 3381 7 7 3392 2 2 3403 3 3 341DROP TABLE t1; 342CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE NDB; 343INSERT INTO t1 VALUE (1,'1','1'), (2,'2','2'), (3,'3','3'); 344BEGIN; 345UPDATE t1 SET b = '2' WHERE a = 1; 346SELECT b FROM t1 WHERE a = 1; 347b 3482 349SELECT * FROM t1 WHERE a = 1; 350a b c 3511 2 1 352UPDATE t1 SET c = '2' WHERE a = 1; 353SELECT b FROM t1 WHERE a = 1; 354b 3552 356SELECT * FROM t1 WHERE a = 1; 357a b c 3581 2 2 359UPDATE t1 SET b = '3' WHERE a = 1; 360SELECT b FROM t1 WHERE a = 1; 361b 3623 363SELECT * FROM t1 WHERE a = 1; 364a b c 3651 3 2 366COMMIT; 367SELECT * FROM t1 ORDER BY 1; 368a b c 3691 3 2 3702 2 2 3713 3 3 372BEGIN; 373UPDATE t1 SET c = '3' WHERE a = 1; 374SELECT b FROM t1 WHERE a = 1; 375b 3763 377SELECT * FROM t1 WHERE a = 1; 378a b c 3791 3 3 380UPDATE t1 SET b = '4' WHERE a = 1; 381SELECT b FROM t1 WHERE a = 1; 382b 3834 384SELECT * FROM t1 WHERE a = 1; 385a b c 3861 4 3 387UPDATE t1 SET c = '4' WHERE a = 1; 388SELECT b FROM t1 WHERE a = 1; 389b 3904 391SELECT * FROM t1 WHERE a = 1; 392a b c 3931 4 4 394COMMIT; 395SELECT * FROM t1 ORDER BY 1; 396a b c 3971 4 4 3982 2 2 3993 3 3 400UPDATE t1 SET b = '5' WHERE a = 1; 401SELECT * FROM t1 ORDER BY 1; 402a b c 4031 5 4 4042 2 2 4053 3 3 406UPDATE t1 SET b = '6' WHERE b = '5'; 407SELECT * FROM t1 ORDER BY 1; 408a b c 4091 6 4 4102 2 2 4113 3 3 412UPDATE t1 SET b = '7' WHERE c = '4'; 413SELECT * FROM t1 ORDER BY 1; 414a b c 4151 7 4 4162 2 2 4173 3 3 418UPDATE t1 SET c = '5' WHERE a = 1; 419SELECT * FROM t1 ORDER BY 1; 420a b c 4211 7 5 4222 2 2 4233 3 3 424UPDATE t1 SET c = '6' WHERE b = '7'; 425SELECT * FROM t1 ORDER BY 1; 426a b c 4271 7 6 4282 2 2 4293 3 3 430UPDATE t1 SET c = '7' WHERE c = '6'; 431SELECT * FROM t1 ORDER BY 1; 432a b c 4331 7 7 4342 2 2 4353 3 3 436DELETE FROM t1; 437INSERT INTO t1 VALUES (3,'1','1'); 438BEGIN; 439UPDATE t1 SET b = b + 2 WHERE A = 3; 440DELETE FROM t1 WHERE A = 3; 441INSERT INTO t1 VALUES (3,'0','0'); 442COMMIT; 443SELECT * from t1 ORDER BY 1; 444a b c 4453 0 0 446DROP TABLE t1; 447CREATE TABLE t1 ( 448a INT NOT NULL PRIMARY KEY, 449b TEXT NOT NULL 450) TABLESPACE ts1 STORAGE DISK ENGINE=NDBCLUSTER; 451set @x0 = '01234567012345670123456701234567'; 452set @x0 = concat(@x0,@x0,@x0,@x0,@x0,@x0,@x0,@x0); 453set @b1 = 'b1'; 454set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1); 455set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1); 456set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1); 457set @b1 = concat(@b1,@x0); 458set @b2 = 'b2'; 459set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); 460set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); 461set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); 462set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); 463INSERT INTO t1 VALUES(1,@b1); 464INSERT INTO t1 VALUES(2,@b2); 465SELECT a,length(b),substr(b,1+2*900,2) FROM t1 WHERE a=1; 466a length(b) substr(b,1+2*900,2) 4671 2256 b1 468SELECT a,length(b),substr(b,1+2*9000,2) FROM t1 WHERE a=2; 469a length(b) substr(b,1+2*9000,2) 4702 20000 b2 471UPDATE t1 SET b=@b2 WHERE a=1; 472UPDATE t1 SET b=@b1 WHERE a=2; 473SELECT a,length(b),substr(b,1+2*9000,2) FROM t1 WHERE a=1; 474a length(b) substr(b,1+2*9000,2) 4751 20000 b2 476SELECT a,length(b),substr(b,1+2*900,2) FROM t1 WHERE a=2; 477a length(b) substr(b,1+2*900,2) 4782 2256 b1 479UPDATE t1 SET b=concat(b,b) WHERE a=1; 480UPDATE t1 SET b=concat(b,b) WHERE a=2; 481SELECT a,length(b),substr(b,1+4*9000,2) FROM t1 WHERE a=1; 482a length(b) substr(b,1+4*9000,2) 4831 40000 b2 484SELECT a,length(b),substr(b,1+4*900,2) FROM t1 WHERE a=2; 485a length(b) substr(b,1+4*900,2) 4862 4512 b1 487DELETE FROM t1 WHERE a=1; 488DELETE FROM t1 WHERE a=2; 489SELECT COUNT(*) FROM t1; 490COUNT(*) 4910 492DROP TABLE t1; 493CREATE TABLE t1 ( 494a int NOT NULL, 495b varchar(4000), -- must use 2 pages undo 496PRIMARY KEY using hash (a) 497) 498TABLESPACE ts1 STORAGE DISK ENGINE=NDBCLUSTER; 499set autocommit = 0; 500insert into t1 values(0,'x'); 501insert into t1 values(1,'x'); 502insert into t1 values(2,'x'); 503insert into t1 values(3,'x'); 504insert into t1 values(4,'x'); 505insert into t1 values(5,'x'); 506insert into t1 values(6,'x'); 507insert into t1 values(7,'x'); 508insert into t1 values(8,'x'); 509delete from t1 where a = 0; 510commit; 511delete from t1; 512begin; 513insert into t1 values (1, 'x'); 514select * from t1; 515a b 5161 x 517rollback; 518set autocommit = 1; 519drop table t1; 520create table test.t1 (f1 varchar(50) primary key, f2 text,f3 int) 521TABLESPACE ts1 STORAGE DISK engine=NDB; 522insert into test.t1 (f1,f2,f3)VALUES("111111","aaaaaa",1); 523insert into test.t1 (f1,f2,f3)VALUES("222222","bbbbbb",2); 524select * from test.t1 order by f1; 525f1 f2 f3 526111111 aaaaaa 1 527222222 bbbbbb 2 528select f1,f2 from test.t1 order by f2; 529f1 f2 530111111 aaaaaa 531222222 bbbbbb 532select f2 from test.t1 order by f2; 533f2 534aaaaaa 535bbbbbb 536select f1,f2 from test.t1 order by f1; 537f1 f2 538111111 aaaaaa 539222222 bbbbbb 540drop table test.t1; 541CREATE TABLE t1 ( 542id int unsigned NOT NULL, 543c1 int unsigned NOT NULL, 544c2 int DEFAULT NULL, 545PRIMARY KEY using hash (id), 546UNIQUE KEY c1 using hash (c1)) 547TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster; 548insert into t1 values(1, 1, 3); 549insert into t1 values(2, 2, 3); 550update t1 set c1 = 1 where id = 2; 551ERROR 23000: Can't write; duplicate key in table '' 552drop table t1; 553ALTER TABLESPACE ts1 554DROP DATAFILE 'datafile.dat' 555ENGINE = NDB; 556ALTER TABLESPACE ts1 557DROP DATAFILE 'datafile02.dat' 558ENGINE = NDB; 559DROP TABLESPACE ts1 560ENGINE = NDB; 561DROP LOGFILE GROUP lg1 562ENGINE =NDB; 563=== bug#31712 === 564create logfile group lg1 565add undofile 'undofile.dat' 566initial_size 2M 567undo_buffer_size 1M 568engine ndb; 569create tablespace ts1 570add datafile 'datafile.dat' 571use logfile group lg1 572initial_size 1M 573extent_size 2M 574engine ndb; 575ERROR HY000: Failed to create DATAFILE 576show warnings; 577Level Code Message 578Warning 1296 Got error 1516 'File too small' from NDB 579Error 1528 Failed to create DATAFILE 580create tablespace ts1 581add datafile 'datafile.dat' 582use logfile group lg1 583initial_size 2M 584extent_size 2M 585engine ndb; 586alter tablespace ts1 587add datafile 'datafile02.dat' 588initial_size 1M 589engine ndb; 590ERROR HY000: Failed to alter: CREATE DATAFILE 591show warnings; 592Level Code Message 593Warning 1296 Got error 1516 'File too small' from NDB 594Error 1533 Failed to alter: CREATE DATAFILE 595alter tablespace ts1 596drop datafile 'datafile.dat' 597engine ndb; 598drop tablespace ts1 599engine ndb; 600drop logfile group lg1 601engine ndb; 602=== bug#31782 === 603create logfile group lg1 604add undofile 'undofile.dat' 605initial_size 2M 606undo_buffer_size 1M 607engine ndb; 608create tablespace ts1 609add datafile 'datafile.dat' 610use logfile group lg1 611initial_size 2M 612extent_size 2M 613engine ndb; 614select distinct tablespace_name, file_type, file_name 615from information_schema.files 616where engine = 'ndbcluster' and tablespace_name is not null 617order by file_type, file_name; 618tablespace_name file_type file_name 619ts1 DATAFILE datafile.dat 620ts1 TABLESPACE NULL 621alter tablespace ts1 622drop datafile 'datafile.dat' 623engine ndb; 624select distinct tablespace_name, file_type, file_name 625from information_schema.files 626where engine = 'ndbcluster' and tablespace_name is not null 627order by file_type, file_name; 628tablespace_name file_type file_name 629ts1 TABLESPACE NULL 630drop tablespace ts1 631engine ndb; 632drop logfile group lg1 633engine ndb; 634=== bug#49709 === 635create logfile group lg1 636add undofile 'undofile.dat' 637initial_size 3276801 638undo_buffer_size 294913 639engine ndb; 640Warnings: 641Warning 1 Undo buffer size rounded up to kernel page size 642Warning 2 Undofile size rounded down to kernel page size 643alter logfile group lg1 644add undofile 'undofile02.dat' 645initial_size 3309567 646engine ndb; 647Warnings: 648Warning 2 Undofile size rounded down to kernel page size 649create tablespace ts1 650add datafile 'datafile.dat' 651use logfile group lg1 652initial_size 3276801 653extent_size 294913 654engine ndb; 655Warnings: 656Warning 4 Extent size rounded up to kernel page size 657Warning 8 Datafile size rounded down to extent size 658alter tablespace ts1 659add datafile 'datafile02.dat' 660initial_size 3342335 661engine ndb; 662Warnings: 663Warning 24 Datafile size rounded up to extent size 664select logfile_group_name, extra 665from information_schema.files 666where file_type = 'UNDO LOG' and file_name is null; 667logfile_group_name extra 668lg1 UNDO_BUFFER_SIZE=327680 669select distinct file_name, initial_size 670from information_schema.files 671where file_type = 'UNDO LOG' and file_name is not null 672order by file_name; 673file_name initial_size 674undofile.dat 3276800 675undofile02.dat 3276800 676select tablespace_name, logfile_group_name, extent_size 677from information_schema.files 678where engine = 'ndbcluster' and file_type = 'TABLESPACE'; 679tablespace_name logfile_group_name extent_size 680ts1 lg1 327680 681select distinct file_name, initial_size, extent_size, total_extents, free_extents 682from information_schema.files 683where file_type = 'DATAFILE' 684order by file_name; 685file_name initial_size extent_size total_extents free_extents 686datafile.dat 3276800 327680 10 10 687datafile02.dat 3604480 327680 11 11 688alter tablespace ts1 689drop datafile 'datafile02.dat' 690engine ndb; 691alter tablespace ts1 692drop datafile 'datafile.dat' 693engine ndb; 694drop tablespace ts1 695engine ndb; 696drop logfile group lg1 697engine ndb; 698set character_set_client=utf8; 699create logfile group lg1 700add undofile 'undo1.log' 701undo_buffer_size 2M 702engine=ndb; 703drop logfile group lg1 704engine ndb; 705CREATE LOGFILE GROUP lg1 706ADD UNDOFILE 'undofile.dat' 707INITIAL_SIZE 16M 708UNDO_BUFFER_SIZE = 128M 709ENGINE=NDB; 710ERROR HY000: Failed to create LOGFILE GROUP 711SHOW WARNINGS; 712Level Code Message 713Warning 1296 Got error 1504 'Out of logbuffer memory(specify smaller undo_buffer_size or increase SharedGlobalMemory)' from NDB 714Error 1528 Failed to create LOGFILE GROUP 715