summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authormonty@mysql.com <>2004-07-07 11:29:39 +0300
committermonty@mysql.com <>2004-07-07 11:29:39 +0300
commit1e311999950833cd81ca0788cd3656585c46d9ae (patch)
treeca8974710746bb69b04a49bc64f938d0b1a8420a /mysql-test/t
parent24a8dc2337a717ff340bac228383ef04437a4666 (diff)
parent8462b8aeb83355fa6c5cb4f45ea0ed63ba9e0712 (diff)
downloadmariadb-git-1e311999950833cd81ca0788cd3656585c46d9ae.tar.gz
Merge with 4.1.3-beta
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/alter_table.test8
-rw-r--r--mysql-test/t/archive.test1300
-rw-r--r--mysql-test/t/auto_increment.test1
-rw-r--r--mysql-test/t/bdb.test75
-rw-r--r--mysql-test/t/ctype_uca.test181
-rw-r--r--mysql-test/t/ctype_ucs.test10
-rw-r--r--mysql-test/t/ctype_ujis.test10
-rw-r--r--mysql-test/t/ctype_utf8.test16
-rw-r--r--mysql-test/t/delete.test11
-rw-r--r--mysql-test/t/flush_table.test59
-rw-r--r--mysql-test/t/fulltext.test13
-rw-r--r--mysql-test/t/func_gconcat.test20
-rw-r--r--mysql-test/t/func_group.test22
-rw-r--r--mysql-test/t/func_if.test9
-rw-r--r--mysql-test/t/func_like.test13
-rw-r--r--mysql-test/t/func_regexp.test13
-rw-r--r--mysql-test/t/func_str.test4
-rw-r--r--mysql-test/t/func_time.test2
-rw-r--r--mysql-test/t/gis-rtree.test2
-rw-r--r--mysql-test/t/gis.test2
-rw-r--r--mysql-test/t/innodb_cache.test23
-rw-r--r--mysql-test/t/lowercase_table2.test11
-rw-r--r--mysql-test/t/lowercase_table3.test4
-rw-r--r--mysql-test/t/merge.test8
-rw-r--r--mysql-test/t/multi_update.test1
-rw-r--r--mysql-test/t/mysqlbinlog.test7
-rw-r--r--mysql-test/t/mysqldump.test5
-rw-r--r--mysql-test/t/ndb_alter_table.test41
-rw-r--r--mysql-test/t/ndb_autodiscover.test267
-rw-r--r--mysql-test/t/ndb_autodiscover2-master.opt1
-rw-r--r--mysql-test/t/ndb_autodiscover2.test13
-rw-r--r--mysql-test/t/ndb_basic.test231
-rw-r--r--mysql-test/t/ndb_index.test129
-rw-r--r--mysql-test/t/ndb_index_ordered.test112
-rw-r--r--mysql-test/t/ndb_index_unique.test175
-rw-r--r--mysql-test/t/ndb_insert.test433
-rw-r--r--mysql-test/t/ndb_minmax.test66
-rw-r--r--mysql-test/t/ndb_replace.test27
-rw-r--r--mysql-test/t/ps.test208
-rw-r--r--mysql-test/t/ps_1general.test739
-rw-r--r--mysql-test/t/ps_2myisam.test17
-rw-r--r--mysql-test/t/ps_3innodb.test17
-rw-r--r--mysql-test/t/ps_4heap.test43
-rw-r--r--mysql-test/t/ps_5merge.test78
-rw-r--r--mysql-test/t/ps_6bdb.test18
-rw-r--r--mysql-test/t/range.test27
-rw-r--r--mysql-test/t/rpl000015.test2
-rw-r--r--mysql-test/t/rpl_charset.test153
-rw-r--r--mysql-test/t/rpl_delete_all.test41
-rw-r--r--mysql-test/t/rpl_free_items-slave.opt1
-rw-r--r--mysql-test/t/rpl_free_items.test20
-rw-r--r--mysql-test/t/rpl_get_lock.test2
-rw-r--r--mysql-test/t/rpl_ps.test43
-rw-r--r--mysql-test/t/rpl_relayspace-slave.opt2
-rw-r--r--mysql-test/t/rpl_server_id1.test8
-rw-r--r--mysql-test/t/rpl_timezone-master.opt1
-rw-r--r--mysql-test/t/rpl_timezone-slave.opt1
-rw-r--r--mysql-test/t/rpl_timezone.test84
-rw-r--r--mysql-test/t/select.test4
-rw-r--r--mysql-test/t/select_found.test19
-rw-r--r--mysql-test/t/show_check.test14
-rw-r--r--mysql-test/t/subselect.test56
-rw-r--r--mysql-test/t/subselect_innodb.test10
-rw-r--r--mysql-test/t/system_mysql_db_fix.test5
-rw-r--r--mysql-test/t/system_mysql_db_refs.test1
-rw-r--r--mysql-test/t/timezone.test15
-rw-r--r--mysql-test/t/timezone2.test189
-rw-r--r--mysql-test/t/type_date.test9
-rw-r--r--mysql-test/t/type_datetime.test19
-rw-r--r--mysql-test/t/type_decimal.test3
-rw-r--r--mysql-test/t/type_timestamp.test19
-rw-r--r--mysql-test/t/union.test40
-rw-r--r--mysql-test/t/user_var.test21
-rw-r--r--mysql-test/t/variables.test1
74 files changed, 5202 insertions, 53 deletions
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 32654bb0bc4..122dcaa6c49 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -304,3 +304,11 @@ SHOW CREATE TABLE t1;
--error 1091
ALTER TABLE t1 DROP PRIMARY KEY;
DROP TABLE t1;
+
+# BUG#3899
+create table t1 (a int, b int, key(a));
+insert into t1 values (1,1), (2,2);
+--error 1091
+alter table t1 drop key no_such_key;
+alter table t1 drop key a;
+drop table t1;
diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test
new file mode 100644
index 00000000000..5c2e73e5af7
--- /dev/null
+++ b/mysql-test/t/archive.test
@@ -0,0 +1,1300 @@
+#
+# Simple test for archive example
+# Taken fromm the select test
+#
+-- source include/have_archive.inc
+
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+
+CREATE TABLE t1 (
+ Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
+ Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
+) ENGINE=archive;
+
+INSERT INTO t1 VALUES (9410,9412);
+
+select period from t1;
+select * from t1;
+select t1.* from t1;
+
+#
+# Create test table
+#
+
+CREATE TABLE t2 (
+ auto int,
+ fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL,
+ companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL,
+ fld3 char(30) DEFAULT '' NOT NULL,
+ fld4 char(35) DEFAULT '' NOT NULL,
+ fld5 char(35) DEFAULT '' NOT NULL,
+ fld6 char(4) DEFAULT '' NOT NULL
+) ENGINE=archive;
+
+#
+# Populate table
+#
+
+--disable_query_log
+INSERT INTO t2 VALUES (1,000001,00,'Omaha','teethe','neat','');
+INSERT INTO t2 VALUES (2,011401,37,'breaking','dreaded','Steinberg','W');
+INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring','');
+INSERT INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
+INSERT INTO t2 VALUES (5,011501,37,'bewilderingly','wallet','balled','');
+INSERT INTO t2 VALUES (6,011701,37,'astound','parters','persist','W');
+INSERT INTO t2 VALUES (7,011702,37,'admonishing','eschew','attainments','');
+INSERT INTO t2 VALUES (8,011703,37,'sumac','quitter','fanatic','');
+INSERT INTO t2 VALUES (9,012001,37,'flanking','neat','measures','FAS');
+INSERT INTO t2 VALUES (10,012003,37,'combed','Steinberg','rightfulness','');
+INSERT INTO t2 VALUES (11,012004,37,'subjective','jarring','capably','');
+INSERT INTO t2 VALUES (12,012005,37,'scatterbrain','tinily','impulsive','');
+INSERT INTO t2 VALUES (13,012301,37,'Eulerian','balled','starlet','');
+INSERT INTO t2 VALUES (14,012302,36,'dubbed','persist','terminators','');
+INSERT INTO t2 VALUES (15,012303,37,'Kane','attainments','untying','');
+INSERT INTO t2 VALUES (16,012304,37,'overlay','fanatic','announces','FAS');
+INSERT INTO t2 VALUES (17,012305,37,'perturb','measures','featherweight','FAS');
+INSERT INTO t2 VALUES (18,012306,37,'goblins','rightfulness','pessimist','FAS');
+INSERT INTO t2 VALUES (19,012501,37,'annihilates','capably','daughter','');
+INSERT INTO t2 VALUES (20,012602,37,'Wotan','impulsive','decliner','FAS');
+INSERT INTO t2 VALUES (21,012603,37,'snatching','starlet','lawgiver','');
+INSERT INTO t2 VALUES (22,012604,37,'concludes','terminators','stated','');
+INSERT INTO t2 VALUES (23,012605,37,'laterally','untying','readable','');
+INSERT INTO t2 VALUES (24,012606,37,'yelped','announces','attrition','');
+INSERT INTO t2 VALUES (25,012701,37,'grazing','featherweight','cascade','FAS');
+INSERT INTO t2 VALUES (26,012702,37,'Baird','pessimist','motors','FAS');
+INSERT INTO t2 VALUES (27,012703,37,'celery','daughter','interrogate','');
+INSERT INTO t2 VALUES (28,012704,37,'misunderstander','decliner','pests','W');
+INSERT INTO t2 VALUES (29,013601,37,'handgun','lawgiver','stairway','');
+INSERT INTO t2 VALUES (30,013602,37,'foldout','stated','dopers','FAS');
+INSERT INTO t2 VALUES (31,013603,37,'mystic','readable','testicle','W');
+INSERT INTO t2 VALUES (32,013604,37,'succumbed','attrition','Parsifal','W');
+INSERT INTO t2 VALUES (33,013605,37,'Nabisco','cascade','leavings','');
+INSERT INTO t2 VALUES (34,013606,37,'fingerings','motors','postulation','W');
+INSERT INTO t2 VALUES (35,013607,37,'aging','interrogate','squeaking','');
+INSERT INTO t2 VALUES (36,013608,37,'afield','pests','contrasted','');
+INSERT INTO t2 VALUES (37,013609,37,'ammonium','stairway','leftover','');
+INSERT INTO t2 VALUES (38,013610,37,'boat','dopers','whiteners','');
+INSERT INTO t2 VALUES (39,013801,37,'intelligibility','testicle','erases','W');
+INSERT INTO t2 VALUES (40,013802,37,'Augustine','Parsifal','Punjab','W');
+INSERT INTO t2 VALUES (41,013803,37,'teethe','leavings','Merritt','');
+INSERT INTO t2 VALUES (42,013804,37,'dreaded','postulation','Quixotism','');
+INSERT INTO t2 VALUES (43,013901,37,'scholastics','squeaking','sweetish','FAS');
+INSERT INTO t2 VALUES (44,016001,37,'audiology','contrasted','dogging','FAS');
+INSERT INTO t2 VALUES (45,016201,37,'wallet','leftover','scornfully','FAS');
+INSERT INTO t2 VALUES (46,016202,37,'parters','whiteners','bellow','');
+INSERT INTO t2 VALUES (47,016301,37,'eschew','erases','bills','');
+INSERT INTO t2 VALUES (48,016302,37,'quitter','Punjab','cupboard','FAS');
+INSERT INTO t2 VALUES (49,016303,37,'neat','Merritt','sureties','FAS');
+INSERT INTO t2 VALUES (50,016304,37,'Steinberg','Quixotism','puddings','');
+INSERT INTO t2 VALUES (51,018001,37,'jarring','sweetish','tapestry','');
+INSERT INTO t2 VALUES (52,018002,37,'tinily','dogging','fetters','');
+INSERT INTO t2 VALUES (53,018003,37,'balled','scornfully','bivalves','');
+INSERT INTO t2 VALUES (54,018004,37,'persist','bellow','incurring','');
+INSERT INTO t2 VALUES (55,018005,37,'attainments','bills','Adolph','');
+INSERT INTO t2 VALUES (56,018007,37,'fanatic','cupboard','pithed','');
+INSERT INTO t2 VALUES (57,018008,37,'measures','sureties','emergency','');
+INSERT INTO t2 VALUES (58,018009,37,'rightfulness','puddings','Miles','');
+INSERT INTO t2 VALUES (59,018010,37,'capably','tapestry','trimmings','');
+INSERT INTO t2 VALUES (60,018012,37,'impulsive','fetters','tragedies','W');
+INSERT INTO t2 VALUES (61,018013,37,'starlet','bivalves','skulking','W');
+INSERT INTO t2 VALUES (62,018014,37,'terminators','incurring','flint','');
+INSERT INTO t2 VALUES (63,018015,37,'untying','Adolph','flopping','W');
+INSERT INTO t2 VALUES (64,018016,37,'announces','pithed','relaxing','FAS');
+INSERT INTO t2 VALUES (65,018017,37,'featherweight','emergency','offload','FAS');
+INSERT INTO t2 VALUES (66,018018,37,'pessimist','Miles','suites','W');
+INSERT INTO t2 VALUES (67,018019,37,'daughter','trimmings','lists','FAS');
+INSERT INTO t2 VALUES (68,018020,37,'decliner','tragedies','animized','FAS');
+INSERT INTO t2 VALUES (69,018021,37,'lawgiver','skulking','multilayer','W');
+INSERT INTO t2 VALUES (70,018022,37,'stated','flint','standardizes','FAS');
+INSERT INTO t2 VALUES (71,018023,37,'readable','flopping','Judas','');
+INSERT INTO t2 VALUES (72,018024,37,'attrition','relaxing','vacuuming','W');
+INSERT INTO t2 VALUES (73,018025,37,'cascade','offload','dentally','W');
+INSERT INTO t2 VALUES (74,018026,37,'motors','suites','humanness','W');
+INSERT INTO t2 VALUES (75,018027,37,'interrogate','lists','inch','W');
+INSERT INTO t2 VALUES (76,018028,37,'pests','animized','Weissmuller','W');
+INSERT INTO t2 VALUES (77,018029,37,'stairway','multilayer','irresponsibly','W');
+INSERT INTO t2 VALUES (78,018030,37,'dopers','standardizes','luckily','FAS');
+INSERT INTO t2 VALUES (79,018032,37,'testicle','Judas','culled','W');
+INSERT INTO t2 VALUES (80,018033,37,'Parsifal','vacuuming','medical','FAS');
+INSERT INTO t2 VALUES (81,018034,37,'leavings','dentally','bloodbath','FAS');
+INSERT INTO t2 VALUES (82,018035,37,'postulation','humanness','subschema','W');
+INSERT INTO t2 VALUES (83,018036,37,'squeaking','inch','animals','W');
+INSERT INTO t2 VALUES (84,018037,37,'contrasted','Weissmuller','Micronesia','');
+INSERT INTO t2 VALUES (85,018038,37,'leftover','irresponsibly','repetitions','');
+INSERT INTO t2 VALUES (86,018039,37,'whiteners','luckily','Antares','');
+INSERT INTO t2 VALUES (87,018040,37,'erases','culled','ventilate','W');
+INSERT INTO t2 VALUES (88,018041,37,'Punjab','medical','pityingly','');
+INSERT INTO t2 VALUES (89,018042,37,'Merritt','bloodbath','interdependent','');
+INSERT INTO t2 VALUES (90,018043,37,'Quixotism','subschema','Graves','FAS');
+INSERT INTO t2 VALUES (91,018044,37,'sweetish','animals','neonatal','');
+INSERT INTO t2 VALUES (92,018045,37,'dogging','Micronesia','scribbled','FAS');
+INSERT INTO t2 VALUES (93,018046,37,'scornfully','repetitions','chafe','W');
+INSERT INTO t2 VALUES (94,018048,37,'bellow','Antares','honoring','');
+INSERT INTO t2 VALUES (95,018049,37,'bills','ventilate','realtor','');
+INSERT INTO t2 VALUES (96,018050,37,'cupboard','pityingly','elite','');
+INSERT INTO t2 VALUES (97,018051,37,'sureties','interdependent','funereal','');
+INSERT INTO t2 VALUES (98,018052,37,'puddings','Graves','abrogating','');
+INSERT INTO t2 VALUES (99,018053,50,'tapestry','neonatal','sorters','');
+INSERT INTO t2 VALUES (100,018054,37,'fetters','scribbled','Conley','');
+INSERT INTO t2 VALUES (101,018055,37,'bivalves','chafe','lectured','');
+INSERT INTO t2 VALUES (102,018056,37,'incurring','honoring','Abraham','');
+INSERT INTO t2 VALUES (103,018057,37,'Adolph','realtor','Hawaii','W');
+INSERT INTO t2 VALUES (104,018058,37,'pithed','elite','cage','');
+INSERT INTO t2 VALUES (105,018059,36,'emergency','funereal','hushes','');
+INSERT INTO t2 VALUES (106,018060,37,'Miles','abrogating','Simla','');
+INSERT INTO t2 VALUES (107,018061,37,'trimmings','sorters','reporters','');
+INSERT INTO t2 VALUES (108,018101,37,'tragedies','Conley','Dutchman','FAS');
+INSERT INTO t2 VALUES (109,018102,37,'skulking','lectured','descendants','FAS');
+INSERT INTO t2 VALUES (110,018103,37,'flint','Abraham','groupings','FAS');
+INSERT INTO t2 VALUES (111,018104,37,'flopping','Hawaii','dissociate','');
+INSERT INTO t2 VALUES (112,018201,37,'relaxing','cage','coexist','W');
+INSERT INTO t2 VALUES (113,018202,37,'offload','hushes','Beebe','');
+INSERT INTO t2 VALUES (114,018402,37,'suites','Simla','Taoism','');
+INSERT INTO t2 VALUES (115,018403,37,'lists','reporters','Connally','');
+INSERT INTO t2 VALUES (116,018404,37,'animized','Dutchman','fetched','FAS');
+INSERT INTO t2 VALUES (117,018405,37,'multilayer','descendants','checkpoints','FAS');
+INSERT INTO t2 VALUES (118,018406,37,'standardizes','groupings','rusting','');
+INSERT INTO t2 VALUES (119,018409,37,'Judas','dissociate','galling','');
+INSERT INTO t2 VALUES (120,018601,37,'vacuuming','coexist','obliterates','');
+INSERT INTO t2 VALUES (121,018602,37,'dentally','Beebe','traitor','');
+INSERT INTO t2 VALUES (122,018603,37,'humanness','Taoism','resumes','FAS');
+INSERT INTO t2 VALUES (123,018801,37,'inch','Connally','analyzable','FAS');
+INSERT INTO t2 VALUES (124,018802,37,'Weissmuller','fetched','terminator','FAS');
+INSERT INTO t2 VALUES (125,018803,37,'irresponsibly','checkpoints','gritty','FAS');
+INSERT INTO t2 VALUES (126,018804,37,'luckily','rusting','firearm','W');
+INSERT INTO t2 VALUES (127,018805,37,'culled','galling','minima','');
+INSERT INTO t2 VALUES (128,018806,37,'medical','obliterates','Selfridge','');
+INSERT INTO t2 VALUES (129,018807,37,'bloodbath','traitor','disable','');
+INSERT INTO t2 VALUES (130,018808,37,'subschema','resumes','witchcraft','W');
+INSERT INTO t2 VALUES (131,018809,37,'animals','analyzable','betroth','W');
+INSERT INTO t2 VALUES (132,018810,37,'Micronesia','terminator','Manhattanize','');
+INSERT INTO t2 VALUES (133,018811,37,'repetitions','gritty','imprint','');
+INSERT INTO t2 VALUES (134,018812,37,'Antares','firearm','peeked','');
+INSERT INTO t2 VALUES (135,019101,37,'ventilate','minima','swelling','');
+INSERT INTO t2 VALUES (136,019102,37,'pityingly','Selfridge','interrelationships','W');
+INSERT INTO t2 VALUES (137,019103,37,'interdependent','disable','riser','');
+INSERT INTO t2 VALUES (138,019201,37,'Graves','witchcraft','Gandhian','W');
+INSERT INTO t2 VALUES (139,030501,37,'neonatal','betroth','peacock','A');
+INSERT INTO t2 VALUES (140,030502,50,'scribbled','Manhattanize','bee','A');
+INSERT INTO t2 VALUES (141,030503,37,'chafe','imprint','kanji','');
+INSERT INTO t2 VALUES (142,030504,37,'honoring','peeked','dental','');
+INSERT INTO t2 VALUES (143,031901,37,'realtor','swelling','scarf','FAS');
+INSERT INTO t2 VALUES (144,036001,37,'elite','interrelationships','chasm','A');
+INSERT INTO t2 VALUES (145,036002,37,'funereal','riser','insolence','A');
+INSERT INTO t2 VALUES (146,036004,37,'abrogating','Gandhian','syndicate','');
+INSERT INTO t2 VALUES (147,036005,37,'sorters','peacock','alike','');
+INSERT INTO t2 VALUES (148,038001,37,'Conley','bee','imperial','A');
+INSERT INTO t2 VALUES (149,038002,37,'lectured','kanji','convulsion','A');
+INSERT INTO t2 VALUES (150,038003,37,'Abraham','dental','railway','A');
+INSERT INTO t2 VALUES (151,038004,37,'Hawaii','scarf','validate','A');
+INSERT INTO t2 VALUES (152,038005,37,'cage','chasm','normalizes','A');
+INSERT INTO t2 VALUES (153,038006,37,'hushes','insolence','comprehensive','');
+INSERT INTO t2 VALUES (154,038007,37,'Simla','syndicate','chewing','');
+INSERT INTO t2 VALUES (155,038008,37,'reporters','alike','denizen','');
+INSERT INTO t2 VALUES (156,038009,37,'Dutchman','imperial','schemer','');
+INSERT INTO t2 VALUES (157,038010,37,'descendants','convulsion','chronicle','');
+INSERT INTO t2 VALUES (158,038011,37,'groupings','railway','Kline','');
+INSERT INTO t2 VALUES (159,038012,37,'dissociate','validate','Anatole','');
+INSERT INTO t2 VALUES (160,038013,37,'coexist','normalizes','partridges','');
+INSERT INTO t2 VALUES (161,038014,37,'Beebe','comprehensive','brunch','');
+INSERT INTO t2 VALUES (162,038015,37,'Taoism','chewing','recruited','');
+INSERT INTO t2 VALUES (163,038016,37,'Connally','denizen','dimensions','W');
+INSERT INTO t2 VALUES (164,038017,37,'fetched','schemer','Chicana','W');
+INSERT INTO t2 VALUES (165,038018,37,'checkpoints','chronicle','announced','');
+INSERT INTO t2 VALUES (166,038101,37,'rusting','Kline','praised','FAS');
+INSERT INTO t2 VALUES (167,038102,37,'galling','Anatole','employing','');
+INSERT INTO t2 VALUES (168,038103,37,'obliterates','partridges','linear','');
+INSERT INTO t2 VALUES (169,038104,37,'traitor','brunch','quagmire','');
+INSERT INTO t2 VALUES (170,038201,37,'resumes','recruited','western','A');
+INSERT INTO t2 VALUES (171,038202,37,'analyzable','dimensions','relishing','');
+INSERT INTO t2 VALUES (172,038203,37,'terminator','Chicana','serving','A');
+INSERT INTO t2 VALUES (173,038204,37,'gritty','announced','scheduling','');
+INSERT INTO t2 VALUES (174,038205,37,'firearm','praised','lore','');
+INSERT INTO t2 VALUES (175,038206,37,'minima','employing','eventful','');
+INSERT INTO t2 VALUES (176,038208,37,'Selfridge','linear','arteriole','A');
+INSERT INTO t2 VALUES (177,042801,37,'disable','quagmire','disentangle','');
+INSERT INTO t2 VALUES (178,042802,37,'witchcraft','western','cured','A');
+INSERT INTO t2 VALUES (179,046101,37,'betroth','relishing','Fenton','W');
+INSERT INTO t2 VALUES (180,048001,37,'Manhattanize','serving','avoidable','A');
+INSERT INTO t2 VALUES (181,048002,37,'imprint','scheduling','drains','A');
+INSERT INTO t2 VALUES (182,048003,37,'peeked','lore','detectably','FAS');
+INSERT INTO t2 VALUES (183,048004,37,'swelling','eventful','husky','');
+INSERT INTO t2 VALUES (184,048005,37,'interrelationships','arteriole','impelling','');
+INSERT INTO t2 VALUES (185,048006,37,'riser','disentangle','undoes','');
+INSERT INTO t2 VALUES (186,048007,37,'Gandhian','cured','evened','');
+INSERT INTO t2 VALUES (187,048008,37,'peacock','Fenton','squeezes','');
+INSERT INTO t2 VALUES (188,048101,37,'bee','avoidable','destroyer','FAS');
+INSERT INTO t2 VALUES (189,048102,37,'kanji','drains','rudeness','');
+INSERT INTO t2 VALUES (190,048201,37,'dental','detectably','beaner','FAS');
+INSERT INTO t2 VALUES (191,048202,37,'scarf','husky','boorish','');
+INSERT INTO t2 VALUES (192,048203,37,'chasm','impelling','Everhart','');
+INSERT INTO t2 VALUES (193,048204,37,'insolence','undoes','encompass','A');
+INSERT INTO t2 VALUES (194,048205,37,'syndicate','evened','mushrooms','');
+INSERT INTO t2 VALUES (195,048301,37,'alike','squeezes','Alison','A');
+INSERT INTO t2 VALUES (196,048302,37,'imperial','destroyer','externally','FAS');
+INSERT INTO t2 VALUES (197,048303,37,'convulsion','rudeness','pellagra','');
+INSERT INTO t2 VALUES (198,048304,37,'railway','beaner','cult','');
+INSERT INTO t2 VALUES (199,048305,37,'validate','boorish','creek','A');
+INSERT INTO t2 VALUES (200,048401,37,'normalizes','Everhart','Huffman','');
+INSERT INTO t2 VALUES (201,048402,37,'comprehensive','encompass','Majorca','FAS');
+INSERT INTO t2 VALUES (202,048403,37,'chewing','mushrooms','governing','A');
+INSERT INTO t2 VALUES (203,048404,37,'denizen','Alison','gadfly','FAS');
+INSERT INTO t2 VALUES (204,048405,37,'schemer','externally','reassigned','FAS');
+INSERT INTO t2 VALUES (205,048406,37,'chronicle','pellagra','intentness','W');
+INSERT INTO t2 VALUES (206,048407,37,'Kline','cult','craziness','');
+INSERT INTO t2 VALUES (207,048408,37,'Anatole','creek','psychic','');
+INSERT INTO t2 VALUES (208,048409,37,'partridges','Huffman','squabbled','');
+INSERT INTO t2 VALUES (209,048410,37,'brunch','Majorca','burlesque','');
+INSERT INTO t2 VALUES (210,048411,37,'recruited','governing','capped','');
+INSERT INTO t2 VALUES (211,048412,37,'dimensions','gadfly','extracted','A');
+INSERT INTO t2 VALUES (212,048413,37,'Chicana','reassigned','DiMaggio','');
+INSERT INTO t2 VALUES (213,048601,37,'announced','intentness','exclamation','FAS');
+INSERT INTO t2 VALUES (214,048602,37,'praised','craziness','subdirectory','');
+INSERT INTO t2 VALUES (215,048603,37,'employing','psychic','fangs','');
+INSERT INTO t2 VALUES (216,048604,37,'linear','squabbled','buyer','A');
+INSERT INTO t2 VALUES (217,048801,37,'quagmire','burlesque','pithing','A');
+INSERT INTO t2 VALUES (218,050901,37,'western','capped','transistorizing','A');
+INSERT INTO t2 VALUES (219,051201,37,'relishing','extracted','nonbiodegradable','');
+INSERT INTO t2 VALUES (220,056002,37,'serving','DiMaggio','dislocate','');
+INSERT INTO t2 VALUES (221,056003,37,'scheduling','exclamation','monochromatic','FAS');
+INSERT INTO t2 VALUES (222,056004,37,'lore','subdirectory','batting','');
+INSERT INTO t2 VALUES (223,056102,37,'eventful','fangs','postcondition','A');
+INSERT INTO t2 VALUES (224,056203,37,'arteriole','buyer','catalog','FAS');
+INSERT INTO t2 VALUES (225,056204,37,'disentangle','pithing','Remus','');
+INSERT INTO t2 VALUES (226,058003,37,'cured','transistorizing','devices','A');
+INSERT INTO t2 VALUES (227,058004,37,'Fenton','nonbiodegradable','bike','A');
+INSERT INTO t2 VALUES (228,058005,37,'avoidable','dislocate','qualify','');
+INSERT INTO t2 VALUES (229,058006,37,'drains','monochromatic','detained','');
+INSERT INTO t2 VALUES (230,058007,37,'detectably','batting','commended','');
+INSERT INTO t2 VALUES (231,058101,37,'husky','postcondition','civilize','');
+INSERT INTO t2 VALUES (232,058102,37,'impelling','catalog','Elmhurst','');
+INSERT INTO t2 VALUES (233,058103,37,'undoes','Remus','anesthetizing','');
+INSERT INTO t2 VALUES (234,058105,37,'evened','devices','deaf','');
+INSERT INTO t2 VALUES (235,058111,37,'squeezes','bike','Brigham','');
+INSERT INTO t2 VALUES (236,058112,37,'destroyer','qualify','title','');
+INSERT INTO t2 VALUES (237,058113,37,'rudeness','detained','coarse','');
+INSERT INTO t2 VALUES (238,058114,37,'beaner','commended','combinations','');
+INSERT INTO t2 VALUES (239,058115,37,'boorish','civilize','grayness','');
+INSERT INTO t2 VALUES (240,058116,37,'Everhart','Elmhurst','innumerable','FAS');
+INSERT INTO t2 VALUES (241,058117,37,'encompass','anesthetizing','Caroline','A');
+INSERT INTO t2 VALUES (242,058118,37,'mushrooms','deaf','fatty','FAS');
+INSERT INTO t2 VALUES (243,058119,37,'Alison','Brigham','eastbound','');
+INSERT INTO t2 VALUES (244,058120,37,'externally','title','inexperienced','');
+INSERT INTO t2 VALUES (245,058121,37,'pellagra','coarse','hoarder','A');
+INSERT INTO t2 VALUES (246,058122,37,'cult','combinations','scotch','W');
+INSERT INTO t2 VALUES (247,058123,37,'creek','grayness','passport','A');
+INSERT INTO t2 VALUES (248,058124,37,'Huffman','innumerable','strategic','FAS');
+INSERT INTO t2 VALUES (249,058125,37,'Majorca','Caroline','gated','');
+INSERT INTO t2 VALUES (250,058126,37,'governing','fatty','flog','');
+INSERT INTO t2 VALUES (251,058127,37,'gadfly','eastbound','Pipestone','');
+INSERT INTO t2 VALUES (252,058128,37,'reassigned','inexperienced','Dar','');
+INSERT INTO t2 VALUES (253,058201,37,'intentness','hoarder','Corcoran','');
+INSERT INTO t2 VALUES (254,058202,37,'craziness','scotch','flyers','A');
+INSERT INTO t2 VALUES (255,058303,37,'psychic','passport','competitions','W');
+INSERT INTO t2 VALUES (256,058304,37,'squabbled','strategic','suppliers','FAS');
+INSERT INTO t2 VALUES (257,058602,37,'burlesque','gated','skips','');
+INSERT INTO t2 VALUES (258,058603,37,'capped','flog','institutes','');
+INSERT INTO t2 VALUES (259,058604,37,'extracted','Pipestone','troop','A');
+INSERT INTO t2 VALUES (260,058605,37,'DiMaggio','Dar','connective','W');
+INSERT INTO t2 VALUES (261,058606,37,'exclamation','Corcoran','denies','');
+INSERT INTO t2 VALUES (262,058607,37,'subdirectory','flyers','polka','');
+INSERT INTO t2 VALUES (263,060401,36,'fangs','competitions','observations','FAS');
+INSERT INTO t2 VALUES (264,061701,36,'buyer','suppliers','askers','');
+INSERT INTO t2 VALUES (265,066201,36,'pithing','skips','homeless','FAS');
+INSERT INTO t2 VALUES (266,066501,36,'transistorizing','institutes','Anna','');
+INSERT INTO t2 VALUES (267,068001,36,'nonbiodegradable','troop','subdirectories','W');
+INSERT INTO t2 VALUES (268,068002,36,'dislocate','connective','decaying','FAS');
+INSERT INTO t2 VALUES (269,068005,36,'monochromatic','denies','outwitting','W');
+INSERT INTO t2 VALUES (270,068006,36,'batting','polka','Harpy','W');
+INSERT INTO t2 VALUES (271,068007,36,'postcondition','observations','crazed','');
+INSERT INTO t2 VALUES (272,068008,36,'catalog','askers','suffocate','');
+INSERT INTO t2 VALUES (273,068009,36,'Remus','homeless','provers','FAS');
+INSERT INTO t2 VALUES (274,068010,36,'devices','Anna','technically','');
+INSERT INTO t2 VALUES (275,068011,36,'bike','subdirectories','Franklinizations','');
+INSERT INTO t2 VALUES (276,068202,36,'qualify','decaying','considered','');
+INSERT INTO t2 VALUES (277,068302,36,'detained','outwitting','tinnily','');
+INSERT INTO t2 VALUES (278,068303,36,'commended','Harpy','uninterruptedly','');
+INSERT INTO t2 VALUES (279,068401,36,'civilize','crazed','whistled','A');
+INSERT INTO t2 VALUES (280,068501,36,'Elmhurst','suffocate','automate','');
+INSERT INTO t2 VALUES (281,068502,36,'anesthetizing','provers','gutting','W');
+INSERT INTO t2 VALUES (282,068503,36,'deaf','technically','surreptitious','');
+INSERT INTO t2 VALUES (283,068602,36,'Brigham','Franklinizations','Choctaw','');
+INSERT INTO t2 VALUES (284,068603,36,'title','considered','cooks','');
+INSERT INTO t2 VALUES (285,068701,36,'coarse','tinnily','millivolt','FAS');
+INSERT INTO t2 VALUES (286,068702,36,'combinations','uninterruptedly','counterpoise','');
+INSERT INTO t2 VALUES (287,068703,36,'grayness','whistled','Gothicism','');
+INSERT INTO t2 VALUES (288,076001,36,'innumerable','automate','feminine','');
+INSERT INTO t2 VALUES (289,076002,36,'Caroline','gutting','metaphysically','W');
+INSERT INTO t2 VALUES (290,076101,36,'fatty','surreptitious','sanding','A');
+INSERT INTO t2 VALUES (291,076102,36,'eastbound','Choctaw','contributorily','');
+INSERT INTO t2 VALUES (292,076103,36,'inexperienced','cooks','receivers','FAS');
+INSERT INTO t2 VALUES (293,076302,36,'hoarder','millivolt','adjourn','');
+INSERT INTO t2 VALUES (294,076303,36,'scotch','counterpoise','straggled','A');
+INSERT INTO t2 VALUES (295,076304,36,'passport','Gothicism','druggists','');
+INSERT INTO t2 VALUES (296,076305,36,'strategic','feminine','thanking','FAS');
+INSERT INTO t2 VALUES (297,076306,36,'gated','metaphysically','ostrich','');
+INSERT INTO t2 VALUES (298,076307,36,'flog','sanding','hopelessness','FAS');
+INSERT INTO t2 VALUES (299,076402,36,'Pipestone','contributorily','Eurydice','');
+INSERT INTO t2 VALUES (300,076501,36,'Dar','receivers','excitation','W');
+INSERT INTO t2 VALUES (301,076502,36,'Corcoran','adjourn','presumes','FAS');
+INSERT INTO t2 VALUES (302,076701,36,'flyers','straggled','imaginable','FAS');
+INSERT INTO t2 VALUES (303,078001,36,'competitions','druggists','concoct','W');
+INSERT INTO t2 VALUES (304,078002,36,'suppliers','thanking','peering','W');
+INSERT INTO t2 VALUES (305,078003,36,'skips','ostrich','Phelps','FAS');
+INSERT INTO t2 VALUES (306,078004,36,'institutes','hopelessness','ferociousness','FAS');
+INSERT INTO t2 VALUES (307,078005,36,'troop','Eurydice','sentences','');
+INSERT INTO t2 VALUES (308,078006,36,'connective','excitation','unlocks','');
+INSERT INTO t2 VALUES (309,078007,36,'denies','presumes','engrossing','W');
+INSERT INTO t2 VALUES (310,078008,36,'polka','imaginable','Ruth','');
+INSERT INTO t2 VALUES (311,078101,36,'observations','concoct','tying','');
+INSERT INTO t2 VALUES (312,078103,36,'askers','peering','exclaimers','');
+INSERT INTO t2 VALUES (313,078104,36,'homeless','Phelps','synergy','');
+INSERT INTO t2 VALUES (314,078105,36,'Anna','ferociousness','Huey','W');
+INSERT INTO t2 VALUES (315,082101,36,'subdirectories','sentences','merging','');
+INSERT INTO t2 VALUES (316,083401,36,'decaying','unlocks','judges','A');
+INSERT INTO t2 VALUES (317,084001,36,'outwitting','engrossing','Shylock','W');
+INSERT INTO t2 VALUES (318,084002,36,'Harpy','Ruth','Miltonism','');
+INSERT INTO t2 VALUES (319,086001,36,'crazed','tying','hen','W');
+INSERT INTO t2 VALUES (320,086102,36,'suffocate','exclaimers','honeybee','FAS');
+INSERT INTO t2 VALUES (321,086201,36,'provers','synergy','towers','');
+INSERT INTO t2 VALUES (322,088001,36,'technically','Huey','dilutes','W');
+INSERT INTO t2 VALUES (323,088002,36,'Franklinizations','merging','numerals','FAS');
+INSERT INTO t2 VALUES (324,088003,36,'considered','judges','democracy','FAS');
+INSERT INTO t2 VALUES (325,088004,36,'tinnily','Shylock','Ibero-','');
+INSERT INTO t2 VALUES (326,088101,36,'uninterruptedly','Miltonism','invalids','');
+INSERT INTO t2 VALUES (327,088102,36,'whistled','hen','behavior','');
+INSERT INTO t2 VALUES (328,088103,36,'automate','honeybee','accruing','');
+INSERT INTO t2 VALUES (329,088104,36,'gutting','towers','relics','A');
+INSERT INTO t2 VALUES (330,088105,36,'surreptitious','dilutes','rackets','');
+INSERT INTO t2 VALUES (331,088106,36,'Choctaw','numerals','Fischbein','W');
+INSERT INTO t2 VALUES (332,088201,36,'cooks','democracy','phony','W');
+INSERT INTO t2 VALUES (333,088203,36,'millivolt','Ibero-','cross','FAS');
+INSERT INTO t2 VALUES (334,088204,36,'counterpoise','invalids','cleanup','');
+INSERT INTO t2 VALUES (335,088302,37,'Gothicism','behavior','conspirator','');
+INSERT INTO t2 VALUES (336,088303,37,'feminine','accruing','label','FAS');
+INSERT INTO t2 VALUES (337,088305,37,'metaphysically','relics','university','');
+INSERT INTO t2 VALUES (338,088402,37,'sanding','rackets','cleansed','FAS');
+INSERT INTO t2 VALUES (339,088501,36,'contributorily','Fischbein','ballgown','');
+INSERT INTO t2 VALUES (340,088502,36,'receivers','phony','starlet','');
+INSERT INTO t2 VALUES (341,088503,36,'adjourn','cross','aqueous','');
+INSERT INTO t2 VALUES (342,098001,58,'straggled','cleanup','portrayal','A');
+INSERT INTO t2 VALUES (343,098002,58,'druggists','conspirator','despising','W');
+INSERT INTO t2 VALUES (344,098003,58,'thanking','label','distort','W');
+INSERT INTO t2 VALUES (345,098004,58,'ostrich','university','palmed','');
+INSERT INTO t2 VALUES (346,098005,58,'hopelessness','cleansed','faced','');
+INSERT INTO t2 VALUES (347,098006,58,'Eurydice','ballgown','silverware','');
+INSERT INTO t2 VALUES (348,141903,29,'excitation','starlet','assessor','');
+INSERT INTO t2 VALUES (349,098008,58,'presumes','aqueous','spiders','');
+INSERT INTO t2 VALUES (350,098009,58,'imaginable','portrayal','artificially','');
+INSERT INTO t2 VALUES (351,098010,58,'concoct','despising','reminiscence','');
+INSERT INTO t2 VALUES (352,098011,58,'peering','distort','Mexican','');
+INSERT INTO t2 VALUES (353,098012,58,'Phelps','palmed','obnoxious','');
+INSERT INTO t2 VALUES (354,098013,58,'ferociousness','faced','fragile','');
+INSERT INTO t2 VALUES (355,098014,58,'sentences','silverware','apprehensible','');
+INSERT INTO t2 VALUES (356,098015,58,'unlocks','assessor','births','');
+INSERT INTO t2 VALUES (357,098016,58,'engrossing','spiders','garages','');
+INSERT INTO t2 VALUES (358,098017,58,'Ruth','artificially','panty','');
+INSERT INTO t2 VALUES (359,098018,58,'tying','reminiscence','anteater','');
+INSERT INTO t2 VALUES (360,098019,58,'exclaimers','Mexican','displacement','A');
+INSERT INTO t2 VALUES (361,098020,58,'synergy','obnoxious','drovers','A');
+INSERT INTO t2 VALUES (362,098021,58,'Huey','fragile','patenting','A');
+INSERT INTO t2 VALUES (363,098022,58,'merging','apprehensible','far','A');
+INSERT INTO t2 VALUES (364,098023,58,'judges','births','shrieks','');
+INSERT INTO t2 VALUES (365,098024,58,'Shylock','garages','aligning','W');
+INSERT INTO t2 VALUES (366,098025,37,'Miltonism','panty','pragmatism','');
+INSERT INTO t2 VALUES (367,106001,36,'hen','anteater','fevers','W');
+INSERT INTO t2 VALUES (368,108001,36,'honeybee','displacement','reexamines','A');
+INSERT INTO t2 VALUES (369,108002,36,'towers','drovers','occupancies','');
+INSERT INTO t2 VALUES (370,108003,36,'dilutes','patenting','sweats','FAS');
+INSERT INTO t2 VALUES (371,108004,36,'numerals','far','modulators','');
+INSERT INTO t2 VALUES (372,108005,36,'democracy','shrieks','demand','W');
+INSERT INTO t2 VALUES (373,108007,36,'Ibero-','aligning','Madeira','');
+INSERT INTO t2 VALUES (374,108008,36,'invalids','pragmatism','Viennese','W');
+INSERT INTO t2 VALUES (375,108009,36,'behavior','fevers','chillier','W');
+INSERT INTO t2 VALUES (376,108010,36,'accruing','reexamines','wildcats','FAS');
+INSERT INTO t2 VALUES (377,108011,36,'relics','occupancies','gentle','');
+INSERT INTO t2 VALUES (378,108012,36,'rackets','sweats','Angles','W');
+INSERT INTO t2 VALUES (379,108101,36,'Fischbein','modulators','accuracies','');
+INSERT INTO t2 VALUES (380,108102,36,'phony','demand','toggle','');
+INSERT INTO t2 VALUES (381,108103,36,'cross','Madeira','Mendelssohn','W');
+INSERT INTO t2 VALUES (382,108111,50,'cleanup','Viennese','behaviorally','');
+INSERT INTO t2 VALUES (383,108105,36,'conspirator','chillier','Rochford','');
+INSERT INTO t2 VALUES (384,108106,36,'label','wildcats','mirror','W');
+INSERT INTO t2 VALUES (385,108107,36,'university','gentle','Modula','');
+INSERT INTO t2 VALUES (386,108108,50,'cleansed','Angles','clobbering','');
+INSERT INTO t2 VALUES (387,108109,36,'ballgown','accuracies','chronography','');
+INSERT INTO t2 VALUES (388,108110,36,'starlet','toggle','Eskimoizeds','');
+INSERT INTO t2 VALUES (389,108201,36,'aqueous','Mendelssohn','British','W');
+INSERT INTO t2 VALUES (390,108202,36,'portrayal','behaviorally','pitfalls','');
+INSERT INTO t2 VALUES (391,108203,36,'despising','Rochford','verify','W');
+INSERT INTO t2 VALUES (392,108204,36,'distort','mirror','scatter','FAS');
+INSERT INTO t2 VALUES (393,108205,36,'palmed','Modula','Aztecan','');
+INSERT INTO t2 VALUES (394,108301,36,'faced','clobbering','acuity','W');
+INSERT INTO t2 VALUES (395,108302,36,'silverware','chronography','sinking','W');
+INSERT INTO t2 VALUES (396,112101,36,'assessor','Eskimoizeds','beasts','FAS');
+INSERT INTO t2 VALUES (397,112102,36,'spiders','British','Witt','W');
+INSERT INTO t2 VALUES (398,113701,36,'artificially','pitfalls','physicists','FAS');
+INSERT INTO t2 VALUES (399,116001,36,'reminiscence','verify','folksong','A');
+INSERT INTO t2 VALUES (400,116201,36,'Mexican','scatter','strokes','FAS');
+INSERT INTO t2 VALUES (401,116301,36,'obnoxious','Aztecan','crowder','');
+INSERT INTO t2 VALUES (402,116302,36,'fragile','acuity','merry','');
+INSERT INTO t2 VALUES (403,116601,36,'apprehensible','sinking','cadenced','');
+INSERT INTO t2 VALUES (404,116602,36,'births','beasts','alimony','A');
+INSERT INTO t2 VALUES (405,116603,36,'garages','Witt','principled','A');
+INSERT INTO t2 VALUES (406,116701,36,'panty','physicists','golfing','');
+INSERT INTO t2 VALUES (407,116702,36,'anteater','folksong','undiscovered','');
+INSERT INTO t2 VALUES (408,118001,36,'displacement','strokes','irritates','');
+INSERT INTO t2 VALUES (409,118002,36,'drovers','crowder','patriots','A');
+INSERT INTO t2 VALUES (410,118003,36,'patenting','merry','rooms','FAS');
+INSERT INTO t2 VALUES (411,118004,36,'far','cadenced','towering','W');
+INSERT INTO t2 VALUES (412,118005,36,'shrieks','alimony','displease','');
+INSERT INTO t2 VALUES (413,118006,36,'aligning','principled','photosensitive','');
+INSERT INTO t2 VALUES (414,118007,36,'pragmatism','golfing','inking','');
+INSERT INTO t2 VALUES (415,118008,36,'fevers','undiscovered','gainers','');
+INSERT INTO t2 VALUES (416,118101,36,'reexamines','irritates','leaning','A');
+INSERT INTO t2 VALUES (417,118102,36,'occupancies','patriots','hydrant','A');
+INSERT INTO t2 VALUES (418,118103,36,'sweats','rooms','preserve','');
+INSERT INTO t2 VALUES (419,118202,36,'modulators','towering','blinded','A');
+INSERT INTO t2 VALUES (420,118203,36,'demand','displease','interactions','A');
+INSERT INTO t2 VALUES (421,118204,36,'Madeira','photosensitive','Barry','');
+INSERT INTO t2 VALUES (422,118302,36,'Viennese','inking','whiteness','A');
+INSERT INTO t2 VALUES (423,118304,36,'chillier','gainers','pastimes','W');
+INSERT INTO t2 VALUES (424,118305,36,'wildcats','leaning','Edenization','');
+INSERT INTO t2 VALUES (425,118306,36,'gentle','hydrant','Muscat','');
+INSERT INTO t2 VALUES (426,118307,36,'Angles','preserve','assassinated','');
+INSERT INTO t2 VALUES (427,123101,36,'accuracies','blinded','labeled','');
+INSERT INTO t2 VALUES (428,123102,36,'toggle','interactions','glacial','A');
+INSERT INTO t2 VALUES (429,123301,36,'Mendelssohn','Barry','implied','W');
+INSERT INTO t2 VALUES (430,126001,36,'behaviorally','whiteness','bibliographies','W');
+INSERT INTO t2 VALUES (431,126002,36,'Rochford','pastimes','Buchanan','');
+INSERT INTO t2 VALUES (432,126003,36,'mirror','Edenization','forgivably','FAS');
+INSERT INTO t2 VALUES (433,126101,36,'Modula','Muscat','innuendo','A');
+INSERT INTO t2 VALUES (434,126301,36,'clobbering','assassinated','den','FAS');
+INSERT INTO t2 VALUES (435,126302,36,'chronography','labeled','submarines','W');
+INSERT INTO t2 VALUES (436,126402,36,'Eskimoizeds','glacial','mouthful','A');
+INSERT INTO t2 VALUES (437,126601,36,'British','implied','expiring','');
+INSERT INTO t2 VALUES (438,126602,36,'pitfalls','bibliographies','unfulfilled','FAS');
+INSERT INTO t2 VALUES (439,126702,36,'verify','Buchanan','precession','');
+INSERT INTO t2 VALUES (440,128001,36,'scatter','forgivably','nullified','');
+INSERT INTO t2 VALUES (441,128002,36,'Aztecan','innuendo','affects','');
+INSERT INTO t2 VALUES (442,128003,36,'acuity','den','Cynthia','');
+INSERT INTO t2 VALUES (443,128004,36,'sinking','submarines','Chablis','A');
+INSERT INTO t2 VALUES (444,128005,36,'beasts','mouthful','betterments','FAS');
+INSERT INTO t2 VALUES (445,128007,36,'Witt','expiring','advertising','');
+INSERT INTO t2 VALUES (446,128008,36,'physicists','unfulfilled','rubies','A');
+INSERT INTO t2 VALUES (447,128009,36,'folksong','precession','southwest','FAS');
+INSERT INTO t2 VALUES (448,128010,36,'strokes','nullified','superstitious','A');
+INSERT INTO t2 VALUES (449,128011,36,'crowder','affects','tabernacle','W');
+INSERT INTO t2 VALUES (450,128012,36,'merry','Cynthia','silk','A');
+INSERT INTO t2 VALUES (451,128013,36,'cadenced','Chablis','handsomest','A');
+INSERT INTO t2 VALUES (452,128014,36,'alimony','betterments','Persian','A');
+INSERT INTO t2 VALUES (453,128015,36,'principled','advertising','analog','W');
+INSERT INTO t2 VALUES (454,128016,36,'golfing','rubies','complex','W');
+INSERT INTO t2 VALUES (455,128017,36,'undiscovered','southwest','Taoist','');
+INSERT INTO t2 VALUES (456,128018,36,'irritates','superstitious','suspend','');
+INSERT INTO t2 VALUES (457,128019,36,'patriots','tabernacle','relegated','');
+INSERT INTO t2 VALUES (458,128020,36,'rooms','silk','awesome','W');
+INSERT INTO t2 VALUES (459,128021,36,'towering','handsomest','Bruxelles','');
+INSERT INTO t2 VALUES (460,128022,36,'displease','Persian','imprecisely','A');
+INSERT INTO t2 VALUES (461,128023,36,'photosensitive','analog','televise','');
+INSERT INTO t2 VALUES (462,128101,36,'inking','complex','braking','');
+INSERT INTO t2 VALUES (463,128102,36,'gainers','Taoist','true','FAS');
+INSERT INTO t2 VALUES (464,128103,36,'leaning','suspend','disappointing','FAS');
+INSERT INTO t2 VALUES (465,128104,36,'hydrant','relegated','navally','W');
+INSERT INTO t2 VALUES (466,128106,36,'preserve','awesome','circus','');
+INSERT INTO t2 VALUES (467,128107,36,'blinded','Bruxelles','beetles','');
+INSERT INTO t2 VALUES (468,128108,36,'interactions','imprecisely','trumps','');
+INSERT INTO t2 VALUES (469,128202,36,'Barry','televise','fourscore','W');
+INSERT INTO t2 VALUES (470,128203,36,'whiteness','braking','Blackfoots','');
+INSERT INTO t2 VALUES (471,128301,36,'pastimes','true','Grady','');
+INSERT INTO t2 VALUES (472,128302,36,'Edenization','disappointing','quiets','FAS');
+INSERT INTO t2 VALUES (473,128303,36,'Muscat','navally','floundered','FAS');
+INSERT INTO t2 VALUES (474,128304,36,'assassinated','circus','profundity','W');
+INSERT INTO t2 VALUES (475,128305,36,'labeled','beetles','Garrisonian','W');
+INSERT INTO t2 VALUES (476,128307,36,'glacial','trumps','Strauss','');
+INSERT INTO t2 VALUES (477,128401,36,'implied','fourscore','cemented','FAS');
+INSERT INTO t2 VALUES (478,128502,36,'bibliographies','Blackfoots','contrition','A');
+INSERT INTO t2 VALUES (479,128503,36,'Buchanan','Grady','mutations','');
+INSERT INTO t2 VALUES (480,128504,36,'forgivably','quiets','exhibits','W');
+INSERT INTO t2 VALUES (481,128505,36,'innuendo','floundered','tits','');
+INSERT INTO t2 VALUES (482,128601,36,'den','profundity','mate','A');
+INSERT INTO t2 VALUES (483,128603,36,'submarines','Garrisonian','arches','');
+INSERT INTO t2 VALUES (484,128604,36,'mouthful','Strauss','Moll','');
+INSERT INTO t2 VALUES (485,128702,36,'expiring','cemented','ropers','');
+INSERT INTO t2 VALUES (486,128703,36,'unfulfilled','contrition','bombast','');
+INSERT INTO t2 VALUES (487,128704,36,'precession','mutations','difficultly','A');
+INSERT INTO t2 VALUES (488,138001,36,'nullified','exhibits','adsorption','');
+INSERT INTO t2 VALUES (489,138002,36,'affects','tits','definiteness','FAS');
+INSERT INTO t2 VALUES (490,138003,36,'Cynthia','mate','cultivation','A');
+INSERT INTO t2 VALUES (491,138004,36,'Chablis','arches','heals','A');
+INSERT INTO t2 VALUES (492,138005,36,'betterments','Moll','Heusen','W');
+INSERT INTO t2 VALUES (493,138006,36,'advertising','ropers','target','FAS');
+INSERT INTO t2 VALUES (494,138007,36,'rubies','bombast','cited','A');
+INSERT INTO t2 VALUES (495,138008,36,'southwest','difficultly','congresswoman','W');
+INSERT INTO t2 VALUES (496,138009,36,'superstitious','adsorption','Katherine','');
+INSERT INTO t2 VALUES (497,138102,36,'tabernacle','definiteness','titter','A');
+INSERT INTO t2 VALUES (498,138103,36,'silk','cultivation','aspire','A');
+INSERT INTO t2 VALUES (499,138104,36,'handsomest','heals','Mardis','');
+INSERT INTO t2 VALUES (500,138105,36,'Persian','Heusen','Nadia','W');
+INSERT INTO t2 VALUES (501,138201,36,'analog','target','estimating','FAS');
+INSERT INTO t2 VALUES (502,138302,36,'complex','cited','stuck','A');
+INSERT INTO t2 VALUES (503,138303,36,'Taoist','congresswoman','fifteenth','A');
+INSERT INTO t2 VALUES (504,138304,36,'suspend','Katherine','Colombo','');
+INSERT INTO t2 VALUES (505,138401,29,'relegated','titter','survey','A');
+INSERT INTO t2 VALUES (506,140102,29,'awesome','aspire','staffing','');
+INSERT INTO t2 VALUES (507,140103,29,'Bruxelles','Mardis','obtain','');
+INSERT INTO t2 VALUES (508,140104,29,'imprecisely','Nadia','loaded','');
+INSERT INTO t2 VALUES (509,140105,29,'televise','estimating','slaughtered','');
+INSERT INTO t2 VALUES (510,140201,29,'braking','stuck','lights','A');
+INSERT INTO t2 VALUES (511,140701,29,'true','fifteenth','circumference','');
+INSERT INTO t2 VALUES (512,141501,29,'disappointing','Colombo','dull','A');
+INSERT INTO t2 VALUES (513,141502,29,'navally','survey','weekly','A');
+INSERT INTO t2 VALUES (514,141901,29,'circus','staffing','wetness','');
+INSERT INTO t2 VALUES (515,141902,29,'beetles','obtain','visualized','');
+INSERT INTO t2 VALUES (516,142101,29,'trumps','loaded','Tannenbaum','');
+INSERT INTO t2 VALUES (517,142102,29,'fourscore','slaughtered','moribund','');
+INSERT INTO t2 VALUES (518,142103,29,'Blackfoots','lights','demultiplex','');
+INSERT INTO t2 VALUES (519,142701,29,'Grady','circumference','lockings','');
+INSERT INTO t2 VALUES (520,143001,29,'quiets','dull','thugs','FAS');
+INSERT INTO t2 VALUES (521,143501,29,'floundered','weekly','unnerves','');
+INSERT INTO t2 VALUES (522,143502,29,'profundity','wetness','abut','');
+INSERT INTO t2 VALUES (523,148001,29,'Garrisonian','visualized','Chippewa','A');
+INSERT INTO t2 VALUES (524,148002,29,'Strauss','Tannenbaum','stratifications','A');
+INSERT INTO t2 VALUES (525,148003,29,'cemented','moribund','signaled','');
+INSERT INTO t2 VALUES (526,148004,29,'contrition','demultiplex','Italianizes','A');
+INSERT INTO t2 VALUES (527,148005,29,'mutations','lockings','algorithmic','A');
+INSERT INTO t2 VALUES (528,148006,29,'exhibits','thugs','paranoid','FAS');
+INSERT INTO t2 VALUES (529,148007,29,'tits','unnerves','camping','A');
+INSERT INTO t2 VALUES (530,148009,29,'mate','abut','signifying','A');
+INSERT INTO t2 VALUES (531,148010,29,'arches','Chippewa','Patrice','W');
+INSERT INTO t2 VALUES (532,148011,29,'Moll','stratifications','search','A');
+INSERT INTO t2 VALUES (533,148012,29,'ropers','signaled','Angeles','A');
+INSERT INTO t2 VALUES (534,148013,29,'bombast','Italianizes','semblance','');
+INSERT INTO t2 VALUES (535,148023,36,'difficultly','algorithmic','taxed','');
+INSERT INTO t2 VALUES (536,148015,29,'adsorption','paranoid','Beatrice','');
+INSERT INTO t2 VALUES (537,148016,29,'definiteness','camping','retrace','');
+INSERT INTO t2 VALUES (538,148017,29,'cultivation','signifying','lockout','');
+INSERT INTO t2 VALUES (539,148018,29,'heals','Patrice','grammatic','');
+INSERT INTO t2 VALUES (540,148019,29,'Heusen','search','helmsman','');
+INSERT INTO t2 VALUES (541,148020,29,'target','Angeles','uniform','W');
+INSERT INTO t2 VALUES (542,148021,29,'cited','semblance','hamming','');
+INSERT INTO t2 VALUES (543,148022,29,'congresswoman','taxed','disobedience','');
+INSERT INTO t2 VALUES (544,148101,29,'Katherine','Beatrice','captivated','A');
+INSERT INTO t2 VALUES (545,148102,29,'titter','retrace','transferals','A');
+INSERT INTO t2 VALUES (546,148201,29,'aspire','lockout','cartographer','A');
+INSERT INTO t2 VALUES (547,148401,29,'Mardis','grammatic','aims','FAS');
+INSERT INTO t2 VALUES (548,148402,29,'Nadia','helmsman','Pakistani','');
+INSERT INTO t2 VALUES (549,148501,29,'estimating','uniform','burglarized','FAS');
+INSERT INTO t2 VALUES (550,148502,29,'stuck','hamming','saucepans','A');
+INSERT INTO t2 VALUES (551,148503,29,'fifteenth','disobedience','lacerating','A');
+INSERT INTO t2 VALUES (552,148504,29,'Colombo','captivated','corny','');
+INSERT INTO t2 VALUES (553,148601,29,'survey','transferals','megabytes','FAS');
+INSERT INTO t2 VALUES (554,148602,29,'staffing','cartographer','chancellor','');
+INSERT INTO t2 VALUES (555,150701,29,'obtain','aims','bulk','A');
+INSERT INTO t2 VALUES (556,152101,29,'loaded','Pakistani','commits','A');
+INSERT INTO t2 VALUES (557,152102,29,'slaughtered','burglarized','meson','W');
+INSERT INTO t2 VALUES (558,155202,36,'lights','saucepans','deputies','');
+INSERT INTO t2 VALUES (559,155203,29,'circumference','lacerating','northeaster','A');
+INSERT INTO t2 VALUES (560,155204,29,'dull','corny','dipole','');
+INSERT INTO t2 VALUES (561,155205,29,'weekly','megabytes','machining','0');
+INSERT INTO t2 VALUES (562,156001,29,'wetness','chancellor','therefore','');
+INSERT INTO t2 VALUES (563,156002,29,'visualized','bulk','Telefunken','');
+INSERT INTO t2 VALUES (564,156102,29,'Tannenbaum','commits','salvaging','');
+INSERT INTO t2 VALUES (565,156301,29,'moribund','meson','Corinthianizes','A');
+INSERT INTO t2 VALUES (566,156302,29,'demultiplex','deputies','restlessly','A');
+INSERT INTO t2 VALUES (567,156303,29,'lockings','northeaster','bromides','');
+INSERT INTO t2 VALUES (568,156304,29,'thugs','dipole','generalized','A');
+INSERT INTO t2 VALUES (569,156305,29,'unnerves','machining','mishaps','');
+INSERT INTO t2 VALUES (570,156306,29,'abut','therefore','quelling','');
+INSERT INTO t2 VALUES (571,156501,29,'Chippewa','Telefunken','spiritual','A');
+INSERT INTO t2 VALUES (572,158001,29,'stratifications','salvaging','beguiles','FAS');
+INSERT INTO t2 VALUES (573,158002,29,'signaled','Corinthianizes','Trobriand','FAS');
+INSERT INTO t2 VALUES (574,158101,29,'Italianizes','restlessly','fleeing','A');
+INSERT INTO t2 VALUES (575,158102,29,'algorithmic','bromides','Armour','A');
+INSERT INTO t2 VALUES (576,158103,29,'paranoid','generalized','chin','A');
+INSERT INTO t2 VALUES (577,158201,29,'camping','mishaps','provers','A');
+INSERT INTO t2 VALUES (578,158202,29,'signifying','quelling','aeronautic','A');
+INSERT INTO t2 VALUES (579,158203,29,'Patrice','spiritual','voltage','W');
+INSERT INTO t2 VALUES (580,158204,29,'search','beguiles','sash','');
+INSERT INTO t2 VALUES (581,158301,29,'Angeles','Trobriand','anaerobic','A');
+INSERT INTO t2 VALUES (582,158302,29,'semblance','fleeing','simultaneous','A');
+INSERT INTO t2 VALUES (583,158303,29,'taxed','Armour','accumulating','A');
+INSERT INTO t2 VALUES (584,158304,29,'Beatrice','chin','Medusan','A');
+INSERT INTO t2 VALUES (585,158305,29,'retrace','provers','shouted','A');
+INSERT INTO t2 VALUES (586,158306,29,'lockout','aeronautic','freakish','');
+INSERT INTO t2 VALUES (587,158501,29,'grammatic','voltage','index','FAS');
+INSERT INTO t2 VALUES (588,160301,29,'helmsman','sash','commercially','');
+INSERT INTO t2 VALUES (589,166101,50,'uniform','anaerobic','mistiness','A');
+INSERT INTO t2 VALUES (590,166102,50,'hamming','simultaneous','endpoint','');
+INSERT INTO t2 VALUES (591,168001,29,'disobedience','accumulating','straight','A');
+INSERT INTO t2 VALUES (592,168002,29,'captivated','Medusan','flurried','');
+INSERT INTO t2 VALUES (593,168003,29,'transferals','shouted','denotative','A');
+INSERT INTO t2 VALUES (594,168101,29,'cartographer','freakish','coming','FAS');
+INSERT INTO t2 VALUES (595,168102,29,'aims','index','commencements','FAS');
+INSERT INTO t2 VALUES (596,168103,29,'Pakistani','commercially','gentleman','');
+INSERT INTO t2 VALUES (597,168104,29,'burglarized','mistiness','gifted','');
+INSERT INTO t2 VALUES (598,168202,29,'saucepans','endpoint','Shanghais','');
+INSERT INTO t2 VALUES (599,168301,29,'lacerating','straight','sportswriting','A');
+INSERT INTO t2 VALUES (600,168502,29,'corny','flurried','sloping','A');
+INSERT INTO t2 VALUES (601,168503,29,'megabytes','denotative','navies','');
+INSERT INTO t2 VALUES (602,168601,29,'chancellor','coming','leaflet','A');
+INSERT INTO t2 VALUES (603,173001,40,'bulk','commencements','shooter','');
+INSERT INTO t2 VALUES (604,173701,40,'commits','gentleman','Joplin','FAS');
+INSERT INTO t2 VALUES (605,173702,40,'meson','gifted','babies','');
+INSERT INTO t2 VALUES (606,176001,40,'deputies','Shanghais','subdivision','FAS');
+INSERT INTO t2 VALUES (607,176101,40,'northeaster','sportswriting','burstiness','W');
+INSERT INTO t2 VALUES (608,176201,40,'dipole','sloping','belted','FAS');
+INSERT INTO t2 VALUES (609,176401,40,'machining','navies','assails','FAS');
+INSERT INTO t2 VALUES (610,176501,40,'therefore','leaflet','admiring','W');
+INSERT INTO t2 VALUES (611,176601,40,'Telefunken','shooter','swaying','0');
+INSERT INTO t2 VALUES (612,176602,40,'salvaging','Joplin','Goldstine','FAS');
+INSERT INTO t2 VALUES (613,176603,40,'Corinthianizes','babies','fitting','');
+INSERT INTO t2 VALUES (614,178001,40,'restlessly','subdivision','Norwalk','W');
+INSERT INTO t2 VALUES (615,178002,40,'bromides','burstiness','weakening','W');
+INSERT INTO t2 VALUES (616,178003,40,'generalized','belted','analogy','FAS');
+INSERT INTO t2 VALUES (617,178004,40,'mishaps','assails','deludes','');
+INSERT INTO t2 VALUES (618,178005,40,'quelling','admiring','cokes','');
+INSERT INTO t2 VALUES (619,178006,40,'spiritual','swaying','Clayton','');
+INSERT INTO t2 VALUES (620,178007,40,'beguiles','Goldstine','exhausts','');
+INSERT INTO t2 VALUES (621,178008,40,'Trobriand','fitting','causality','');
+INSERT INTO t2 VALUES (622,178101,40,'fleeing','Norwalk','sating','FAS');
+INSERT INTO t2 VALUES (623,178102,40,'Armour','weakening','icon','');
+INSERT INTO t2 VALUES (624,178103,40,'chin','analogy','throttles','');
+INSERT INTO t2 VALUES (625,178201,40,'provers','deludes','communicants','FAS');
+INSERT INTO t2 VALUES (626,178202,40,'aeronautic','cokes','dehydrate','FAS');
+INSERT INTO t2 VALUES (627,178301,40,'voltage','Clayton','priceless','FAS');
+INSERT INTO t2 VALUES (628,178302,40,'sash','exhausts','publicly','');
+INSERT INTO t2 VALUES (629,178401,40,'anaerobic','causality','incidentals','FAS');
+INSERT INTO t2 VALUES (630,178402,40,'simultaneous','sating','commonplace','');
+INSERT INTO t2 VALUES (631,178403,40,'accumulating','icon','mumbles','');
+INSERT INTO t2 VALUES (632,178404,40,'Medusan','throttles','furthermore','W');
+INSERT INTO t2 VALUES (633,178501,40,'shouted','communicants','cautioned','W');
+INSERT INTO t2 VALUES (634,186002,37,'freakish','dehydrate','parametrized','A');
+INSERT INTO t2 VALUES (635,186102,37,'index','priceless','registration','A');
+INSERT INTO t2 VALUES (636,186201,40,'commercially','publicly','sadly','FAS');
+INSERT INTO t2 VALUES (637,186202,40,'mistiness','incidentals','positioning','');
+INSERT INTO t2 VALUES (638,186203,40,'endpoint','commonplace','babysitting','');
+INSERT INTO t2 VALUES (639,186302,37,'straight','mumbles','eternal','A');
+INSERT INTO t2 VALUES (640,188007,37,'flurried','furthermore','hoarder','');
+INSERT INTO t2 VALUES (641,188008,37,'denotative','cautioned','congregates','');
+INSERT INTO t2 VALUES (642,188009,37,'coming','parametrized','rains','');
+INSERT INTO t2 VALUES (643,188010,37,'commencements','registration','workers','W');
+INSERT INTO t2 VALUES (644,188011,37,'gentleman','sadly','sags','A');
+INSERT INTO t2 VALUES (645,188012,37,'gifted','positioning','unplug','W');
+INSERT INTO t2 VALUES (646,188013,37,'Shanghais','babysitting','garage','A');
+INSERT INTO t2 VALUES (647,188014,37,'sportswriting','eternal','boulder','A');
+INSERT INTO t2 VALUES (648,188015,37,'sloping','hoarder','hollowly','A');
+INSERT INTO t2 VALUES (649,188016,37,'navies','congregates','specifics','');
+INSERT INTO t2 VALUES (650,188017,37,'leaflet','rains','Teresa','');
+INSERT INTO t2 VALUES (651,188102,37,'shooter','workers','Winsett','');
+INSERT INTO t2 VALUES (652,188103,37,'Joplin','sags','convenient','A');
+INSERT INTO t2 VALUES (653,188202,37,'babies','unplug','buckboards','FAS');
+INSERT INTO t2 VALUES (654,188301,40,'subdivision','garage','amenities','');
+INSERT INTO t2 VALUES (655,188302,40,'burstiness','boulder','resplendent','FAS');
+INSERT INTO t2 VALUES (656,188303,40,'belted','hollowly','priding','FAS');
+INSERT INTO t2 VALUES (657,188401,37,'assails','specifics','configurations','');
+INSERT INTO t2 VALUES (658,188402,37,'admiring','Teresa','untidiness','A');
+INSERT INTO t2 VALUES (659,188503,37,'swaying','Winsett','Brice','W');
+INSERT INTO t2 VALUES (660,188504,37,'Goldstine','convenient','sews','FAS');
+INSERT INTO t2 VALUES (661,188505,37,'fitting','buckboards','participated','');
+INSERT INTO t2 VALUES (662,190701,37,'Norwalk','amenities','Simon','FAS');
+INSERT INTO t2 VALUES (663,190703,50,'weakening','resplendent','certificates','');
+INSERT INTO t2 VALUES (664,191701,37,'analogy','priding','Fitzpatrick','');
+INSERT INTO t2 VALUES (665,191702,37,'deludes','configurations','Evanston','A');
+INSERT INTO t2 VALUES (666,191703,37,'cokes','untidiness','misted','');
+INSERT INTO t2 VALUES (667,196001,37,'Clayton','Brice','textures','A');
+INSERT INTO t2 VALUES (668,196002,37,'exhausts','sews','save','');
+INSERT INTO t2 VALUES (669,196003,37,'causality','participated','count','');
+INSERT INTO t2 VALUES (670,196101,37,'sating','Simon','rightful','A');
+INSERT INTO t2 VALUES (671,196103,37,'icon','certificates','chaperone','');
+INSERT INTO t2 VALUES (672,196104,37,'throttles','Fitzpatrick','Lizzy','A');
+INSERT INTO t2 VALUES (673,196201,37,'communicants','Evanston','clenched','A');
+INSERT INTO t2 VALUES (674,196202,37,'dehydrate','misted','effortlessly','');
+INSERT INTO t2 VALUES (675,196203,37,'priceless','textures','accessed','');
+INSERT INTO t2 VALUES (676,198001,37,'publicly','save','beaters','A');
+INSERT INTO t2 VALUES (677,198003,37,'incidentals','count','Hornblower','FAS');
+INSERT INTO t2 VALUES (678,198004,37,'commonplace','rightful','vests','A');
+INSERT INTO t2 VALUES (679,198005,37,'mumbles','chaperone','indulgences','FAS');
+INSERT INTO t2 VALUES (680,198006,37,'furthermore','Lizzy','infallibly','A');
+INSERT INTO t2 VALUES (681,198007,37,'cautioned','clenched','unwilling','FAS');
+INSERT INTO t2 VALUES (682,198008,37,'parametrized','effortlessly','excrete','FAS');
+INSERT INTO t2 VALUES (683,198009,37,'registration','accessed','spools','A');
+INSERT INTO t2 VALUES (684,198010,37,'sadly','beaters','crunches','FAS');
+INSERT INTO t2 VALUES (685,198011,37,'positioning','Hornblower','overestimating','FAS');
+INSERT INTO t2 VALUES (686,198012,37,'babysitting','vests','ineffective','');
+INSERT INTO t2 VALUES (687,198013,37,'eternal','indulgences','humiliation','A');
+INSERT INTO t2 VALUES (688,198014,37,'hoarder','infallibly','sophomore','');
+INSERT INTO t2 VALUES (689,198015,37,'congregates','unwilling','star','');
+INSERT INTO t2 VALUES (690,198017,37,'rains','excrete','rifles','');
+INSERT INTO t2 VALUES (691,198018,37,'workers','spools','dialysis','');
+INSERT INTO t2 VALUES (692,198019,37,'sags','crunches','arriving','');
+INSERT INTO t2 VALUES (693,198020,37,'unplug','overestimating','indulge','');
+INSERT INTO t2 VALUES (694,198021,37,'garage','ineffective','clockers','');
+INSERT INTO t2 VALUES (695,198022,37,'boulder','humiliation','languages','');
+INSERT INTO t2 VALUES (696,198023,50,'hollowly','sophomore','Antarctica','A');
+INSERT INTO t2 VALUES (697,198024,37,'specifics','star','percentage','');
+INSERT INTO t2 VALUES (698,198101,37,'Teresa','rifles','ceiling','A');
+INSERT INTO t2 VALUES (699,198103,37,'Winsett','dialysis','specification','');
+INSERT INTO t2 VALUES (700,198105,37,'convenient','arriving','regimented','A');
+INSERT INTO t2 VALUES (701,198106,37,'buckboards','indulge','ciphers','');
+INSERT INTO t2 VALUES (702,198201,37,'amenities','clockers','pictures','A');
+INSERT INTO t2 VALUES (703,198204,37,'resplendent','languages','serpents','A');
+INSERT INTO t2 VALUES (704,198301,53,'priding','Antarctica','allot','A');
+INSERT INTO t2 VALUES (705,198302,53,'configurations','percentage','realized','A');
+INSERT INTO t2 VALUES (706,198303,53,'untidiness','ceiling','mayoral','A');
+INSERT INTO t2 VALUES (707,198304,53,'Brice','specification','opaquely','A');
+INSERT INTO t2 VALUES (708,198401,37,'sews','regimented','hostess','FAS');
+INSERT INTO t2 VALUES (709,198402,37,'participated','ciphers','fiftieth','');
+INSERT INTO t2 VALUES (710,198403,37,'Simon','pictures','incorrectly','');
+INSERT INTO t2 VALUES (711,202101,37,'certificates','serpents','decomposition','FAS');
+INSERT INTO t2 VALUES (712,202301,37,'Fitzpatrick','allot','stranglings','');
+INSERT INTO t2 VALUES (713,202302,37,'Evanston','realized','mixture','FAS');
+INSERT INTO t2 VALUES (714,202303,37,'misted','mayoral','electroencephalography','FAS');
+INSERT INTO t2 VALUES (715,202304,37,'textures','opaquely','similarities','FAS');
+INSERT INTO t2 VALUES (716,202305,37,'save','hostess','charges','W');
+INSERT INTO t2 VALUES (717,202601,37,'count','fiftieth','freest','FAS');
+INSERT INTO t2 VALUES (718,202602,37,'rightful','incorrectly','Greenberg','FAS');
+INSERT INTO t2 VALUES (719,202605,37,'chaperone','decomposition','tinting','');
+INSERT INTO t2 VALUES (720,202606,37,'Lizzy','stranglings','expelled','W');
+INSERT INTO t2 VALUES (721,202607,37,'clenched','mixture','warm','');
+INSERT INTO t2 VALUES (722,202901,37,'effortlessly','electroencephalography','smoothed','');
+INSERT INTO t2 VALUES (723,202902,37,'accessed','similarities','deductions','FAS');
+INSERT INTO t2 VALUES (724,202903,37,'beaters','charges','Romano','W');
+INSERT INTO t2 VALUES (725,202904,37,'Hornblower','freest','bitterroot','');
+INSERT INTO t2 VALUES (726,202907,37,'vests','Greenberg','corset','');
+INSERT INTO t2 VALUES (727,202908,37,'indulgences','tinting','securing','');
+INSERT INTO t2 VALUES (728,203101,37,'infallibly','expelled','environing','FAS');
+INSERT INTO t2 VALUES (729,203103,37,'unwilling','warm','cute','');
+INSERT INTO t2 VALUES (730,203104,37,'excrete','smoothed','Crays','');
+INSERT INTO t2 VALUES (731,203105,37,'spools','deductions','heiress','FAS');
+INSERT INTO t2 VALUES (732,203401,37,'crunches','Romano','inform','FAS');
+INSERT INTO t2 VALUES (733,203402,37,'overestimating','bitterroot','avenge','');
+INSERT INTO t2 VALUES (734,203404,37,'ineffective','corset','universals','');
+INSERT INTO t2 VALUES (735,203901,37,'humiliation','securing','Kinsey','W');
+INSERT INTO t2 VALUES (736,203902,37,'sophomore','environing','ravines','FAS');
+INSERT INTO t2 VALUES (737,203903,37,'star','cute','bestseller','');
+INSERT INTO t2 VALUES (738,203906,37,'rifles','Crays','equilibrium','');
+INSERT INTO t2 VALUES (739,203907,37,'dialysis','heiress','extents','0');
+INSERT INTO t2 VALUES (740,203908,37,'arriving','inform','relatively','');
+INSERT INTO t2 VALUES (741,203909,37,'indulge','avenge','pressure','FAS');
+INSERT INTO t2 VALUES (742,206101,37,'clockers','universals','critiques','FAS');
+INSERT INTO t2 VALUES (743,206201,37,'languages','Kinsey','befouled','');
+INSERT INTO t2 VALUES (744,206202,37,'Antarctica','ravines','rightfully','FAS');
+INSERT INTO t2 VALUES (745,206203,37,'percentage','bestseller','mechanizing','FAS');
+INSERT INTO t2 VALUES (746,206206,37,'ceiling','equilibrium','Latinizes','');
+INSERT INTO t2 VALUES (747,206207,37,'specification','extents','timesharing','');
+INSERT INTO t2 VALUES (748,206208,37,'regimented','relatively','Aden','');
+INSERT INTO t2 VALUES (749,208001,37,'ciphers','pressure','embassies','');
+INSERT INTO t2 VALUES (750,208002,37,'pictures','critiques','males','FAS');
+INSERT INTO t2 VALUES (751,208003,37,'serpents','befouled','shapelessly','FAS');
+INSERT INTO t2 VALUES (752,208004,37,'allot','rightfully','genres','FAS');
+INSERT INTO t2 VALUES (753,208008,37,'realized','mechanizing','mastering','');
+INSERT INTO t2 VALUES (754,208009,37,'mayoral','Latinizes','Newtonian','');
+INSERT INTO t2 VALUES (755,208010,37,'opaquely','timesharing','finishers','FAS');
+INSERT INTO t2 VALUES (756,208011,37,'hostess','Aden','abates','');
+INSERT INTO t2 VALUES (757,208101,37,'fiftieth','embassies','teem','');
+INSERT INTO t2 VALUES (758,208102,37,'incorrectly','males','kiting','FAS');
+INSERT INTO t2 VALUES (759,208103,37,'decomposition','shapelessly','stodgy','FAS');
+INSERT INTO t2 VALUES (760,208104,37,'stranglings','genres','scalps','FAS');
+INSERT INTO t2 VALUES (761,208105,37,'mixture','mastering','feed','FAS');
+INSERT INTO t2 VALUES (762,208110,37,'electroencephalography','Newtonian','guitars','');
+INSERT INTO t2 VALUES (763,208111,37,'similarities','finishers','airships','');
+INSERT INTO t2 VALUES (764,208112,37,'charges','abates','store','');
+INSERT INTO t2 VALUES (765,208113,37,'freest','teem','denounces','');
+INSERT INTO t2 VALUES (766,208201,37,'Greenberg','kiting','Pyle','FAS');
+INSERT INTO t2 VALUES (767,208203,37,'tinting','stodgy','Saxony','');
+INSERT INTO t2 VALUES (768,208301,37,'expelled','scalps','serializations','FAS');
+INSERT INTO t2 VALUES (769,208302,37,'warm','feed','Peruvian','FAS');
+INSERT INTO t2 VALUES (770,208305,37,'smoothed','guitars','taxonomically','FAS');
+INSERT INTO t2 VALUES (771,208401,37,'deductions','airships','kingdom','A');
+INSERT INTO t2 VALUES (772,208402,37,'Romano','store','stint','A');
+INSERT INTO t2 VALUES (773,208403,37,'bitterroot','denounces','Sault','A');
+INSERT INTO t2 VALUES (774,208404,37,'corset','Pyle','faithful','');
+INSERT INTO t2 VALUES (775,208501,37,'securing','Saxony','Ganymede','FAS');
+INSERT INTO t2 VALUES (776,208502,37,'environing','serializations','tidiness','FAS');
+INSERT INTO t2 VALUES (777,208503,37,'cute','Peruvian','gainful','FAS');
+INSERT INTO t2 VALUES (778,208504,37,'Crays','taxonomically','contrary','FAS');
+INSERT INTO t2 VALUES (779,208505,37,'heiress','kingdom','Tipperary','FAS');
+INSERT INTO t2 VALUES (780,210101,37,'inform','stint','tropics','W');
+INSERT INTO t2 VALUES (781,210102,37,'avenge','Sault','theorizers','');
+INSERT INTO t2 VALUES (782,210103,37,'universals','faithful','renew','0');
+INSERT INTO t2 VALUES (783,210104,37,'Kinsey','Ganymede','already','');
+INSERT INTO t2 VALUES (784,210105,37,'ravines','tidiness','terminal','');
+INSERT INTO t2 VALUES (785,210106,37,'bestseller','gainful','Hegelian','');
+INSERT INTO t2 VALUES (786,210107,37,'equilibrium','contrary','hypothesizer','');
+INSERT INTO t2 VALUES (787,210401,37,'extents','Tipperary','warningly','FAS');
+INSERT INTO t2 VALUES (788,213201,37,'relatively','tropics','journalizing','FAS');
+INSERT INTO t2 VALUES (789,213203,37,'pressure','theorizers','nested','');
+INSERT INTO t2 VALUES (790,213204,37,'critiques','renew','Lars','');
+INSERT INTO t2 VALUES (791,213205,37,'befouled','already','saplings','');
+INSERT INTO t2 VALUES (792,213206,37,'rightfully','terminal','foothill','');
+INSERT INTO t2 VALUES (793,213207,37,'mechanizing','Hegelian','labeled','');
+INSERT INTO t2 VALUES (794,216101,37,'Latinizes','hypothesizer','imperiously','FAS');
+INSERT INTO t2 VALUES (795,216103,37,'timesharing','warningly','reporters','FAS');
+INSERT INTO t2 VALUES (796,218001,37,'Aden','journalizing','furnishings','FAS');
+INSERT INTO t2 VALUES (797,218002,37,'embassies','nested','precipitable','FAS');
+INSERT INTO t2 VALUES (798,218003,37,'males','Lars','discounts','FAS');
+INSERT INTO t2 VALUES (799,218004,37,'shapelessly','saplings','excises','FAS');
+INSERT INTO t2 VALUES (800,143503,50,'genres','foothill','Stalin','');
+INSERT INTO t2 VALUES (801,218006,37,'mastering','labeled','despot','FAS');
+INSERT INTO t2 VALUES (802,218007,37,'Newtonian','imperiously','ripeness','FAS');
+INSERT INTO t2 VALUES (803,218008,37,'finishers','reporters','Arabia','');
+INSERT INTO t2 VALUES (804,218009,37,'abates','furnishings','unruly','');
+INSERT INTO t2 VALUES (805,218010,37,'teem','precipitable','mournfulness','');
+INSERT INTO t2 VALUES (806,218011,37,'kiting','discounts','boom','FAS');
+INSERT INTO t2 VALUES (807,218020,37,'stodgy','excises','slaughter','A');
+INSERT INTO t2 VALUES (808,218021,50,'scalps','Stalin','Sabine','');
+INSERT INTO t2 VALUES (809,218022,37,'feed','despot','handy','FAS');
+INSERT INTO t2 VALUES (810,218023,37,'guitars','ripeness','rural','');
+INSERT INTO t2 VALUES (811,218024,37,'airships','Arabia','organizer','');
+INSERT INTO t2 VALUES (812,218101,37,'store','unruly','shipyard','FAS');
+INSERT INTO t2 VALUES (813,218102,37,'denounces','mournfulness','civics','FAS');
+INSERT INTO t2 VALUES (814,218103,37,'Pyle','boom','inaccuracy','FAS');
+INSERT INTO t2 VALUES (815,218201,37,'Saxony','slaughter','rules','FAS');
+INSERT INTO t2 VALUES (816,218202,37,'serializations','Sabine','juveniles','FAS');
+INSERT INTO t2 VALUES (817,218203,37,'Peruvian','handy','comprised','W');
+INSERT INTO t2 VALUES (818,218204,37,'taxonomically','rural','investigations','');
+INSERT INTO t2 VALUES (819,218205,37,'kingdom','organizer','stabilizes','A');
+INSERT INTO t2 VALUES (820,218301,37,'stint','shipyard','seminaries','FAS');
+INSERT INTO t2 VALUES (821,218302,37,'Sault','civics','Hunter','A');
+INSERT INTO t2 VALUES (822,218401,37,'faithful','inaccuracy','sporty','FAS');
+INSERT INTO t2 VALUES (823,218402,37,'Ganymede','rules','test','FAS');
+INSERT INTO t2 VALUES (824,218403,37,'tidiness','juveniles','weasels','');
+INSERT INTO t2 VALUES (825,218404,37,'gainful','comprised','CERN','');
+INSERT INTO t2 VALUES (826,218407,37,'contrary','investigations','tempering','');
+INSERT INTO t2 VALUES (827,218408,37,'Tipperary','stabilizes','afore','FAS');
+INSERT INTO t2 VALUES (828,218409,37,'tropics','seminaries','Galatean','');
+INSERT INTO t2 VALUES (829,218410,37,'theorizers','Hunter','techniques','W');
+INSERT INTO t2 VALUES (830,226001,37,'renew','sporty','error','');
+INSERT INTO t2 VALUES (831,226002,37,'already','test','veranda','');
+INSERT INTO t2 VALUES (832,226003,37,'terminal','weasels','severely','');
+INSERT INTO t2 VALUES (833,226004,37,'Hegelian','CERN','Cassites','FAS');
+INSERT INTO t2 VALUES (834,226005,37,'hypothesizer','tempering','forthcoming','');
+INSERT INTO t2 VALUES (835,226006,37,'warningly','afore','guides','');
+INSERT INTO t2 VALUES (836,226007,37,'journalizing','Galatean','vanish','FAS');
+INSERT INTO t2 VALUES (837,226008,37,'nested','techniques','lied','A');
+INSERT INTO t2 VALUES (838,226203,37,'Lars','error','sawtooth','FAS');
+INSERT INTO t2 VALUES (839,226204,37,'saplings','veranda','fated','FAS');
+INSERT INTO t2 VALUES (840,226205,37,'foothill','severely','gradually','');
+INSERT INTO t2 VALUES (841,226206,37,'labeled','Cassites','widens','');
+INSERT INTO t2 VALUES (842,226207,37,'imperiously','forthcoming','preclude','');
+INSERT INTO t2 VALUES (843,226208,37,'reporters','guides','Jobrel','');
+INSERT INTO t2 VALUES (844,226209,37,'furnishings','vanish','hooker','');
+INSERT INTO t2 VALUES (845,226210,37,'precipitable','lied','rainstorm','');
+INSERT INTO t2 VALUES (846,226211,37,'discounts','sawtooth','disconnects','');
+INSERT INTO t2 VALUES (847,228001,37,'excises','fated','cruelty','');
+INSERT INTO t2 VALUES (848,228004,37,'Stalin','gradually','exponentials','A');
+INSERT INTO t2 VALUES (849,228005,37,'despot','widens','affective','A');
+INSERT INTO t2 VALUES (850,228006,37,'ripeness','preclude','arteries','');
+INSERT INTO t2 VALUES (851,228007,37,'Arabia','Jobrel','Crosby','FAS');
+INSERT INTO t2 VALUES (852,228008,37,'unruly','hooker','acquaint','');
+INSERT INTO t2 VALUES (853,228009,37,'mournfulness','rainstorm','evenhandedly','');
+INSERT INTO t2 VALUES (854,228101,37,'boom','disconnects','percentage','');
+INSERT INTO t2 VALUES (855,228108,37,'slaughter','cruelty','disobedience','');
+INSERT INTO t2 VALUES (856,228109,37,'Sabine','exponentials','humility','');
+INSERT INTO t2 VALUES (857,228110,37,'handy','affective','gleaning','A');
+INSERT INTO t2 VALUES (858,228111,37,'rural','arteries','petted','A');
+INSERT INTO t2 VALUES (859,228112,37,'organizer','Crosby','bloater','A');
+INSERT INTO t2 VALUES (860,228113,37,'shipyard','acquaint','minion','A');
+INSERT INTO t2 VALUES (861,228114,37,'civics','evenhandedly','marginal','A');
+INSERT INTO t2 VALUES (862,228115,37,'inaccuracy','percentage','apiary','A');
+INSERT INTO t2 VALUES (863,228116,37,'rules','disobedience','measures','');
+INSERT INTO t2 VALUES (864,228117,37,'juveniles','humility','precaution','');
+INSERT INTO t2 VALUES (865,228118,37,'comprised','gleaning','repelled','');
+INSERT INTO t2 VALUES (866,228119,37,'investigations','petted','primary','FAS');
+INSERT INTO t2 VALUES (867,228120,37,'stabilizes','bloater','coverings','');
+INSERT INTO t2 VALUES (868,228121,37,'seminaries','minion','Artemia','A');
+INSERT INTO t2 VALUES (869,228122,37,'Hunter','marginal','navigate','');
+INSERT INTO t2 VALUES (870,228201,37,'sporty','apiary','spatial','');
+INSERT INTO t2 VALUES (871,228206,37,'test','measures','Gurkha','');
+INSERT INTO t2 VALUES (872,228207,37,'weasels','precaution','meanwhile','A');
+INSERT INTO t2 VALUES (873,228208,37,'CERN','repelled','Melinda','A');
+INSERT INTO t2 VALUES (874,228209,37,'tempering','primary','Butterfield','');
+INSERT INTO t2 VALUES (875,228210,37,'afore','coverings','Aldrich','A');
+INSERT INTO t2 VALUES (876,228211,37,'Galatean','Artemia','previewing','A');
+INSERT INTO t2 VALUES (877,228212,37,'techniques','navigate','glut','A');
+INSERT INTO t2 VALUES (878,228213,37,'error','spatial','unaffected','');
+INSERT INTO t2 VALUES (879,228214,37,'veranda','Gurkha','inmate','');
+INSERT INTO t2 VALUES (880,228301,37,'severely','meanwhile','mineral','');
+INSERT INTO t2 VALUES (881,228305,37,'Cassites','Melinda','impending','A');
+INSERT INTO t2 VALUES (882,228306,37,'forthcoming','Butterfield','meditation','A');
+INSERT INTO t2 VALUES (883,228307,37,'guides','Aldrich','ideas','');
+INSERT INTO t2 VALUES (884,228308,37,'vanish','previewing','miniaturizes','W');
+INSERT INTO t2 VALUES (885,228309,37,'lied','glut','lewdly','');
+INSERT INTO t2 VALUES (886,228310,37,'sawtooth','unaffected','title','');
+INSERT INTO t2 VALUES (887,228311,37,'fated','inmate','youthfulness','');
+INSERT INTO t2 VALUES (888,228312,37,'gradually','mineral','creak','FAS');
+INSERT INTO t2 VALUES (889,228313,37,'widens','impending','Chippewa','');
+INSERT INTO t2 VALUES (890,228314,37,'preclude','meditation','clamored','');
+INSERT INTO t2 VALUES (891,228401,65,'Jobrel','ideas','freezes','');
+INSERT INTO t2 VALUES (892,228402,65,'hooker','miniaturizes','forgivably','FAS');
+INSERT INTO t2 VALUES (893,228403,65,'rainstorm','lewdly','reduce','FAS');
+INSERT INTO t2 VALUES (894,228404,65,'disconnects','title','McGovern','W');
+INSERT INTO t2 VALUES (895,228405,65,'cruelty','youthfulness','Nazis','W');
+INSERT INTO t2 VALUES (896,228406,65,'exponentials','creak','epistle','W');
+INSERT INTO t2 VALUES (897,228407,65,'affective','Chippewa','socializes','W');
+INSERT INTO t2 VALUES (898,228408,65,'arteries','clamored','conceptions','');
+INSERT INTO t2 VALUES (899,228409,65,'Crosby','freezes','Kevin','');
+INSERT INTO t2 VALUES (900,228410,65,'acquaint','forgivably','uncovering','');
+INSERT INTO t2 VALUES (901,230301,37,'evenhandedly','reduce','chews','FAS');
+INSERT INTO t2 VALUES (902,230302,37,'percentage','McGovern','appendixes','FAS');
+INSERT INTO t2 VALUES (903,230303,37,'disobedience','Nazis','raining','');
+INSERT INTO t2 VALUES (904,018062,37,'humility','epistle','infest','');
+INSERT INTO t2 VALUES (905,230501,37,'gleaning','socializes','compartment','');
+INSERT INTO t2 VALUES (906,230502,37,'petted','conceptions','minting','');
+INSERT INTO t2 VALUES (907,230503,37,'bloater','Kevin','ducks','');
+INSERT INTO t2 VALUES (908,230504,37,'minion','uncovering','roped','A');
+INSERT INTO t2 VALUES (909,230505,37,'marginal','chews','waltz','');
+INSERT INTO t2 VALUES (910,230506,37,'apiary','appendixes','Lillian','');
+INSERT INTO t2 VALUES (911,230507,37,'measures','raining','repressions','A');
+INSERT INTO t2 VALUES (912,230508,37,'precaution','infest','chillingly','');
+INSERT INTO t2 VALUES (913,230509,37,'repelled','compartment','noncritical','');
+INSERT INTO t2 VALUES (914,230901,37,'primary','minting','lithograph','');
+INSERT INTO t2 VALUES (915,230902,37,'coverings','ducks','spongers','');
+INSERT INTO t2 VALUES (916,230903,37,'Artemia','roped','parenthood','');
+INSERT INTO t2 VALUES (917,230904,37,'navigate','waltz','posed','');
+INSERT INTO t2 VALUES (918,230905,37,'spatial','Lillian','instruments','');
+INSERT INTO t2 VALUES (919,230906,37,'Gurkha','repressions','filial','');
+INSERT INTO t2 VALUES (920,230907,37,'meanwhile','chillingly','fixedly','');
+INSERT INTO t2 VALUES (921,230908,37,'Melinda','noncritical','relives','');
+INSERT INTO t2 VALUES (922,230909,37,'Butterfield','lithograph','Pandora','');
+INSERT INTO t2 VALUES (923,230910,37,'Aldrich','spongers','watering','A');
+INSERT INTO t2 VALUES (924,230911,37,'previewing','parenthood','ungrateful','');
+INSERT INTO t2 VALUES (925,230912,37,'glut','posed','secures','');
+INSERT INTO t2 VALUES (926,230913,37,'unaffected','instruments','chastisers','');
+INSERT INTO t2 VALUES (927,230914,37,'inmate','filial','icon','');
+INSERT INTO t2 VALUES (928,231304,37,'mineral','fixedly','reuniting','A');
+INSERT INTO t2 VALUES (929,231305,37,'impending','relives','imagining','A');
+INSERT INTO t2 VALUES (930,231306,37,'meditation','Pandora','abiding','A');
+INSERT INTO t2 VALUES (931,231307,37,'ideas','watering','omnisciently','');
+INSERT INTO t2 VALUES (932,231308,37,'miniaturizes','ungrateful','Britannic','');
+INSERT INTO t2 VALUES (933,231309,37,'lewdly','secures','scholastics','A');
+INSERT INTO t2 VALUES (934,231310,37,'title','chastisers','mechanics','A');
+INSERT INTO t2 VALUES (935,231311,37,'youthfulness','icon','humidly','A');
+INSERT INTO t2 VALUES (936,231312,37,'creak','reuniting','masterpiece','');
+INSERT INTO t2 VALUES (937,231313,37,'Chippewa','imagining','however','');
+INSERT INTO t2 VALUES (938,231314,37,'clamored','abiding','Mendelian','');
+INSERT INTO t2 VALUES (939,231315,37,'freezes','omnisciently','jarred','');
+INSERT INTO t2 VALUES (940,232102,37,'forgivably','Britannic','scolds','');
+INSERT INTO t2 VALUES (941,232103,37,'reduce','scholastics','infatuate','');
+INSERT INTO t2 VALUES (942,232104,37,'McGovern','mechanics','willed','A');
+INSERT INTO t2 VALUES (943,232105,37,'Nazis','humidly','joyfully','');
+INSERT INTO t2 VALUES (944,232106,37,'epistle','masterpiece','Microsoft','');
+INSERT INTO t2 VALUES (945,232107,37,'socializes','however','fibrosities','');
+INSERT INTO t2 VALUES (946,232108,37,'conceptions','Mendelian','Baltimorean','');
+INSERT INTO t2 VALUES (947,232601,37,'Kevin','jarred','equestrian','');
+INSERT INTO t2 VALUES (948,232602,37,'uncovering','scolds','Goodrich','');
+INSERT INTO t2 VALUES (949,232603,37,'chews','infatuate','apish','A');
+INSERT INTO t2 VALUES (950,232605,37,'appendixes','willed','Adlerian','');
+INSERT INTO t2 VALUES (5950,1232605,37,'appendixes','willed','Adlerian','');
+INSERT INTO t2 VALUES (5951,1232606,37,'appendixes','willed','Adlerian','');
+INSERT INTO t2 VALUES (5952,1232607,37,'appendixes','willed','Adlerian','');
+INSERT INTO t2 VALUES (5953,1232608,37,'appendixes','willed','Adlerian','');
+INSERT INTO t2 VALUES (5954,1232609,37,'appendixes','willed','Adlerian','');
+INSERT INTO t2 VALUES (951,232606,37,'raining','joyfully','Tropez','');
+INSERT INTO t2 VALUES (952,232607,37,'infest','Microsoft','nouns','');
+INSERT INTO t2 VALUES (953,232608,37,'compartment','fibrosities','distracting','');
+INSERT INTO t2 VALUES (954,232609,37,'minting','Baltimorean','mutton','');
+INSERT INTO t2 VALUES (955,236104,37,'ducks','equestrian','bridgeable','A');
+INSERT INTO t2 VALUES (956,236105,37,'roped','Goodrich','stickers','A');
+INSERT INTO t2 VALUES (957,236106,37,'waltz','apish','transcontinental','A');
+INSERT INTO t2 VALUES (958,236107,37,'Lillian','Adlerian','amateurish','');
+INSERT INTO t2 VALUES (959,236108,37,'repressions','Tropez','Gandhian','');
+INSERT INTO t2 VALUES (960,236109,37,'chillingly','nouns','stratified','');
+INSERT INTO t2 VALUES (961,236110,37,'noncritical','distracting','chamberlains','');
+INSERT INTO t2 VALUES (962,236111,37,'lithograph','mutton','creditably','');
+INSERT INTO t2 VALUES (963,236112,37,'spongers','bridgeable','philosophic','');
+INSERT INTO t2 VALUES (964,236113,37,'parenthood','stickers','ores','');
+INSERT INTO t2 VALUES (965,238005,37,'posed','transcontinental','Carleton','');
+INSERT INTO t2 VALUES (966,238006,37,'instruments','amateurish','tape','A');
+INSERT INTO t2 VALUES (967,238007,37,'filial','Gandhian','afloat','A');
+INSERT INTO t2 VALUES (968,238008,37,'fixedly','stratified','goodness','A');
+INSERT INTO t2 VALUES (969,238009,37,'relives','chamberlains','welcoming','');
+INSERT INTO t2 VALUES (970,238010,37,'Pandora','creditably','Pinsky','FAS');
+INSERT INTO t2 VALUES (971,238011,37,'watering','philosophic','halting','');
+INSERT INTO t2 VALUES (972,238012,37,'ungrateful','ores','bibliography','');
+INSERT INTO t2 VALUES (973,238013,37,'secures','Carleton','decoding','');
+INSERT INTO t2 VALUES (974,240401,41,'chastisers','tape','variance','A');
+INSERT INTO t2 VALUES (975,240402,41,'icon','afloat','allowed','A');
+INSERT INTO t2 VALUES (976,240901,41,'reuniting','goodness','dire','A');
+INSERT INTO t2 VALUES (977,240902,41,'imagining','welcoming','dub','A');
+INSERT INTO t2 VALUES (978,241801,41,'abiding','Pinsky','poisoning','');
+INSERT INTO t2 VALUES (979,242101,41,'omnisciently','halting','Iraqis','A');
+INSERT INTO t2 VALUES (980,242102,41,'Britannic','bibliography','heaving','');
+INSERT INTO t2 VALUES (981,242201,41,'scholastics','decoding','population','A');
+INSERT INTO t2 VALUES (982,242202,41,'mechanics','variance','bomb','A');
+INSERT INTO t2 VALUES (983,242501,41,'humidly','allowed','Majorca','A');
+INSERT INTO t2 VALUES (984,242502,41,'masterpiece','dire','Gershwins','');
+INSERT INTO t2 VALUES (985,246201,41,'however','dub','explorers','');
+INSERT INTO t2 VALUES (986,246202,41,'Mendelian','poisoning','libretto','A');
+INSERT INTO t2 VALUES (987,246203,41,'jarred','Iraqis','occurred','');
+INSERT INTO t2 VALUES (988,246204,41,'scolds','heaving','Lagos','');
+INSERT INTO t2 VALUES (989,246205,41,'infatuate','population','rats','');
+INSERT INTO t2 VALUES (990,246301,41,'willed','bomb','bankruptcies','A');
+INSERT INTO t2 VALUES (991,246302,41,'joyfully','Majorca','crying','');
+INSERT INTO t2 VALUES (992,248001,41,'Microsoft','Gershwins','unexpected','');
+INSERT INTO t2 VALUES (993,248002,41,'fibrosities','explorers','accessed','A');
+INSERT INTO t2 VALUES (994,248003,41,'Baltimorean','libretto','colorful','A');
+INSERT INTO t2 VALUES (995,248004,41,'equestrian','occurred','versatility','A');
+INSERT INTO t2 VALUES (996,248005,41,'Goodrich','Lagos','cosy','');
+INSERT INTO t2 VALUES (997,248006,41,'apish','rats','Darius','A');
+INSERT INTO t2 VALUES (998,248007,41,'Adlerian','bankruptcies','mastering','A');
+INSERT INTO t2 VALUES (999,248008,41,'Tropez','crying','Asiaticizations','A');
+INSERT INTO t2 VALUES (1000,248009,41,'nouns','unexpected','offerers','A');
+INSERT INTO t2 VALUES (1001,248010,41,'distracting','accessed','uncles','A');
+INSERT INTO t2 VALUES (1002,248011,41,'mutton','colorful','sleepwalk','');
+INSERT INTO t2 VALUES (1003,248012,41,'bridgeable','versatility','Ernestine','');
+INSERT INTO t2 VALUES (1004,248013,41,'stickers','cosy','checksumming','');
+INSERT INTO t2 VALUES (1005,248014,41,'transcontinental','Darius','stopped','');
+INSERT INTO t2 VALUES (1006,248015,41,'amateurish','mastering','sicker','');
+INSERT INTO t2 VALUES (1007,248016,41,'Gandhian','Asiaticizations','Italianization','');
+INSERT INTO t2 VALUES (1008,248017,41,'stratified','offerers','alphabetic','');
+INSERT INTO t2 VALUES (1009,248018,41,'chamberlains','uncles','pharmaceutic','');
+INSERT INTO t2 VALUES (1010,248019,41,'creditably','sleepwalk','creator','');
+INSERT INTO t2 VALUES (1011,248020,41,'philosophic','Ernestine','chess','');
+INSERT INTO t2 VALUES (1012,248021,41,'ores','checksumming','charcoal','');
+INSERT INTO t2 VALUES (1013,248101,41,'Carleton','stopped','Epiphany','A');
+INSERT INTO t2 VALUES (1014,248102,41,'tape','sicker','bulldozes','A');
+INSERT INTO t2 VALUES (1015,248201,41,'afloat','Italianization','Pygmalion','A');
+INSERT INTO t2 VALUES (1016,248202,41,'goodness','alphabetic','caressing','A');
+INSERT INTO t2 VALUES (1017,248203,41,'welcoming','pharmaceutic','Palestine','A');
+INSERT INTO t2 VALUES (1018,248204,41,'Pinsky','creator','regimented','A');
+INSERT INTO t2 VALUES (1019,248205,41,'halting','chess','scars','A');
+INSERT INTO t2 VALUES (1020,248206,41,'bibliography','charcoal','realest','A');
+INSERT INTO t2 VALUES (1021,248207,41,'decoding','Epiphany','diffusing','A');
+INSERT INTO t2 VALUES (1022,248208,41,'variance','bulldozes','clubroom','A');
+INSERT INTO t2 VALUES (1023,248209,41,'allowed','Pygmalion','Blythe','A');
+INSERT INTO t2 VALUES (1024,248210,41,'dire','caressing','ahead','');
+INSERT INTO t2 VALUES (1025,248211,50,'dub','Palestine','reviver','');
+INSERT INTO t2 VALUES (1026,250501,34,'poisoning','regimented','retransmitting','A');
+INSERT INTO t2 VALUES (1027,250502,34,'Iraqis','scars','landslide','');
+INSERT INTO t2 VALUES (1028,250503,34,'heaving','realest','Eiffel','');
+INSERT INTO t2 VALUES (1029,250504,34,'population','diffusing','absentee','');
+INSERT INTO t2 VALUES (1030,250505,34,'bomb','clubroom','aye','');
+INSERT INTO t2 VALUES (1031,250601,34,'Majorca','Blythe','forked','A');
+INSERT INTO t2 VALUES (1032,250602,34,'Gershwins','ahead','Peruvianizes','');
+INSERT INTO t2 VALUES (1033,250603,34,'explorers','reviver','clerked','');
+INSERT INTO t2 VALUES (1034,250604,34,'libretto','retransmitting','tutor','');
+INSERT INTO t2 VALUES (1035,250605,34,'occurred','landslide','boulevard','');
+INSERT INTO t2 VALUES (1036,251001,34,'Lagos','Eiffel','shuttered','');
+INSERT INTO t2 VALUES (1037,251002,34,'rats','absentee','quotes','A');
+INSERT INTO t2 VALUES (1038,251003,34,'bankruptcies','aye','Caltech','');
+INSERT INTO t2 VALUES (1039,251004,34,'crying','forked','Mossberg','');
+INSERT INTO t2 VALUES (1040,251005,34,'unexpected','Peruvianizes','kept','');
+INSERT INTO t2 VALUES (1041,251301,34,'accessed','clerked','roundly','');
+INSERT INTO t2 VALUES (1042,251302,34,'colorful','tutor','features','A');
+INSERT INTO t2 VALUES (1043,251303,34,'versatility','boulevard','imaginable','A');
+INSERT INTO t2 VALUES (1044,251304,34,'cosy','shuttered','controller','');
+INSERT INTO t2 VALUES (1045,251305,34,'Darius','quotes','racial','');
+INSERT INTO t2 VALUES (1046,251401,34,'mastering','Caltech','uprisings','A');
+INSERT INTO t2 VALUES (1047,251402,34,'Asiaticizations','Mossberg','narrowed','A');
+INSERT INTO t2 VALUES (1048,251403,34,'offerers','kept','cannot','A');
+INSERT INTO t2 VALUES (1049,251404,34,'uncles','roundly','vest','');
+INSERT INTO t2 VALUES (1050,251405,34,'sleepwalk','features','famine','');
+INSERT INTO t2 VALUES (1051,251406,34,'Ernestine','imaginable','sugars','');
+INSERT INTO t2 VALUES (1052,251801,34,'checksumming','controller','exterminated','A');
+INSERT INTO t2 VALUES (1053,251802,34,'stopped','racial','belays','');
+INSERT INTO t2 VALUES (1054,252101,34,'sicker','uprisings','Hodges','A');
+INSERT INTO t2 VALUES (1055,252102,34,'Italianization','narrowed','translatable','');
+INSERT INTO t2 VALUES (1056,252301,34,'alphabetic','cannot','duality','A');
+INSERT INTO t2 VALUES (1057,252302,34,'pharmaceutic','vest','recording','A');
+INSERT INTO t2 VALUES (1058,252303,34,'creator','famine','rouses','A');
+INSERT INTO t2 VALUES (1059,252304,34,'chess','sugars','poison','');
+INSERT INTO t2 VALUES (1060,252305,34,'charcoal','exterminated','attitude','');
+INSERT INTO t2 VALUES (1061,252306,34,'Epiphany','belays','dusted','');
+INSERT INTO t2 VALUES (1062,252307,34,'bulldozes','Hodges','encompasses','');
+INSERT INTO t2 VALUES (1063,252308,34,'Pygmalion','translatable','presentation','');
+INSERT INTO t2 VALUES (1064,252309,34,'caressing','duality','Kantian','');
+INSERT INTO t2 VALUES (1065,256001,34,'Palestine','recording','imprecision','A');
+INSERT INTO t2 VALUES (1066,256002,34,'regimented','rouses','saving','');
+INSERT INTO t2 VALUES (1067,256003,34,'scars','poison','maternal','');
+INSERT INTO t2 VALUES (1068,256004,34,'realest','attitude','hewed','');
+INSERT INTO t2 VALUES (1069,256005,34,'diffusing','dusted','kerosene','');
+INSERT INTO t2 VALUES (1070,258001,34,'clubroom','encompasses','Cubans','');
+INSERT INTO t2 VALUES (1071,258002,34,'Blythe','presentation','photographers','');
+INSERT INTO t2 VALUES (1072,258003,34,'ahead','Kantian','nymph','A');
+INSERT INTO t2 VALUES (1073,258004,34,'reviver','imprecision','bedlam','A');
+INSERT INTO t2 VALUES (1074,258005,34,'retransmitting','saving','north','A');
+INSERT INTO t2 VALUES (1075,258006,34,'landslide','maternal','Schoenberg','A');
+INSERT INTO t2 VALUES (1076,258007,34,'Eiffel','hewed','botany','A');
+INSERT INTO t2 VALUES (1077,258008,34,'absentee','kerosene','curs','');
+INSERT INTO t2 VALUES (1078,258009,34,'aye','Cubans','solidification','');
+INSERT INTO t2 VALUES (1079,258010,34,'forked','photographers','inheritresses','');
+INSERT INTO t2 VALUES (1080,258011,34,'Peruvianizes','nymph','stiller','');
+INSERT INTO t2 VALUES (1081,258101,68,'clerked','bedlam','t1','A');
+INSERT INTO t2 VALUES (1082,258102,68,'tutor','north','suite','A');
+INSERT INTO t2 VALUES (1083,258103,34,'boulevard','Schoenberg','ransomer','');
+INSERT INTO t2 VALUES (1084,258104,68,'shuttered','botany','Willy','');
+INSERT INTO t2 VALUES (1085,258105,68,'quotes','curs','Rena','A');
+INSERT INTO t2 VALUES (1086,258106,68,'Caltech','solidification','Seattle','A');
+INSERT INTO t2 VALUES (1087,258107,68,'Mossberg','inheritresses','relaxes','A');
+INSERT INTO t2 VALUES (1088,258108,68,'kept','stiller','exclaim','');
+INSERT INTO t2 VALUES (1089,258109,68,'roundly','t1','implicated','A');
+INSERT INTO t2 VALUES (1090,258110,68,'features','suite','distinguish','');
+INSERT INTO t2 VALUES (1091,258111,68,'imaginable','ransomer','assayed','');
+INSERT INTO t2 VALUES (1092,258112,68,'controller','Willy','homeowner','');
+INSERT INTO t2 VALUES (1093,258113,68,'racial','Rena','and','');
+INSERT INTO t2 VALUES (1094,258201,34,'uprisings','Seattle','stealth','');
+INSERT INTO t2 VALUES (1095,258202,34,'narrowed','relaxes','coinciding','A');
+INSERT INTO t2 VALUES (1096,258203,34,'cannot','exclaim','founder','A');
+INSERT INTO t2 VALUES (1097,258204,34,'vest','implicated','environing','');
+INSERT INTO t2 VALUES (1098,258205,34,'famine','distinguish','jewelry','');
+INSERT INTO t2 VALUES (1099,258301,34,'sugars','assayed','lemons','A');
+INSERT INTO t2 VALUES (1100,258401,34,'exterminated','homeowner','brokenness','A');
+INSERT INTO t2 VALUES (1101,258402,34,'belays','and','bedpost','A');
+INSERT INTO t2 VALUES (1102,258403,34,'Hodges','stealth','assurers','A');
+INSERT INTO t2 VALUES (1103,258404,34,'translatable','coinciding','annoyers','');
+INSERT INTO t2 VALUES (1104,258405,34,'duality','founder','affixed','');
+INSERT INTO t2 VALUES (1105,258406,34,'recording','environing','warbling','');
+INSERT INTO t2 VALUES (1106,258407,34,'rouses','jewelry','seriously','');
+INSERT INTO t2 VALUES (1107,228123,37,'poison','lemons','boasted','');
+INSERT INTO t2 VALUES (1108,250606,34,'attitude','brokenness','Chantilly','');
+INSERT INTO t2 VALUES (1109,208405,37,'dusted','bedpost','Iranizes','');
+INSERT INTO t2 VALUES (1110,212101,37,'encompasses','assurers','violinist','');
+INSERT INTO t2 VALUES (1111,218206,37,'presentation','annoyers','extramarital','');
+INSERT INTO t2 VALUES (1112,150401,37,'Kantian','affixed','spates','');
+INSERT INTO t2 VALUES (1113,248212,41,'imprecision','warbling','cloakroom','');
+INSERT INTO t2 VALUES (1114,128026,00,'saving','seriously','gazer','');
+INSERT INTO t2 VALUES (1115,128024,00,'maternal','boasted','hand','');
+INSERT INTO t2 VALUES (1116,128027,00,'hewed','Chantilly','tucked','');
+INSERT INTO t2 VALUES (1117,128025,00,'kerosene','Iranizes','gems','');
+INSERT INTO t2 VALUES (1118,128109,00,'Cubans','violinist','clinker','');
+INSERT INTO t2 VALUES (1119,128705,00,'photographers','extramarital','refiner','');
+INSERT INTO t2 VALUES (1120,126303,00,'nymph','spates','callus','');
+INSERT INTO t2 VALUES (1121,128308,00,'bedlam','cloakroom','leopards','');
+INSERT INTO t2 VALUES (1122,128204,00,'north','gazer','comfortingly','');
+INSERT INTO t2 VALUES (1123,128205,00,'Schoenberg','hand','generically','');
+INSERT INTO t2 VALUES (1124,128206,00,'botany','tucked','getters','');
+INSERT INTO t2 VALUES (1125,128207,00,'curs','gems','sexually','');
+INSERT INTO t2 VALUES (1126,118205,00,'solidification','clinker','spear','');
+INSERT INTO t2 VALUES (1127,116801,00,'inheritresses','refiner','serums','');
+INSERT INTO t2 VALUES (1128,116803,00,'stiller','callus','Italianization','');
+INSERT INTO t2 VALUES (1129,116804,00,'t1','leopards','attendants','');
+INSERT INTO t2 VALUES (1130,116802,00,'suite','comfortingly','spies','');
+INSERT INTO t2 VALUES (1131,128605,00,'ransomer','generically','Anthony','');
+INSERT INTO t2 VALUES (1132,118308,00,'Willy','getters','planar','');
+INSERT INTO t2 VALUES (1133,113702,00,'Rena','sexually','cupped','');
+INSERT INTO t2 VALUES (1134,113703,00,'Seattle','spear','cleanser','');
+INSERT INTO t2 VALUES (1135,112103,00,'relaxes','serums','commuters','');
+INSERT INTO t2 VALUES (1136,118009,00,'exclaim','Italianization','honeysuckle','');
+INSERT INTO t2 VALUES (5136,1118009,00,'exclaim','Italianization','honeysuckle','');
+INSERT INTO t2 VALUES (1137,138011,00,'implicated','attendants','orphanage','');
+INSERT INTO t2 VALUES (1138,138010,00,'distinguish','spies','skies','');
+INSERT INTO t2 VALUES (1139,138012,00,'assayed','Anthony','crushers','');
+INSERT INTO t2 VALUES (1140,068304,00,'homeowner','planar','Puritan','');
+INSERT INTO t2 VALUES (1141,078009,00,'and','cupped','squeezer','');
+INSERT INTO t2 VALUES (1142,108013,00,'stealth','cleanser','bruises','');
+INSERT INTO t2 VALUES (1143,084004,00,'coinciding','commuters','bonfire','');
+INSERT INTO t2 VALUES (1144,083402,00,'founder','honeysuckle','Colombo','');
+INSERT INTO t2 VALUES (1145,084003,00,'environing','orphanage','nondecreasing','');
+INSERT INTO t2 VALUES (1146,088504,00,'jewelry','skies','innocents','');
+INSERT INTO t2 VALUES (1147,088005,00,'lemons','crushers','masked','');
+INSERT INTO t2 VALUES (1148,088007,00,'brokenness','Puritan','file','');
+INSERT INTO t2 VALUES (1149,088006,00,'bedpost','squeezer','brush','');
+INSERT INTO t2 VALUES (1150,148025,00,'assurers','bruises','mutilate','');
+INSERT INTO t2 VALUES (1151,148024,00,'annoyers','bonfire','mommy','');
+INSERT INTO t2 VALUES (1152,138305,00,'affixed','Colombo','bulkheads','');
+INSERT INTO t2 VALUES (1153,138306,00,'warbling','nondecreasing','undeclared','');
+INSERT INTO t2 VALUES (1154,152701,00,'seriously','innocents','displacements','');
+INSERT INTO t2 VALUES (1155,148505,00,'boasted','masked','nieces','');
+INSERT INTO t2 VALUES (1156,158003,00,'Chantilly','file','coeducation','');
+INSERT INTO t2 VALUES (1157,156201,00,'Iranizes','brush','brassy','');
+INSERT INTO t2 VALUES (1158,156202,00,'violinist','mutilate','authenticator','');
+INSERT INTO t2 VALUES (1159,158307,00,'extramarital','mommy','Washoe','');
+INSERT INTO t2 VALUES (1160,158402,00,'spates','bulkheads','penny','');
+INSERT INTO t2 VALUES (1161,158401,00,'cloakroom','undeclared','Flagler','');
+INSERT INTO t2 VALUES (1162,068013,00,'gazer','displacements','stoned','');
+INSERT INTO t2 VALUES (1163,068012,00,'hand','nieces','cranes','');
+INSERT INTO t2 VALUES (1164,068203,00,'tucked','coeducation','masterful','');
+INSERT INTO t2 VALUES (1165,088205,00,'gems','brassy','biracial','');
+INSERT INTO t2 VALUES (1166,068704,00,'clinker','authenticator','steamships','');
+INSERT INTO t2 VALUES (1167,068604,00,'refiner','Washoe','windmills','');
+INSERT INTO t2 VALUES (1168,158502,00,'callus','penny','exploit','');
+INSERT INTO t2 VALUES (1169,123103,00,'leopards','Flagler','riverfront','');
+INSERT INTO t2 VALUES (1170,148026,00,'comfortingly','stoned','sisterly','');
+INSERT INTO t2 VALUES (1171,123302,00,'generically','cranes','sharpshoot','');
+INSERT INTO t2 VALUES (1172,076503,00,'getters','masterful','mittens','');
+INSERT INTO t2 VALUES (1173,126304,00,'sexually','biracial','interdependency','');
+INSERT INTO t2 VALUES (1174,068306,00,'spear','steamships','policy','');
+INSERT INTO t2 VALUES (1175,143504,00,'serums','windmills','unleashing','');
+INSERT INTO t2 VALUES (1176,160201,00,'Italianization','exploit','pretenders','');
+INSERT INTO t2 VALUES (1177,148028,00,'attendants','riverfront','overstatements','');
+INSERT INTO t2 VALUES (1178,148027,00,'spies','sisterly','birthed','');
+INSERT INTO t2 VALUES (1179,143505,00,'Anthony','sharpshoot','opportunism','');
+INSERT INTO t2 VALUES (1180,108014,00,'planar','mittens','showroom','');
+INSERT INTO t2 VALUES (1181,076104,00,'cupped','interdependency','compromisingly','');
+INSERT INTO t2 VALUES (1182,078106,00,'cleanser','policy','Medicare','');
+INSERT INTO t2 VALUES (1183,126102,00,'commuters','unleashing','corresponds','');
+INSERT INTO t2 VALUES (1184,128029,00,'honeysuckle','pretenders','hardware','');
+INSERT INTO t2 VALUES (1185,128028,00,'orphanage','overstatements','implant','');
+INSERT INTO t2 VALUES (1186,018410,00,'skies','birthed','Alicia','');
+INSERT INTO t2 VALUES (1187,128110,00,'crushers','opportunism','requesting','');
+INSERT INTO t2 VALUES (1188,148506,00,'Puritan','showroom','produced','');
+INSERT INTO t2 VALUES (1189,123303,00,'squeezer','compromisingly','criticizes','');
+INSERT INTO t2 VALUES (1190,123304,00,'bruises','Medicare','backer','');
+INSERT INTO t2 VALUES (1191,068504,00,'bonfire','corresponds','positively','');
+INSERT INTO t2 VALUES (1192,068305,00,'Colombo','hardware','colicky','');
+INSERT INTO t2 VALUES (1193,000000,00,'nondecreasing','implant','thrillingly','');
+--enable_query_log
+
+#
+# Search with a key
+#
+
+select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%";
+select fld3 from t2 where fld3 like "%cultivation" ;
+
+#
+# Search with a key using sorting and limit the same time
+#
+
+select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3;
+select fld3,companynr from t2 where companynr = 58 order by fld3;
+
+select fld3 from t2 order by fld3 desc limit 10;
+select fld3 from t2 order by fld3 desc limit 5;
+select fld3 from t2 order by fld3 desc limit 5,5;
+
+#
+# Search with a key having a constant with each unique key.
+# The table is read directly with read-next on fld3
+#
+
+select t2.fld3 from t2 where fld3 = 'honeysuckle';
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_';
+select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_';
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%';
+select t2.fld3 from t2 where fld3 LIKE 'h%le';
+
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_';
+select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%';
+
+#
+# Test sorting with a used key (there is no need for sorting)
+#
+
+select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
+select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3;
+
+#
+# Search with a key with LIKE constant
+# If the like starts with a certain letter key will be used.
+#
+
+select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%';
+select fld3 from t2 where fld3 like "L%" and fld3 = "ok";
+select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly");
+select fld1,fld3 from t2 where fld1 like "25050%";
+select fld1,fld3 from t2 where fld1 like "25050_";
+
+#
+# Test for insert after select
+#
+INSERT INTO t2 VALUES (1,000001,00,'Omaha','teethe','neat','');
+INSERT INTO t2 VALUES (2,011401,37,'breaking','dreaded','Steinberg','W');
+INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring','');
+INSERT INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
+SELECT * FROM t2;
+drop table t1, t2;
diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test
index 99a75889431..73588a91aac 100644
--- a/mysql-test/t/auto_increment.test
+++ b/mysql-test/t/auto_increment.test
@@ -3,6 +3,7 @@
#
--disable_warnings
drop table if exists t1;
+drop table if exists t2;
--enable_warnings
SET SQL_WARNINGS=1;
diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test
index 6823dd23b73..7ee7d18439d 100644
--- a/mysql-test/t/bdb.test
+++ b/mysql-test/t/bdb.test
@@ -822,3 +822,78 @@ alter table t1 modify a char(10) binary;
explain select a from t1;
select a from t1;
drop table t1;
+
+#
+# bug#2686 - index_merge select on BerkeleyDB table with varchar PK causes mysqld to crash
+#
+
+create table t1(
+ pk1 text not null, pk2 text not null, pk3 char(4),
+ key1 int, key2 int,
+ primary key(pk1(4), pk2(4), pk3), key(key1), key(key2)
+) engine=bdb;
+insert into t1 values (concat('aaa-', repeat('A', 4000)),
+ concat('eee-', repeat('e', 4000)), 'a++a', 1, 1);
+insert into t1 values (concat('bbb-', repeat('B', 4000)),
+ concat('ggg-', repeat('G', 4000)), 'b++b', 1, 1);
+select substring(pk1, 1, 4), substring(pk1, 4001),
+ substring(pk2, 1, 4), substring(pk2, 4001), pk3, key1, key2
+ from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
+drop table t1;
+
+#
+# bug#2688 - Wrong index_merge query results for BDB table with variable length primary key
+#
+
+create table t1 (
+ pk1 varchar(8) not null default '',
+ pk2 varchar(4) not null default '',
+ key1 int(11) default null,
+ key2 int(11) default null,
+ primary key (pk1,pk2),
+ key key1 (key1),
+ key key2 (key2)) engine=bdb;
+insert into t1 values ('','empt',2,2), ('a','a--a',2,2),
+ ('bb','b--b',2,2), ('ccc','c--c',2,2), ('dddd','d--d',2,2);
+select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
+drop table t1;
+
+
+#
+# Bug #4000: problem with active cursor.
+#
+
+set autocommit=0;
+create table t1(b varchar(30)) engine=bdb;
+insert into t1 values ('one');
+commit;
+select b FROM t1 outer_table where
+exists (select 'two' from t1 where 'two' = outer_table.b);
+drop table t1;
+set autocommit=1;
+
+#
+# Bug #4089: subselect and open cursor.
+#
+
+create table t1(a int primary key, b varchar(30)) engine=bdb;
+insert into t1 values (1,'one'), (2,'two'), (3,'three'), (4,'four');
+create table t2 like t1;
+insert t2 select * from t1;
+select a from t1 where a in (select a from t2);
+delete from t2;
+insert into t2 (a, b)
+ select a, b from t1 where (a, b) in (select a, b from t1);
+select * from t2;
+drop table t1, t2;
+
+#
+# Bug #4304: TRUNCATE <table of type BDB> , wrong result
+#
+
+create table t1 (a int, b varchar(30), primary key(a)) engine = bdb;
+insert into t1 values (1,'one');
+commit;
+truncate t1;
+select * from t1;
+drop table t1;
diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test
new file mode 100644
index 00000000000..6ff1407247f
--- /dev/null
+++ b/mysql-test/t/ctype_uca.test
@@ -0,0 +1,181 @@
+-- source include/have_ucs2.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+#
+# Test Unicode collations.
+#
+
+set names utf8;
+create table t1 (c1 char(10) character set utf8 collate utf8_bin);
+
+#
+# Basic Latin
+#
+insert into t1 values ('A'),('a');
+insert into t1 values ('B'),('b');
+insert into t1 values ('C'),('c');
+insert into t1 values ('D'),('d');
+insert into t1 values ('E'),('e');
+insert into t1 values ('F'),('f');
+insert into t1 values ('G'),('g');
+insert into t1 values ('H'),('h');
+insert into t1 values ('I'),('i');
+insert into t1 values ('J'),('j');
+insert into t1 values ('K'),('k');
+insert into t1 values ('L'),('l');
+insert into t1 values ('M'),('m');
+insert into t1 values ('N'),('n');
+insert into t1 values ('O'),('o');
+insert into t1 values ('P'),('p');
+insert into t1 values ('Q'),('q');
+insert into t1 values ('R'),('r');
+insert into t1 values ('S'),('s');
+insert into t1 values ('T'),('t');
+insert into t1 values ('U'),('u');
+insert into t1 values ('V'),('v');
+insert into t1 values ('W'),('w');
+insert into t1 values ('X'),('x');
+insert into t1 values ('Y'),('y');
+insert into t1 values ('Z'),('z');
+
+#
+# Latin1 suppliment
+#
+insert into t1 values (_ucs2 0x00e0),(_ucs2 0x00c0);
+insert into t1 values (_ucs2 0x00e1),(_ucs2 0x00c1);
+insert into t1 values (_ucs2 0x00e2),(_ucs2 0x00c2);
+insert into t1 values (_ucs2 0x00e3),(_ucs2 0x00c3);
+insert into t1 values (_ucs2 0x00e4),(_ucs2 0x00c4);
+insert into t1 values (_ucs2 0x00e5),(_ucs2 0x00c5);
+insert into t1 values (_ucs2 0x00e6),(_ucs2 0x00c6);
+insert into t1 values (_ucs2 0x00e7),(_ucs2 0x00c7);
+insert into t1 values (_ucs2 0x00e8),(_ucs2 0x00c8);
+insert into t1 values (_ucs2 0x00e9),(_ucs2 0x00c9);
+insert into t1 values (_ucs2 0x00ea),(_ucs2 0x00ca);
+insert into t1 values (_ucs2 0x00eb),(_ucs2 0x00cb);
+insert into t1 values (_ucs2 0x00ec),(_ucs2 0x00cc);
+insert into t1 values (_ucs2 0x00ed),(_ucs2 0x00cd);
+insert into t1 values (_ucs2 0x00ee),(_ucs2 0x00ce);
+insert into t1 values (_ucs2 0x00ef),(_ucs2 0x00cf);
+
+insert into t1 values (_ucs2 0x00f0),(_ucs2 0x00d0);
+insert into t1 values (_ucs2 0x00f1),(_ucs2 0x00d1);
+insert into t1 values (_ucs2 0x00f2),(_ucs2 0x00d2);
+insert into t1 values (_ucs2 0x00f3),(_ucs2 0x00d3);
+insert into t1 values (_ucs2 0x00f4),(_ucs2 0x00d4);
+insert into t1 values (_ucs2 0x00f5),(_ucs2 0x00d5);
+insert into t1 values (_ucs2 0x00f6),(_ucs2 0x00d6);
+insert into t1 values (_ucs2 0x00f7),(_ucs2 0x00d7);
+insert into t1 values (_ucs2 0x00f8),(_ucs2 0x00d8);
+insert into t1 values (_ucs2 0x00f9),(_ucs2 0x00d9);
+insert into t1 values (_ucs2 0x00fa),(_ucs2 0x00da);
+insert into t1 values (_ucs2 0x00fb),(_ucs2 0x00db);
+insert into t1 values (_ucs2 0x00fc),(_ucs2 0x00dc);
+insert into t1 values (_ucs2 0x00fd),(_ucs2 0x00dd);
+insert into t1 values (_ucs2 0x00fe),(_ucs2 0x00de);
+insert into t1 values (_ucs2 0x00ff),(_ucs2 0x00df);
+
+#
+# Latin extended-A, 0100-017F
+#
+insert into t1 values (_ucs2 0x0100),(_ucs2 0x0101),(_ucs2 0x0102),(_ucs2 0x0103);
+insert into t1 values (_ucs2 0x0104),(_ucs2 0x0105),(_ucs2 0x0106),(_ucs2 0x0107);
+insert into t1 values (_ucs2 0x0108),(_ucs2 0x0109),(_ucs2 0x010a),(_ucs2 0x010b);
+insert into t1 values (_ucs2 0x010c),(_ucs2 0x010d),(_ucs2 0x010e),(_ucs2 0x010f);
+insert into t1 values (_ucs2 0x0110),(_ucs2 0x0111),(_ucs2 0x0112),(_ucs2 0x0113);
+insert into t1 values (_ucs2 0x0114),(_ucs2 0x0115),(_ucs2 0x0116),(_ucs2 0x0117);
+insert into t1 values (_ucs2 0x0118),(_ucs2 0x0119),(_ucs2 0x011a),(_ucs2 0x011b);
+insert into t1 values (_ucs2 0x011c),(_ucs2 0x011d),(_ucs2 0x011e),(_ucs2 0x011f);
+insert into t1 values (_ucs2 0x0120),(_ucs2 0x0121),(_ucs2 0x0122),(_ucs2 0x0123);
+insert into t1 values (_ucs2 0x0124),(_ucs2 0x0125),(_ucs2 0x0126),(_ucs2 0x0127);
+insert into t1 values (_ucs2 0x0128),(_ucs2 0x0129),(_ucs2 0x012a),(_ucs2 0x012b);
+insert into t1 values (_ucs2 0x012c),(_ucs2 0x012d),(_ucs2 0x012e),(_ucs2 0x012f);
+insert into t1 values (_ucs2 0x0130),(_ucs2 0x0131),(_ucs2 0x0132),(_ucs2 0x0133);
+insert into t1 values (_ucs2 0x0134),(_ucs2 0x0135),(_ucs2 0x0136),(_ucs2 0x0137);
+insert into t1 values (_ucs2 0x0138),(_ucs2 0x0139),(_ucs2 0x013a),(_ucs2 0x013b);
+insert into t1 values (_ucs2 0x013c),(_ucs2 0x013d),(_ucs2 0x013e),(_ucs2 0x013f);
+insert into t1 values (_ucs2 0x0140),(_ucs2 0x0141),(_ucs2 0x0142),(_ucs2 0x0143);
+insert into t1 values (_ucs2 0x0144),(_ucs2 0x0145),(_ucs2 0x0146),(_ucs2 0x0147);
+insert into t1 values (_ucs2 0x0148),(_ucs2 0x0149),(_ucs2 0x014a),(_ucs2 0x014b);
+insert into t1 values (_ucs2 0x014c),(_ucs2 0x014d),(_ucs2 0x014e),(_ucs2 0x014f);
+insert into t1 values (_ucs2 0x0150),(_ucs2 0x0151),(_ucs2 0x0152),(_ucs2 0x0153);
+insert into t1 values (_ucs2 0x0154),(_ucs2 0x0155),(_ucs2 0x0156),(_ucs2 0x0157);
+insert into t1 values (_ucs2 0x0158),(_ucs2 0x0159),(_ucs2 0x015a),(_ucs2 0x015b);
+insert into t1 values (_ucs2 0x015c),(_ucs2 0x015d),(_ucs2 0x015e),(_ucs2 0x015f);
+insert into t1 values (_ucs2 0x0160),(_ucs2 0x0161),(_ucs2 0x0162),(_ucs2 0x0163);
+insert into t1 values (_ucs2 0x0164),(_ucs2 0x0165),(_ucs2 0x0166),(_ucs2 0x0167);
+insert into t1 values (_ucs2 0x0168),(_ucs2 0x0169),(_ucs2 0x016a),(_ucs2 0x016b);
+insert into t1 values (_ucs2 0x016c),(_ucs2 0x016d),(_ucs2 0x016e),(_ucs2 0x016f);
+insert into t1 values (_ucs2 0x0170),(_ucs2 0x0171),(_ucs2 0x0172),(_ucs2 0x0173);
+insert into t1 values (_ucs2 0x0174),(_ucs2 0x0175),(_ucs2 0x0176),(_ucs2 0x0177);
+insert into t1 values (_ucs2 0x0178),(_ucs2 0x0179),(_ucs2 0x017a),(_ucs2 0x017b);
+insert into t1 values (_ucs2 0x017c),(_ucs2 0x017d),(_ucs2 0x017e),(_ucs2 0x017f);
+
+#
+# Latin extended-B, 0180-024F
+#
+insert into t1 values (_ucs2 0x0180),(_ucs2 0x0181),(_ucs2 0x0182),(_ucs2 0x0183);
+insert into t1 values (_ucs2 0x0184),(_ucs2 0x0185),(_ucs2 0x0186),(_ucs2 0x0187);
+insert into t1 values (_ucs2 0x0188),(_ucs2 0x0189),(_ucs2 0x018a),(_ucs2 0x018b);
+insert into t1 values (_ucs2 0x018c),(_ucs2 0x018d),(_ucs2 0x018e),(_ucs2 0x018f);
+insert into t1 values (_ucs2 0x0190),(_ucs2 0x0191),(_ucs2 0x0192),(_ucs2 0x0193);
+insert into t1 values (_ucs2 0x0194),(_ucs2 0x0195),(_ucs2 0x0196),(_ucs2 0x0197);
+insert into t1 values (_ucs2 0x0198),(_ucs2 0x0199),(_ucs2 0x019a),(_ucs2 0x019b);
+insert into t1 values (_ucs2 0x019c),(_ucs2 0x019d),(_ucs2 0x019e),(_ucs2 0x019f);
+insert into t1 values (_ucs2 0x01a0),(_ucs2 0x01a1),(_ucs2 0x01a2),(_ucs2 0x01a3);
+insert into t1 values (_ucs2 0x01a4),(_ucs2 0x01a5),(_ucs2 0x01a6),(_ucs2 0x01a7);
+insert into t1 values (_ucs2 0x01a8),(_ucs2 0x01a9),(_ucs2 0x01aa),(_ucs2 0x01ab);
+insert into t1 values (_ucs2 0x01ac),(_ucs2 0x01ad),(_ucs2 0x01ae),(_ucs2 0x01af);
+insert into t1 values (_ucs2 0x01b0),(_ucs2 0x01b1),(_ucs2 0x01b2),(_ucs2 0x01b3);
+insert into t1 values (_ucs2 0x01b4),(_ucs2 0x01b5),(_ucs2 0x01b6),(_ucs2 0x01b7);
+insert into t1 values (_ucs2 0x01b8),(_ucs2 0x01b9),(_ucs2 0x01ba),(_ucs2 0x01bb);
+insert into t1 values (_ucs2 0x01bc),(_ucs2 0x01bd),(_ucs2 0x01be),(_ucs2 0x01bf);
+insert into t1 values (_ucs2 0x01c0),(_ucs2 0x01c1),(_ucs2 0x01c2),(_ucs2 0x01c3);
+insert into t1 values (_ucs2 0x01c4),(_ucs2 0x01c5),(_ucs2 0x01c6),(_ucs2 0x01c7);
+insert into t1 values (_ucs2 0x01c8),(_ucs2 0x01c9),(_ucs2 0x01ca),(_ucs2 0x01cb);
+insert into t1 values (_ucs2 0x01cc),(_ucs2 0x01cd),(_ucs2 0x01ce),(_ucs2 0x01cf);
+insert into t1 values (_ucs2 0x01d0),(_ucs2 0x01d1),(_ucs2 0x01d2),(_ucs2 0x01d3);
+insert into t1 values (_ucs2 0x01d4),(_ucs2 0x01d5),(_ucs2 0x01d6),(_ucs2 0x01d7);
+insert into t1 values (_ucs2 0x01d8),(_ucs2 0x01d9),(_ucs2 0x01da),(_ucs2 0x01db);
+insert into t1 values (_ucs2 0x01dc),(_ucs2 0x01dd),(_ucs2 0x01de),(_ucs2 0x01df);
+insert into t1 values (_ucs2 0x01e0),(_ucs2 0x01e1),(_ucs2 0x01e2),(_ucs2 0x01e3);
+insert into t1 values (_ucs2 0x01e4),(_ucs2 0x01e5),(_ucs2 0x01e6),(_ucs2 0x01e7);
+insert into t1 values (_ucs2 0x01e8),(_ucs2 0x01e9),(_ucs2 0x01ea),(_ucs2 0x01eb);
+insert into t1 values (_ucs2 0x01ec),(_ucs2 0x01ed),(_ucs2 0x01ee),(_ucs2 0x01ef);
+insert into t1 values (_ucs2 0x01f0),(_ucs2 0x01f1),(_ucs2 0x01f2),(_ucs2 0x01f3);
+insert into t1 values (_ucs2 0x01f4),(_ucs2 0x01f5),(_ucs2 0x01f6),(_ucs2 0x01f7);
+insert into t1 values (_ucs2 0x01f8),(_ucs2 0x01f9),(_ucs2 0x01fa),(_ucs2 0x01fb);
+insert into t1 values (_ucs2 0x01fc),(_ucs2 0x01fd),(_ucs2 0x01fe),(_ucs2 0x01ff);
+
+
+insert into t1 values ('AA'),('Aa'),('aa'),('aA');
+insert into t1 values ('CH'),('Ch'),('ch'),('cH');
+insert into t1 values ('DZ'),('Dz'),('dz'),('dZ');
+insert into t1 values ('IJ'),('Ij'),('ij'),('iJ');
+insert into t1 values ('LJ'),('Lj'),('lj'),('lJ');
+insert into t1 values ('LL'),('Ll'),('ll'),('lL');
+insert into t1 values ('NJ'),('Nj'),('nj'),('nJ');
+insert into t1 values ('OE'),('Oe'),('oe'),('oE');
+insert into t1 values ('SS'),('Ss'),('ss'),('sS');
+insert into t1 values ('RR'),('Rr'),('rr'),('rR');
+
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_unicode_ci;
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_icelandic_ci;
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_latvian_ci;
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_romanian_ci;
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovenian_ci;
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_polish_ci;
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_estonian_ci;
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish_ci;
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_swedish_ci;
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_turkish_ci;
+
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_czech_ci;
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_danish_ci;
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_lithuanian_ci;
+--select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovak_ci;
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci;
+
diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test
index 5b1a5923ad4..b8574fb7623 100644
--- a/mysql-test/t/ctype_ucs.test
+++ b/mysql-test/t/ctype_ucs.test
@@ -47,6 +47,16 @@ LPAD(_ucs2 X'0420',10,_ucs2 X'0421') l,
RPAD(_ucs2 X'0420',10,_ucs2 X'0421') r;
SHOW CREATE TABLE t1;
DROP TABLE t1;
+
+
+#
+# BUG3946
+#
+
+create table t2(f1 Char(30));
+insert into t2 values ("103000"), ("22720000"), ("3401200"), ("78000");
+select lpad(f1, 12, "-o-/") from t2;
+drop table t2;
######################################################
#
# Test of like
diff --git a/mysql-test/t/ctype_ujis.test b/mysql-test/t/ctype_ujis.test
index 6281f2a4249..e5405d9f1bd 100644
--- a/mysql-test/t/ctype_ujis.test
+++ b/mysql-test/t/ctype_ujis.test
@@ -73,3 +73,13 @@ create index idx_c1 on t1(c1);
select c1 as 'using index' from t1 where c1 like cast(concat(0xA4A2, '%') as char character set ujis);
select c1 as 'no index' from t1 where c1 like cast(concat('%',0xA4A2, '%') as char character set ujis);
drop table t1;
+
+
+# Bug 2077
+CREATE TABLE t1 (
+ a char(1) NOT NULL default '',
+ b enum('','') default NULL
+) CHARACTER SET ujis;
+SHOW CREATE TABLE t1;
+SHOW COLUMNS FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 4e68efeffc3..6a504a8533a 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -141,3 +141,19 @@ select * from t1 where a = 'b';
select * from t1 where a = 'b' and a = 'b';
select * from t1 where a = 'b' and a != 'b';
drop table t1;
+
+#
+# Bug #3928 regexp [[:>:]] and UTF-8
+#
+set names utf8;
+
+# This should return TRUE
+select 'вася' rlike '[[:<:]]вася[[:>:]]';
+select 'вася ' rlike '[[:<:]]вася[[:>:]]';
+select ' вася' rlike '[[:<:]]вася[[:>:]]';
+select ' вася ' rlike '[[:<:]]вася[[:>:]]';
+
+# This should return FALSE
+select 'васяz' rlike '[[:<:]]вася[[:>:]]';
+select 'zвася' rlike '[[:<:]]вася[[:>:]]';
+select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test
index e370b545eff..56c8ce77627 100644
--- a/mysql-test/t/delete.test
+++ b/mysql-test/t/delete.test
@@ -98,3 +98,14 @@ select * from t11;
delete ignore from t11 where t11.b <> (select b from t2 where t11.a < t2.a);
select * from t11;
drop table t11, t12, t2;
+
+#
+# Bug #4198: deletion and KEYREAD
+#
+
+create table t1 (a int, b int, unique key (a), key (b));
+insert into t1 values (3, 3), (7, 7);
+delete t1 from t1 where a = 3;
+check table t1;
+select * from t1;
+drop table t1;
diff --git a/mysql-test/t/flush_table.test b/mysql-test/t/flush_table.test
index 4ddcd53d5c8..8bee94cf21f 100644
--- a/mysql-test/t/flush_table.test
+++ b/mysql-test/t/flush_table.test
@@ -4,10 +4,55 @@
# Test of flush table
#
-#drop table if exists t1;
-#create table t1 (a int not null auto_increment primary key);
-#insert into t1 values(0);
-#lock table t1 read;
-#flush table t1;
-#check table t1;
-#drop table t1;
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+create table t1 (a int not null auto_increment primary key);
+insert into t1 values(0);
+lock table t1 read;
+flush table t1;
+check table t1;
+drop table t1;
+
+#
+# In the following test FLUSH TABLES produces a deadlock
+# (hang forever) if the fix for bug#3565 is missing.
+#
+create table t1(table_id char(20) primary key);
+create table t2(table_id char(20) primary key);
+insert into t1 values ('test.t1');
+insert into t1 values ('');
+insert into t2 values ('test.t2');
+insert into t2 values ('');
+handler t1 open as a1;
+handler t1 open as a2;
+handler t2 open;
+handler a1 read first limit 9;
+handler a2 read first limit 9;
+handler t2 read first limit 9;
+flush tables;
+--error 1109;
+handler a1 read first limit 9;
+--error 1109;
+handler a2 read first limit 9;
+--error 1109;
+handler t2 read first limit 9;
+#
+handler t1 open as a1;
+handler t1 open as a2;
+handler t2 open;
+handler a1 read first limit 9;
+handler a2 read first limit 9;
+handler t2 read first limit 9;
+flush table t1;
+--error 1109;
+handler a1 read first limit 9;
+--error 1109;
+handler a2 read first limit 9;
+handler t2 read first limit 9;
+flush table t2;
+--error 1109;
+handler t2 close;
+drop table t1;
+drop table t2;
+
diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test
index ac88125965a..66df5b1cb92 100644
--- a/mysql-test/t/fulltext.test
+++ b/mysql-test/t/fulltext.test
@@ -69,10 +69,10 @@ select * from t1 where MATCH a,b AGAINST ('+(support collections) +foobar*' IN B
select * from t1 where MATCH a,b AGAINST ('+(+(support collections)) +foobar*' IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE);
-# bug#2708 crash
+# bug#2708, bug#3870 crash
select * from t1 where MATCH a,b AGAINST('"space model' IN BOOLEAN MODE);
-
+
# boolean w/o index:
select * from t1 where MATCH a AGAINST ("search" IN BOOLEAN MODE);
@@ -279,3 +279,12 @@ SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck');
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck');
DROP TABLE t1;
+#
+# bug#3964
+#
+
+CREATE TABLE t1 (s varchar(255), FULLTEXT (s)) DEFAULT CHARSET=utf8;
+insert into t1 (s) values ('pra para para'),('para para para');
+select * from t1 where match(s) against('para' in boolean mode);
+select * from t1 where match(s) against('par*' in boolean mode);
+DROP TABLE t1;
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index aede2220466..62343fa2af8 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -61,7 +61,7 @@ select grp,group_concat(c order by c) from t1 group by grp;
# Test warnings
-set group_concat_max_len = 5;
+set group_concat_max_len = 4;
select grp,group_concat(c) from t1 group by grp;
show warnings;
set group_concat_max_len = 1024;
@@ -83,7 +83,7 @@ insert into t1 values (4,'www.host.com'), (5,'www.google.com'),(5,'www.help.com'
insert into t2 values (1,4), (5,4), (5,5);
# Make this order independent
--replace_result www.help.com X www.host.com X www.google.com X
-select REQ_ID, Group_Concat(URL) as URL from t1, t2 where
+select REQ_ID, Group_Concat(URL) as URL from t1, t2 where
t2.URL_ID = t1.URL_ID group by REQ_ID;
# check min/max function
--replace_result www.help.com X www.host.com X www.google.com X
@@ -132,7 +132,7 @@ drop table t1, t2;
CREATE TABLE t1 (id1 tinyint(4) NOT NULL, id2 tinyint(4) NOT NULL);
INSERT INTO t1 VALUES (1, 1),(1, 2),(1, 3),(1, 4),(1, 5),(2, 1),(2, 2),(2, 3);
-CREATE TABLE t2 (id1 tinyint(4) NOT NULL);
+CREATE TABLE t2 (id1 tinyint(4) NOT NULL);
INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 AND t1.id1=1 GROUP BY t1.id1;
SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;
@@ -163,7 +163,7 @@ drop table t1;
# Test with subqueries (Bug #3319)
#
-create table t1 (a int, c int);
+create table t1 (a int, c int);
insert into t1 values (1, 2), (2, 3), (2, 4), (3, 5);
create table t2 (a int, c int);
insert into t2 values (1, 5), (2, 4), (3, 3), (3,3);
@@ -189,3 +189,15 @@ INSERT INTO t1 VALUES (1), (2);
INSERT INTO t2 VALUES (1), (2);
SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) FROM t1, t2 GROUP BY t1.a;
DROP TABLE t1, t2;
+
+#
+# Bug #4035: group_concat() and HAVING
+#
+
+CREATE TABLE t1 (a char(4));
+INSERT INTO t1 VALUES ('John'), ('Anna'), ('Bill');
+SELECT GROUP_CONCAT(a SEPARATOR '||') AS names FROM t1
+ HAVING names LIKE '%An%';
+SELECT GROUP_CONCAT(a SEPARATOR '###') AS names FROM t1
+ HAVING LEFT(names, 1) ='J';
+DROP TABLE t1;
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index 7966a2262f4..74f4c1bad44 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -396,3 +396,25 @@ create table t1 (a int);
select variance(2) from t1;
select stddev(2) from t1;
drop table t1;
+
+
+#
+# cleunup() of optimized away count(*) and max/min
+#
+create table t1 (a int);
+insert into t1 values (1),(2);
+prepare stmt1 from 'SELECT COUNT(*) FROM t1';
+execute stmt1;
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+drop table t1;
+
+create table t1 (a int, primary key(a));
+insert into t1 values (1),(2);
+prepare stmt1 from 'SELECT max(a) FROM t1';
+execute stmt1;
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+drop table t1;
diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test
index 36c3a38d2fe..7048d188604 100644
--- a/mysql-test/t/func_if.test
+++ b/mysql-test/t/func_if.test
@@ -47,3 +47,12 @@ create table t1 (x int, y int);
insert into t1 values (0,6),(10,16),(20,26),(30,10),(40,46),(50,56);
select min(if(y -x > 5,y,NULL)), max(if(y - x > 5,y,NULL)) from t1;
drop table t1;
+
+#
+# BUG#3987
+#
+create table t1 (a int);
+insert t1 values (1),(2);
+select if(1>2,a,avg(a)) from t1;
+drop table t1;
+
diff --git a/mysql-test/t/func_like.test b/mysql-test/t/func_like.test
index 91f55af48cc..ad83202afa0 100644
--- a/mysql-test/t/func_like.test
+++ b/mysql-test/t/func_like.test
@@ -25,14 +25,23 @@ select * from t1 where a like "%abc\d%";
drop table t1;
+create table t1 (a varchar(10), key(a));
+
#
# Bug #2231
#
-
-create table t1 (a varchar(10), key(a));
insert into t1 values ('a'), ('a\\b');
select * from t1 where a like 'a\\%' escape '#';
select * from t1 where a like 'a\\%' escape '#' and a like 'a\\\\b';
+
+#
+# Bug #4200: Prepared statement parameter as argument to ESCAPE
+#
+prepare stmt1 from 'select * from t1 where a like \'a\\%\' escape ?';
+set @esc='#';
+execute stmt1 using @esc;
+deallocate prepare stmt1;
+
drop table t1;
#
diff --git a/mysql-test/t/func_regexp.test b/mysql-test/t/func_regexp.test
index edfa9afcfa6..1a771d466fa 100644
--- a/mysql-test/t/func_regexp.test
+++ b/mysql-test/t/func_regexp.test
@@ -60,3 +60,16 @@ select _koi8r 0xF7 regexp _koi8r '[[:alpha:]]';
select _latin1'a' regexp _latin1'A' collate latin1_general_ci;
select _latin1'a' regexp _latin1'A' collate latin1_bin;
+
+#
+# regexp cleanup()
+#
+create table t1 (a varchar(40));
+insert into t1 values ('C1'),('C2'),('R1'),('C3'),('R2'),('R3');
+prepare stmt1 from 'select a from t1 where a rlike ? order by a';
+set @a="^C.*";
+execute stmt1 using @a;
+set @a="^R.*";
+execute stmt1 using @a;
+deallocate prepare stmt1;
+drop table t1;
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index c138b848491..cc8d8a88437 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -304,6 +304,7 @@ select collation(soundex(_latin2'ab')), coercibility(soundex(_latin2'ab'));
select collation(substring(_latin2'ab',1)), coercibility(substring(_latin2'ab',1));
select collation(insert(_latin2'abcd',2,3,_latin2'ef')), coercibility(insert(_latin2'abcd',2,3,_latin2'ef'));
select collation(replace(_latin2'abcd',_latin2'b',_latin2'B')), coercibility(replace(_latin2'abcd',_latin2'b',_latin2'B'));
+select collation(encode('abcd','ab')), coercibility(encode('abcd','ab'));
create table t1
select
@@ -336,7 +337,8 @@ select
soundex(_latin2'ab'),
substring(_latin2'ab',1),
insert(_latin2'abcd',2,3,_latin2'ef'),
- replace(_latin2'abcd',_latin2'b',_latin2'B')
+ replace(_latin2'abcd',_latin2'b',_latin2'B'),
+ encode('abcd','ab')
;
show create table t1;
drop table t1;
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 69306f69f40..0ca3d86818e 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -255,7 +255,6 @@ select date_add(date,INTERVAL "1 1" YEAR_MONTH) from t1;
select date_add(date,INTERVAL "1:1:1" HOUR_SECOND) from t1;
select date_add(date,INTERVAL "1 1:1" DAY_MINUTE) from t1;
select date_add(date,INTERVAL "1 1:1:1" DAY_SECOND) from t1;
-
select date_add(date,INTERVAL "1" WEEK) from t1;
select date_add(date,INTERVAL "1" QUARTER) from t1;
select timestampadd(MINUTE, 1, date) from t1;
@@ -280,7 +279,6 @@ select timestampdiff(SQL_TSI_DAY, '1986-02-01', '1986-03-01') as a1,
timestampdiff(SQL_TSI_DAY, '1996-02-01', '1996-03-01') as a3,
timestampdiff(SQL_TSI_DAY, '2000-02-01', '2000-03-01') as a4;
-# The following is not as one would expect...
select date_add(time,INTERVAL 1 SECOND) from t1;
drop table t1;
diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test
index 8e91e5891b8..817249b7e4c 100644
--- a/mysql-test/t/gis-rtree.test
+++ b/mysql-test/t/gis-rtree.test
@@ -1,3 +1,5 @@
+-- source include/have_geometry.inc
+
#
# test of rtree (using with spatial data)
#
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index ea460d5f7b0..590007caba1 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -1,3 +1,5 @@
+-- source include/have_geometry.inc
+
#
# Spatial objects
#
diff --git a/mysql-test/t/innodb_cache.test b/mysql-test/t/innodb_cache.test
index 8568fce7d97..101dde37f89 100644
--- a/mysql-test/t/innodb_cache.test
+++ b/mysql-test/t/innodb_cache.test
@@ -52,10 +52,31 @@ show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
commit;
show status like "Qcache_queries_in_cache";
+drop table t3,t2,t1;
-drop table if exists t1;
CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=InnoDB;
select count(*) from t1;
insert into t1 (id) values (0);
select count(*) from t1;
drop table t1;
+
+#
+# one statement roll back inside transation
+#
+set GLOBAL query_cache_size=1355776;
+CREATE TABLE t1 ( id int(10) NOT NULL auto_increment, a varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY a (a)) ENGINE=innodb;
+CREATE TABLE t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b)) ENGINE=innodb;
+CREATE TABLE t3 ( id int(10) NOT NULL auto_increment, t1_id int(10) NOT NULL default '0', t2_id int(10) NOT NULL default '0', state int(11) default NULL, PRIMARY KEY (id), UNIQUE KEY t1_id (t1_id,t2_id), KEY t2_id (t2_id,t1_id), CONSTRAINT `t3_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`), CONSTRAINT `t3_ibfk_2` FOREIGN KEY (`t2_id`) REFERENCES `t2` (`id`)) ENGINE=innodb;
+INSERT INTO t1 VALUES (1,'me');
+INSERT INTO t2 VALUES (1,'you');
+INSERT INTO t3 VALUES (2,1,1,2);
+delete from t3 where t1_id = 1 and t2_id = 1;
+select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc;
+begin;
+insert into t3 VALUES ( NULL, 1, 1, 2 );
+-- error 1062
+insert into t3 VALUES ( NULL, 1, 1, 2 );
+commit;
+select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc;
+drop table t3,t2,t1;
+
diff --git a/mysql-test/t/lowercase_table2.test b/mysql-test/t/lowercase_table2.test
index 5c479391916..a4eaeac4ef4 100644
--- a/mysql-test/t/lowercase_table2.test
+++ b/mysql-test/t/lowercase_table2.test
@@ -89,3 +89,14 @@ SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHER
SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHERE EVENT_ID=3;
SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHERE EVENT_ID=3;
drop table T1;
+
+#
+# Test name conversion with ALTER TABLE / CREATE INDEX (Bug #3109)
+#
+
+create table T1 (A int);
+alter table T1 add index (A);
+show tables like 'T1%';
+alter table t1 add index (A);
+show tables like 't1%';
+drop table t1;
diff --git a/mysql-test/t/lowercase_table3.test b/mysql-test/t/lowercase_table3.test
index 1753772ecc3..a394cde7237 100644
--- a/mysql-test/t/lowercase_table3.test
+++ b/mysql-test/t/lowercase_table3.test
@@ -9,7 +9,7 @@
disable_query_log;
show variables like "lower_case_%";
--require r/true.require
-select @@version_compile_os NOT IN ("NT","WIN2000","Win95/Win98","XP") as "TRUE";
+select convert(@@version_compile_os using latin1) NOT IN ("NT","WIN2000","Win95/Win98","XP") as "TRUE";
enable_query_log;
--disable_warnings
@@ -31,7 +31,7 @@ flush tables;
# storing things in lower case.
#
-CREATE TABLE t1 (a int) type=INNODB;
+CREATE TABLE t1 (a int) ENGINE=INNODB;
--error 1016
SELECT * from T1;
drop table t1;
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index 1f61e200613..cf55c26fb69 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -190,6 +190,14 @@ select * from t5 order by a,b;
select * from t6 order by a,b;
insert into t1 values (99,NULL);
select * from t4 where a+0 > 90;
+# bug#4008 - cannot determine a unique key that caused "dupl. key error"
+--error 1062
+insert t5 values (1,1);
+--error 1062
+insert t6 values (2,1);
+insert t5 values (1,1) on duplicate key update b=b+10;
+insert t6 values (2,1) on duplicate key update b=b+20;
+select * from t5 where a < 3;
drop table t6, t5, t4, t3, t2, t1;
CREATE TABLE t1 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', PRIMARY KEY (a,b)) ENGINE=MyISAM;
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index 68d8af87e45..a3b733c3c03 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -404,6 +404,7 @@ update t1, t2 set t1.b=1 where t1.a=t2.a;
update t1, t2 set t1.b=(select t3.b from t3 where t1.a=t3.a) where t1.a=t2.a;
connection root;
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
+revoke all privileges on mysqltest.* from mysqltest_1@localhost;
delete from mysql.user where user='mysqltest_1';
drop database mysqltest;
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test
index d15dac8c0bc..a8bbe60d58e 100644
--- a/mysql-test/t/mysqlbinlog.test
+++ b/mysql-test/t/mysqlbinlog.test
@@ -1,11 +1,12 @@
# We are using .opt file since we need small binlog size
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
# we need this for getting fixed timestamps inside of this test
set timestamp=1000000000;
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+
create table t1 (word varchar(20));
create table t2 (id int auto_increment not null primary key);
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index bcfe81dc95f..89b3739f955 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -73,11 +73,12 @@ DROP TABLE t1;
#
# Bug #1994
+# Bug #4261
#
CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET koi8r;
-INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5');
---exec $MYSQL_DUMP --skip-comments test t1
+INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL);
+--exec $MYSQL_DUMP --skip-comments --skip-extended-insert test t1
DROP TABLE t1;
#
diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test
new file mode 100644
index 00000000000..f95aa82b7cc
--- /dev/null
+++ b/mysql-test/t/ndb_alter_table.test
@@ -0,0 +1,41 @@
+-- source include/have_ndb.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+#
+# Basic test to show that the ALTER TABLE
+# is working
+#
+CREATE TABLE t1 (
+ a INT NOT NULL,
+ b INT NOT NULL
+) ENGINE=ndbcluster;
+
+INSERT INTO t1 VALUES (9410,9412);
+
+ALTER TABLE t1 ADD COLUMN c int not null;
+SELECT * FROM t1;
+
+DROP TABLE t1;
+
+#
+# More advanced test
+#
+create table t1 (
+col1 int not null auto_increment primary key,
+col2 varchar(30) not null,
+col3 varchar (20) not null,
+col4 varchar(4) not null,
+col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
+col6 int not null, to_be_deleted int);
+insert into t1 values (2,4,3,5,"PENDING",1,7);
+alter table t1
+add column col4_5 varchar(20) not null after col4,
+add column col7 varchar(30) not null after col5,
+add column col8 datetime not null, drop column to_be_deleted,
+change column col2 fourth varchar(30) not null after col3,
+modify column col6 int not null first;
+select * from t1;
+drop table t1;
diff --git a/mysql-test/t/ndb_autodiscover.test b/mysql-test/t/ndb_autodiscover.test
new file mode 100644
index 00000000000..d04599f223e
--- /dev/null
+++ b/mysql-test/t/ndb_autodiscover.test
@@ -0,0 +1,267 @@
+-- source include/have_ndb.inc
+
+--disable_warnings
+drop table if exists t1,t2,t3,t4,t5,t6,t9;
+--enable_warnings
+
+################################################
+# Test that a table that does not exist as a
+# frm file on disk can be "discovered" from a
+# connected NDB Cluster
+#
+
+flush status;
+
+#
+# Test discover + SELECT
+#
+
+create table t1(
+ id int not null primary key,
+ name char(20)
+) engine=ndb;
+
+insert into t1 values(1, "Autodiscover");
+flush tables;
+system rm var/master-data/test/t1.frm ;
+select * from t1;
+show status like 'handler_discover%';
+
+#
+# Test discover + INSERT
+#
+
+flush tables;
+system rm var/master-data/test/t1.frm ;
+insert into t1 values (2, "Auto 2");
+show status like 'handler_discover%';
+insert into t1 values (3, "Discover 3");
+show status like 'handler_discover%';
+flush tables;
+system rm var/master-data/test/t1.frm ;
+select * from t1 order by id;
+show status like 'handler_discover%';
+
+#
+# Test discover + UPDATE
+#
+
+flush tables;
+system rm var/master-data/test/t1.frm ;
+update t1 set name="Autodiscover" where id = 2;
+show status like 'handler_discover%';
+select * from t1 order by name;
+show status like 'handler_discover%';
+
+#
+# Test discover + DELETE
+#
+
+flush tables;
+system rm var/master-data/test/t1.frm ;
+delete from t1 where id = 3;
+select * from t1 order by id;
+show status like 'handler_discover%';
+
+drop table t1;
+
+
+
+######################################################
+# Test that a table that is outdated on disk
+# can be "discovered" from a connected NDB Cluster
+#
+
+flush status;
+
+create table t2(
+ id int not null primary key,
+ name char(22)
+) engine=ndb;
+insert into t2 values (1, "Discoverer");
+select * from t2;
+show status like 'handler_discover%';
+flush tables;
+
+# Modify the frm file on disk
+system echo "blaj" >> var/master-data/test/t2.frm ;
+select * from t2;
+
+show status like 'handler_discover%';
+
+drop table t2;
+
+
+##################################################
+# Test that a table that already exists in NDB
+# is only discovered if CREATE TABLE IF NOT EXISTS
+# is used
+#
+
+flush status;
+
+create table t3(
+ id int not null primary key,
+ name char(255)
+) engine=ndb;
+insert into t3 values (1, "Explorer");
+select * from t3;
+show status like 'handler_discover%';
+flush tables;
+
+# Remove the frm file from disk
+system rm var/master-data/test/t3.frm ;
+
+--error 1050
+create table t3(
+ id int not null primary key,
+ name char(20), a int, b float, c char(24)
+) engine=ndb;
+
+# The table shall not have been discovered since
+# IF NOT EXISTS wasn't specified
+
+show status like 'handler_discover%';
+SHOW TABLES FROM test;
+
+# now it should be discovered
+create table IF NOT EXISTS t3(
+ id int not null primary key,
+ id2 int not null,
+ name char(20)
+) engine=ndb;
+
+# NOTE! the table called t3 have now been updated to
+# use the same frm as in NDB, thus it's not certain that
+# the table schema is the same as was stated in the
+# CREATE TABLE statement above
+
+show status like 'handler_discover%';
+
+SHOW CREATE TABLE t3;
+
+select * from t3;
+show status like 'handler_discover%';
+
+drop table t3;
+
+#######################################################
+# Test that a table that already exists as frm file
+# but not in NDB can be deleted from disk.
+#
+
+# Manual test
+#flush status;
+#
+#create table t4(
+# id int not null primary key,
+# name char(27)
+#) engine=ndb;
+#insert into t4 values (1, "Automatic");
+#select * from t4;
+#
+# Remove the table from NDB
+#system drop_tab -c "$NDB_CONNECTSTRING2" -d test t4 > /dev/null ;
+#system drop_tab -c "host=localhost:2200;nodeid=5" -d test t4 > /dev/null ;
+#
+#--error 1296
+#select * from t4;
+#
+#flush table t4;
+#--error 1016
+#select * from t4;
+#
+#show status like 'handler_discover%';
+#drop table t4;
+#flush tables;
+#show tables;
+#--error 1146
+#select * from t4;
+
+
+#########################################################
+# Test that a table that has been changed in NDB
+# since it's been opened will be refreshed and discovered
+# again
+#
+
+flush status;
+
+show status like 'handler_discover%';
+
+create table t5(
+ id int not null primary key,
+ name char(200)
+) engine=ndb;
+insert into t5 values (1, "Magnus");
+select * from t5;
+
+ALTER TABLE t5 ADD COLUMN adress char(255) FIRST;
+
+select * from t5;
+
+insert into t5 values
+ ("Adress for record 2", 2, "Carl-Gustav"),
+ ("Adress for record 3", 3, "Karl-Emil");
+update t5 set name="Bertil" where id = 2;
+select * from t5 order by id;
+
+show status like 'handler_discover%';
+
+drop table t5;
+
+
+################################################################
+# Test that a table that has been changed with ALTER TABLE
+# can be used from the same thread
+#
+
+flush status;
+
+show status like 'handler_discover%';
+
+create table t6(
+ id int not null primary key,
+ name char(20)
+) engine=ndb;
+insert into t6 values (1, "Magnus");
+select * from t6;
+
+ALTER TABLE t6 ADD COLUMN adress char(255) FIRST;
+
+select * from t6;
+insert into t6 values
+ ("Adress for record 2", 2, "Carl-Gustav"),
+ ("Adress for record 3", 3, "Karl-Emil");
+update t6 set name="Bertil" where id = 2;
+select * from t6 order by id;
+
+show status like 'handler_discover%';
+
+drop table t6;
+
+######################################################
+# Simple test to show use of discover on startup
+# Note! This should always be the last step in this
+# file, the table t9 will be used and dropped
+# by ndb_autodiscover2
+#
+
+CREATE TABLE t9 (
+ a int NOT NULL PRIMARY KEY,
+ b int
+) engine=ndb;
+
+insert t9 values(1, 2), (2,3), (3, 4), (4, 5);
+
+#Don't drop the table, instead remove the frm file
+system rm var/master-data/test/t9.frm ;
+
+# Now leave test case, when ndb_autodiscover2 will run, this
+# MySQL Server will have been restarted because it has a
+# ndb_autodiscover2-master.opt file. And thus the table should
+# have been discovered by the "discover on startup" function.
+
+#TODO
+#SLECT * FROM t1, t2, t4;
+#handler discover 3;
diff --git a/mysql-test/t/ndb_autodiscover2-master.opt b/mysql-test/t/ndb_autodiscover2-master.opt
new file mode 100644
index 00000000000..e0d075c3fbd
--- /dev/null
+++ b/mysql-test/t/ndb_autodiscover2-master.opt
@@ -0,0 +1 @@
+--skip-external-locking
diff --git a/mysql-test/t/ndb_autodiscover2.test b/mysql-test/t/ndb_autodiscover2.test
new file mode 100644
index 00000000000..297795d909e
--- /dev/null
+++ b/mysql-test/t/ndb_autodiscover2.test
@@ -0,0 +1,13 @@
+-- source include/have_ndb.inc
+
+#
+# Simple test to show use of discover on startup
+# The previous step has simply removed the frm file
+# from disk, but left the table in NDB
+#
+select * from t9 order by a;
+
+# handler_discover should be zero
+show status like 'handler_discover%';
+
+drop table t9;
diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test
index d03abc34633..271357ed561 100644
--- a/mysql-test/t/ndb_basic.test
+++ b/mysql-test/t/ndb_basic.test
@@ -1,7 +1,7 @@
-- source include/have_ndb.inc
--disable_warnings
-DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
--enable_warnings
#
@@ -23,6 +23,7 @@ SELECT pk1 FROM t1;
SELECT * FROM t1;
SELECT t1.* FROM t1;
+# Update on record by primary key
UPDATE t1 SET attr1=1 WHERE pk1=9410;
SELECT * FROM t1;
@@ -35,13 +36,23 @@ SELECT * FROM t1;
DELETE FROM t1;
SELECT * FROM t1;
-# Delete the record by specifying pk
-INSERT INTO t1 VALUES (9410,9412);
+# Insert more records and update them all at once
+INSERT INTO t1 VALUES (9410,9412), (9411, 9413), (9408, 8765),
+(7,8), (8,9), (9,10), (10,11), (11,12), (12,13), (13,14);
+UPDATE t1 SET attr1 = 9999;
+SELECT * FROM t1 ORDER BY pk1;
+
+UPDATE t1 SET attr1 = 9998 WHERE pk1 < 1000;
+SELECT * FROM t1 ORDER BY pk1;
+
+UPDATE t1 SET attr1 = 9997 WHERE attr1 = 9999;
+SELECT * FROM t1 ORDER BY pk1;
+
+# Delete one record by specifying pk
DELETE FROM t1 WHERE pk1 = 9410;
-SELECT * FROM t1;
+SELECT * FROM t1 ORDER BY pk1;
-# Insert three records and delete the
-INSERT INTO t1 VALUES (9410,9412), (9411, 9413), (9408, 8765);
+# Delete all from table
DELETE FROM t1;
SELECT * FROM t1;
@@ -96,3 +107,211 @@ CREATE TABLE t1 (
INSERT INTO t1 values(1, 9999);
DROP TABLE t1;
+
+
+#
+# A more extensive test with a lot more records
+#
+
+CREATE TABLE t2 (
+ a bigint unsigned NOT NULL PRIMARY KEY,
+ b int unsigned not null,
+ c int unsigned
+) engine=ndbcluster;
+
+CREATE TABLE t3 (
+ a bigint unsigned NOT NULL,
+ b bigint unsigned not null,
+ c bigint unsigned,
+ PRIMARY KEY(a)
+) engine=ndbcluster;
+
+CREATE TABLE t4 (
+ a bigint unsigned NOT NULL,
+ b bigint unsigned not null,
+ c bigint unsigned NOT NULL,
+ d int unsigned,
+ PRIMARY KEY(a, b, c)
+) engine=ndbcluster;
+
+
+#
+# insert more records into tables
+#
+let $1=1000;
+disable_query_log;
+while ($1)
+{
+ eval insert into t2 values($1, $1+9, 5);
+ eval insert into t3 values($1, $1+9, 5);
+ eval insert into t4 values($1, $1+9, 5, $1+26000);
+ dec $1;
+}
+enable_query_log;
+
+
+#
+# delete every other record in the tables
+#
+let $1=1000;
+disable_query_log;
+while ($1)
+{
+ eval delete from t2 where a=$1;
+ eval delete from t3 where a=$1;
+ eval delete from t4 where a=$1 and b=$1+9 and c=5;
+ dec $1;
+ dec $1;
+}
+enable_query_log;
+
+
+select * from t2 where a = 7 order by b;
+select * from t2 where a = 7 order by a;
+select * from t2 where a = 7 order by 2;
+select * from t2 where a = 7 order by c;
+
+select * from t2 where a = 7 and b = 16 order by b;
+select * from t2 where a = 7 and b = 16 order by a;
+select * from t2 where a = 7 and b = 17 order by a;
+select * from t2 where a = 7 and b != 16 order by b;
+
+select * from t2 where a = 7 and b = 16 and c = 5 order by b;
+select * from t2 where a = 7 and b = 16 and c = 5 order by a;
+select * from t2 where a = 7 and b = 16 and c = 6 order by a;
+select * from t2 where a = 7 and b != 16 and c = 5 order by b;
+
+select * from t3 where a = 7 order by b;
+select * from t3 where a = 7 order by a;
+select * from t3 where a = 7 order by 2;
+select * from t3 where a = 7 order by c;
+
+select * from t3 where a = 7 and b = 16 order by b;
+select * from t3 where a = 7 and b = 16 order by a;
+select * from t3 where a = 7 and b = 17 order by a;
+select * from t3 where a = 7 and b != 16 order by b;
+
+select * from t4 where a = 7 order by b;
+select * from t4 where a = 7 order by a;
+select * from t4 where a = 7 order by 2;
+select * from t4 where a = 7 order by c;
+
+select * from t4 where a = 7 and b = 16 order by b;
+select * from t4 where a = 7 and b = 16 order by a;
+select * from t4 where a = 7 and b = 17 order by a;
+select * from t4 where a = 7 and b != 16 order by b;
+
+#
+# update records
+#
+let $1=1000;
+disable_query_log;
+while ($1)
+{
+ eval update t2 set c=$1 where a=$1;
+ eval update t3 set c=7 where a=$1 and b=$1+9 and c=5;
+ eval update t4 set d=$1+21987 where a=$1 and b=$1+9 and c=5;
+ dec $1;
+ dec $1;
+}
+enable_query_log;
+
+delete from t2;
+delete from t3;
+delete from t4;
+
+drop table t2;
+drop table t3;
+drop table t4;
+
+#
+# Test delete and update from table with 3 keys
+#
+
+CREATE TABLE t5 (
+ a bigint unsigned NOT NULL,
+ b bigint unsigned not null,
+ c bigint unsigned NOT NULL,
+ d int unsigned,
+ PRIMARY KEY(a, b, c)
+) engine=ndbcluster;
+
+insert into t5 values(10, 19, 5, 26010);
+
+delete from t5 where a=10 and b=19 and c=5;
+
+select * from t5;
+
+insert into t5 values(10, 19, 5, 26010);
+
+update t5 set d=21997 where a=10 and b=19 and c=5;
+
+select * from t5;
+
+delete from t5;
+
+drop table t5;
+
+#
+# Test using table with a char(255) column first in table
+#
+
+CREATE TABLE t6 (
+ adress char(255),
+ a int NOT NULL PRIMARY KEY,
+ b int
+) engine = NDB;
+
+insert into t6 values
+ ("Nice road 3456", 1, 23),
+ ("Street Road 78", 3, 92),
+ ("Road street 89C", 5, 71),
+ (NULL, 7, NULL);
+select * from t6 order by a;
+select a, b from t6 order by a;
+
+update t6 set adress="End of road 09" where a=3;
+update t6 set b=181, adress="Street 76" where a=7;
+select * from t6 order by a;
+select * from t6 where a=1;
+delete from t6 where a=1;
+select * from t6 order by a;
+delete from t6 where b=71;
+select * from t6 order by a;
+
+drop table t6;
+
+#
+# Test using table with a char(255) column first in table and a
+# primary key consisting of two columns
+#
+
+CREATE TABLE t7 (
+ adress char(255),
+ a int NOT NULL,
+ b int,
+ c int NOT NULL,
+ PRIMARY KEY(a, c)
+) engine = NDB;
+
+insert into t7 values
+ ("Highway 3456", 1, 23, 2),
+ ("Street Road 78", 3, 92, 3),
+ ("Main street 89C", 5, 71, 4),
+ (NULL, 8, NULL, 12);
+select * from t7 order by a;
+select a, b from t7 order by a;
+
+update t7 set adress="End of road 09" where a=3;
+update t7 set adress="Gatuvägen 90C" where a=5 and c=4;
+update t7 set adress="No adress" where adress is NULL;
+select * from t7 order by a;
+select * from t7 where a=1 and c=2;
+delete from t7 where a=1;
+delete from t7 where a=3 and c=3;
+delete from t7 where a=5 and c=4;
+select * from t7;
+delete from t7 where b=23;
+select * from t7;
+
+drop table t7;
diff --git a/mysql-test/t/ndb_index.test b/mysql-test/t/ndb_index.test
new file mode 100644
index 00000000000..d3977dc3ea4
--- /dev/null
+++ b/mysql-test/t/ndb_index.test
@@ -0,0 +1,129 @@
+-- source include/have_ndb.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+CREATE TABLE t1 (
+ PORT varchar(16) NOT NULL,
+ ACCESSNODE varchar(16) NOT NULL,
+ POP varchar(48) NOT NULL,
+ ACCESSTYPE int unsigned NOT NULL,
+ CUSTOMER_ID varchar(20) NOT NULL,
+ PROVIDER varchar(16),
+ TEXPIRE int unsigned,
+ NUM_IP int unsigned,
+ LEASED_NUM_IP int unsigned,
+ LOCKED_IP int unsigned,
+ STATIC_DNS int unsigned,
+ SUSPENDED_SERVICE int unsigned,
+ SUSPENDED_REASON int unsigned,
+ BGP_COMMUNITY int unsigned,
+ INDEX CUSTOMER_ID_INDEX(CUSTOMER_ID),
+ INDEX FQPN_INDEX(POP,ACCESSNODE,PORT),
+ PRIMARY KEY(POP,ACCESSNODE,PORT,ACCESSTYPE)
+) engine=ndbcluster;
+
+INSERT INTO t1 VALUES ('port67', 'node78', 'pop98', 1, 'kllopmn', 'pr_43', 121212, 1, 2, 3, 8, NULL, NULL, NULL);
+INSERT INTO t1 VALUES ('port67', 'node78', 'pop99', 2, 'klkighh', 'pr_44', 121213, 3, 3, 6, 7, NULL, NULL, NULL);
+INSERT INTO t1 VALUES ('port79', 'node79', 'pop79', 2, 'kpongfaa', 'pr_44', 981213, 2, 4, 10, 11, 2, 99, 1278);
+
+
+# Test select using port
+select port, accessnode, pop, accesstype from t1 where port='port67' order by accesstype;
+select port, accessnode, pop, accesstype from t1 where port='foo';
+
+# Test select using accessnode
+select port, accessnode, pop, accesstype from t1 where accessnode='node78' order by accesstype;
+select port, accessnode, pop, accesstype from t1 where accessnode='foo';
+
+# Test select using pop
+select port, accessnode, pop, accesstype from t1 where pop='pop98';
+select port, accessnode, pop, accesstype from t1 where pop='pop98';
+select port, accessnode, pop, accesstype from t1 where pop='pop98';
+select port, accessnode, pop, accesstype from t1 where pop='pop98' order by accesstype;
+# The following two querys will not return any rows since
+# the index used for access is case sensitive
+# They are thus disabled for now
+#select port, accessnode, pop, accesstype from t1 where pop='POP98';
+#select port, accessnode, pop, accesstype from t1 where pop='POP98' order by accesstype;
+select port, accessnode, pop, accesstype from t1 where pop='foo';
+
+# Test select using accesstype
+select port, accessnode, pop, accesstype from t1 where accesstype=1;
+select port, accessnode, pop, accesstype from t1 where accesstype=2 order by port;
+select port, accessnode, pop, accesstype from t1 where accesstype=98 order by port;
+
+# Test select using customer_id
+# NOTE! customer_id has a INDEX (ordered index in NDB), it's case sensitive!
+select port, accessnode, pop, accesstype from t1 where customer_id='kllopmn';
+select port, accessnode, pop, accesstype from t1 where customer_id='KLLOPMN';
+select port, accessnode, pop, accesstype from t1 where customer_id='kLLoPMn';
+select port, accessnode, pop, accesstype from t1 where customer_id='foo';
+
+# Test select using provider
+select port, accessnode, pop, accesstype from t1 where provider='pr_43';
+select port, accessnode, pop, accesstype from t1 where provider='foo';
+
+# Test select using texpire
+select port, accessnode from t1 where texpire=121212;
+select port, accessnode from t1 where texpire=2323;
+
+# Test select using num_ip
+select port, accessnode, pop, accesstype from t1 where num_ip=1;
+select port, accessnode, pop, accesstype from t1 where num_ip=89;
+
+# Test select using leased_num_ip
+select port, accessnode, pop, accesstype from t1 where leased_num_ip=2;
+select port, accessnode, pop, accesstype from t1 where leased_num_ip=89;
+
+# Test select using locked_ip
+select port, accessnode, pop, accesstype from t1 where locked_ip=3;
+select port, accessnode, pop, accesstype from t1 where locked_ip=89;
+
+# Test select using static_dns
+select port, accessnode, pop, accesstype from t1 where static_dns=8;
+select port, accessnode, pop, accesstype from t1 where static_dns=89;
+
+# Test select using suspended_service
+select port, accessnode, pop, accesstype from t1 where suspended_service=8;
+select port, accessnode, pop, accesstype from t1 where suspended_service=89;
+
+# Test select using suspended_reason
+select port, accessnode, pop, accesstype from t1 where suspended_reason=NULL;
+select port, accessnode, pop, accesstype from t1 where suspended_reason=89;
+select port, accessnode, pop, accesstype from t1 where suspended_reason=0;
+
+# Test select using bgp_community
+select port, accessnode, pop, accesstype from t1 where bgp_community=NULL;
+select port, accessnode, pop, accesstype from t1 where bgp_community=89;
+select port, accessnode, pop, accesstype from t1 where bgp_community=0;
+
+# Test select using full primary key
+select port, accessnode, pop, accesstype from t1 where port='port67' and accessnode='node78' and pop='pop98' and accesstype=1;
+select port, accessnode, pop, accesstype from t1 where port='port67' and accesstype=1 and accessnode='node78' and pop='pop98';
+select port, accessnode, pop, accesstype from t1 where pop='pop98' and port='port67' and accesstype=1 and accessnode='node78';
+select port, accessnode from t1 where port='foo' and accessnode='foo' and pop='foo' and accesstype=99;
+
+# Test select using partial primary key
+select port, accessnode, pop, accesstype from t1 where port='port67' and pop='pop98' and accesstype=1;
+select port, accessnode, pop, accesstype from t1 where accesstype=1 and accessnode='node78' and pop='pop98';
+select port, accessnode, pop, accesstype from t1 where port='port67' and accesstype=1 and accessnode='node78';
+select port, accessnode from t1 where port='foo' and accessnode='foo' and pop='foo';
+
+# Test select using CUSTOMER_ID_INDEX
+select port, accessnode, pop, accesstype from t1 where customer_id='kllopmn';
+select port, accessnode, pop, accesstype from t1 where customer_id='kllopmn' and accesstype=1;
+select port, accessnode, pop, accesstype from t1 where customer_id='kllopmn' and accesstype=2;
+select port, accessnode, pop, accesstype from t1 where accesstype=2 and customer_id='kllopmn';
+
+# Test select using FQPN_INDEX
+select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessnode='node78' and port='port67';
+#select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessnode='node78' and port='port67' order by accesstype;
+#select port, accessnode, pop, accesstype from t1 where accessnode='node78' and port='port67' and pop='pop98' order by accesstype;
+#select port, accessnode, pop, accesstype from t1 where port='port67' and pop='pop98' and accessnode='node78' order by accesstype;
+select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessnode='node78' and port='port67' and customer_id='kllopmn';
+select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessnode='node78' and port='port67' and customer_id='foo';
+
+
+drop table t1;
diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/t/ndb_index_ordered.test
new file mode 100644
index 00000000000..79686fce0e1
--- /dev/null
+++ b/mysql-test/t/ndb_index_ordered.test
@@ -0,0 +1,112 @@
+-- source include/have_ndb.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+#
+# Simple test to show use of ordered indexes
+#
+
+CREATE TABLE t1 (
+ a int unsigned NOT NULL PRIMARY KEY,
+ b int unsigned not null,
+ c int unsigned,
+ KEY(b)
+) engine=ndbcluster;
+
+insert t1 values(1, 2, 3), (2,3, 5), (3, 4, 6), (4, 5, 8), (5,6, 2), (6,7, 2);
+select * from t1 order by b;
+select * from t1 where b >= 4 order by b;
+select * from t1 where b = 4 order by b;
+select * from t1 where b > 4 order by b;
+select * from t1 where b < 4 order by b;
+select * from t1 where b <= 4 order by b;
+
+#
+# Here we should add some "explain select" to verify that the ordered index is
+# used for these queries.
+#
+
+#
+# Update using ordered index scan
+#
+
+update t1 set c = 3 where b = 3;
+select * from t1 order by a;
+update t1 set c = 10 where b >= 6;
+select * from t1 order by a;
+update t1 set c = 11 where b < 5;
+select * from t1 order by a;
+update t1 set c = 12 where b > 0;
+select * from t1 order by a;
+update t1 set c = 13 where b <= 3;
+select * from t1 order by a;
+
+
+#
+# Delete using ordered index scan
+#
+
+drop table t1;
+
+CREATE TABLE t1 (
+ a int unsigned NOT NULL PRIMARY KEY,
+ b int unsigned not null,
+ c int unsigned,
+ KEY(b)
+) engine=ndbcluster;
+
+insert t1 values(1, 2, 13), (2,3, 13), (3, 4, 12), (4, 5, 12), (5,6, 12), (6,7, 12);
+
+delete from t1 where b = 3;
+select * from t1 order by a;
+delete from t1 where b >= 6;
+select * from t1 order by a;
+delete from t1 where b < 4;
+select * from t1 order by a;
+delete from t1 where b > 5;
+select * from t1 order by a;
+delete from t1 where b <= 4;
+select * from t1 order by a;
+
+drop table t1;
+
+
+#
+#multi part key
+#
+CREATE TABLE t1 (
+ a int unsigned NOT NULL PRIMARY KEY,
+ b int unsigned not null,
+ c int unsigned not null
+) engine = ndb;
+
+create index a1 on t1 (b, c);
+
+insert into t1 values (1, 2, 13);
+insert into t1 values (2,3, 13);
+insert into t1 values (3, 4, 12);
+insert into t1 values (4, 5, 12);
+insert into t1 values (5,6, 12);
+insert into t1 values (6,7, 12);
+insert into t1 values (7, 2, 1);
+insert into t1 values (8,3, 6);
+insert into t1 values (9, 4, 12);
+insert into t1 values (14, 5, 4);
+insert into t1 values (15,5,5);
+insert into t1 values (16,5, 6);
+insert into t1 values (17,4,4);
+insert into t1 values (18,1, 7);
+
+
+
+select * from t1 order by a;
+select * from t1 where b<=5 order by a;
+select * from t1 where b<=5 and c=0;
+insert into t1 values (19,4, 0);
+select * from t1 where b<=5 and c=0;
+select * from t1 where b=4 and c<=5;
+select * from t1 where b<=4 and c<=5 order by a;
+select * from t1 where b<=5 and c=0 or b<=5 and c=2;
+drop table t1;
diff --git a/mysql-test/t/ndb_index_unique.test b/mysql-test/t/ndb_index_unique.test
new file mode 100644
index 00000000000..7cfc9a77452
--- /dev/null
+++ b/mysql-test/t/ndb_index_unique.test
@@ -0,0 +1,175 @@
+-- source include/have_ndb.inc
+
+--disable_warnings
+drop table if exists t1, t2, t3, t4, t5, t6, t7;
+--enable_warnings
+
+#
+# Simple test to show use of UNIQUE indexes
+#
+
+CREATE TABLE t1 (
+ a int unsigned NOT NULL PRIMARY KEY,
+ b int unsigned not null,
+ c int unsigned,
+ UNIQUE(b)
+) engine=ndbcluster;
+
+insert t1 values(1, 2, 3), (2, 3, 5), (3, 4, 6), (4, 5, 8), (5,6, 2), (6,7, 2);
+select * from t1 order by b;
+select * from t1 where b = 4 order by b;
+insert into t1 values(7,8,3);
+select * from t1 where b = 4 order by a;
+
+drop table t1;
+
+
+#
+# Show use of UNIQUE USING HASH indexes
+#
+
+CREATE TABLE t2 (
+ a int unsigned NOT NULL PRIMARY KEY,
+ b int unsigned not null,
+ c int unsigned not null,
+ UNIQUE USING HASH (b, c)
+) engine=ndbcluster;
+
+insert t2 values(1, 2, 3), (2, 3, 5), (3, 4, 6), (4, 5, 8), (5,6, 2), (6,7, 2);
+select * from t2 where a = 3;
+select * from t2 where b = 4;
+select * from t2 where c = 6;
+insert into t2 values(7,8,3);
+select * from t2 where b = 4 order by a;
+
+drop table t2;
+
+#
+# Show use of PRIMARY KEY USING HASH indexes
+#
+
+CREATE TABLE t3 (
+ a int unsigned NOT NULL,
+ b int unsigned not null,
+ c int unsigned,
+ PRIMARY KEY USING HASH (a, b)
+) engine=ndbcluster;
+
+insert t3 values(1, 2, 3), (2, 3, 5), (3, 4, 6), (4, 5, 8), (5,6, 2), (6,7, 2);
+select * from t3 where a = 3;
+select * from t3 where b = 4;
+select * from t3 where c = 6;
+insert into t3 values(7,8,3);
+select * from t3 where b = 4 order by a;
+
+drop table t3;
+
+#
+# More complex tables
+#
+
+CREATE TABLE t1 (
+ cid smallint(5) unsigned NOT NULL default '0',
+ cv varchar(250) NOT NULL default '',
+ PRIMARY KEY (cid),
+ UNIQUE KEY cv (cv)
+) engine=ndbcluster;
+INSERT INTO t1 VALUES (8,'dummy');
+CREATE TABLE t2 (
+ cid bigint(20) unsigned NOT NULL auto_increment,
+ cap varchar(255) NOT NULL default '',
+ PRIMARY KEY (cid)
+) engine=ndbcluster;
+CREATE TABLE t3 (
+ gid bigint(20) unsigned NOT NULL auto_increment,
+ gn varchar(255) NOT NULL default '',
+ must tinyint(4) default NULL,
+ PRIMARY KEY (gid)
+) engine=ndbcluster;
+INSERT INTO t3 VALUES (1,'V1',NULL);
+CREATE TABLE t4 (
+ uid bigint(20) unsigned NOT NULL default '0',
+ gid bigint(20) unsigned NOT NULL,
+ rid bigint(20) unsigned NOT NULL default '-1',
+ cid bigint(20) unsigned NOT NULL default '-1',
+ UNIQUE KEY m (uid,gid,rid,cid)
+) engine=ndbcluster;
+INSERT INTO t4 VALUES (1,1,2,4);
+INSERT INTO t4 VALUES (1,1,2,3);
+INSERT INTO t4 VALUES (1,1,5,7);
+INSERT INTO t4 VALUES (1,1,10,8);
+CREATE TABLE t5 (
+ rid bigint(20) unsigned NOT NULL auto_increment,
+ rl varchar(255) NOT NULL default '',
+ PRIMARY KEY (rid)
+) engine=ndbcluster;
+CREATE TABLE t6 (
+ uid bigint(20) unsigned NOT NULL auto_increment,
+ un varchar(250) NOT NULL default '',
+ uc smallint(5) unsigned NOT NULL default '0',
+ PRIMARY KEY (uid),
+ UNIQUE KEY nc (un,uc)
+) engine=ndbcluster;
+INSERT INTO t6 VALUES (1,'test',8);
+INSERT INTO t6 VALUES (2,'test2',9);
+INSERT INTO t6 VALUES (3,'tre',3);
+CREATE TABLE t7 (
+ mid bigint(20) unsigned NOT NULL PRIMARY KEY,
+ uid bigint(20) unsigned NOT NULL default '0',
+ gid bigint(20) unsigned NOT NULL,
+ rid bigint(20) unsigned NOT NULL default '-1',
+ cid bigint(20) unsigned NOT NULL default '-1',
+ UNIQUE KEY m (uid,gid,rid,cid)
+) engine=ndbcluster;
+INSERT INTO t7 VALUES(1, 1, 1, 1, 1);
+INSERT INTO t7 VALUES(2, 2, 1, 1, 1);
+INSERT INTO t7 VALUES(3, 3, 1, 1, 1);
+INSERT INTO t7 VALUES(4, 4, 1, 1, 1);
+INSERT INTO t7 VALUES(5, 5, 1, 1, 1);
+INSERT INTO t7 VALUES(6, 1, 1, 1, 6);
+INSERT INTO t7 VALUES(7, 2, 1, 1, 7);
+INSERT INTO t7 VALUES(8, 3, 1, 1, 8);
+INSERT INTO t7 VALUES(9, 4, 1, 1, 9);
+INSERT INTO t7 VALUES(10, 5, 1, 1, 10);
+
+select * from t1 where cv = 'dummy';
+select * from t1 where cv = 'test';
+select * from t4 where uid = 1 and gid=1 and rid=2 and cid=4;
+select * from t4 where uid = 1 and gid=1 and rid=1 and cid=4;
+select * from t4 where uid = 1 order by cid;
+select * from t4 where rid = 2 order by cid;
+select * from t6 where un='test' and uc=8;
+select * from t6 where un='test' and uc=7;
+select * from t6 where un='test';
+select * from t7 where mid = 8;
+select * from t7 where uid = 8;
+select * from t7 where uid = 1 order by mid;
+select * from t7 where uid = 4 order by mid;
+select * from t7 where gid = 4;
+select * from t7 where gid = 1 order by mid;
+select * from t7 where cid = 4;
+select * from t7 where cid = 8;
+
+#
+# insert more records into t4
+#
+let $1=100;
+disable_query_log;
+while ($1)
+{
+ eval insert into t4 values(1, $1, 5, 12);
+ eval insert into t4 values($1, 3, 9, 11);
+ dec $1;
+}
+enable_query_log;
+
+select * from t4 where uid = 1 and gid=1 and rid=2 and cid=4;
+select * from t4 where uid = 1 and gid=1 and rid=1 and cid=4;
+select * from t4 where uid = 1 order by gid,cid;
+select * from t4 where uid = 1 order by gid,cid;
+select * from t4 where rid = 2 order by cid;
+
+
+drop table t1,t2,t3,t4,t5,t6,t7;
+
+
diff --git a/mysql-test/t/ndb_insert.test b/mysql-test/t/ndb_insert.test
new file mode 100644
index 00000000000..c55a925dca2
--- /dev/null
+++ b/mysql-test/t/ndb_insert.test
@@ -0,0 +1,433 @@
+-- source include/have_ndb.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+#
+# Basic test of INSERT in NDB
+#
+
+#
+# Create a normal table with primary key
+#
+CREATE TABLE t1 (
+ pk1 INT NOT NULL PRIMARY KEY,
+ b INT NOT NULL,
+ c INT NOT NULL
+) ENGINE=ndbcluster;
+
+INSERT INTO t1 VALUES (0, 0, 0);
+SELECT * FROM t1;
+
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10),
+(11,11,11),(12,12,12),(13,13,13),(14,14,14),(15,15,15),
+(16,16,16),(17,17,17),(18,18,18),(19,19,19),(20,20,20),
+(21,21,21),(22,22,22),(23,23,23),(24,24,24),(25,25,25),
+(26,26,26),(27,27,27),(28,28,28),(29,29,29),(30,30,30),
+(31,31,31),(32,32,32),(33,33,33),(34,34,34),(35,35,35),
+(36,36,36),(37,37,37),(38,38,38),(39,39,39),(40,40,40),
+(41,41,41),(42,42,42),(43,43,43),(44,44,44),(45,45,45),
+(46,46,46),(47,47,47),(48,48,48),(49,49,49),(50,50,50),
+(51,51,51),(52,52,52),(53,53,53),(54,54,54),(55,55,55),
+(56,56,56),(57,57,57),(58,58,58),(59,59,59),(60,60,60),
+(61,61,61),(62,62,62),(63,63,63),(64,64,64),(65,65,65),
+(66,66,66),(67,67,67),(68,68,68),(69,69,69),(70,70,70),
+(71,71,71),(72,72,72),(73,73,73),(74,74,74),(75,75,75),
+(76,76,76),(77,77,77),(78,78,78),(79,79,79),(80,80,80),
+(81,81,81),(82,82,82),(83,83,83),(84,84,84),(85,85,85),
+(86,86,86),(87,87,87),(88,88,88),(89,89,89),(90,90,90),
+(91,91,91),(92,92,92),(93,93,93),(94,94,94),(95,95,95),
+(96,96,96),(97,97,97),(98,98,98),(99,99,99),(100,100,100),
+(101,101,101),(102,102,102),(103,103,103),(104,104,104),(105,105,105),
+(106,106,106),(107,107,107),(108,108,108),(109,109,109),(110,110,110),
+(111,111,111),(112,112,112),(113,113,113),(114,114,114),(115,115,115),
+(116,116,116),(117,117,117),(118,118,118),(119,119,119),(120,120,120),
+(121,121,121),(122,122,122),(123,123,123),(124,124,124),(125,125,125),
+(126,126,126),(127,127,127),(128,128,128),(129,129,129),(130,130,130),
+(131,131,131),(132,132,132),(133,133,133),(134,134,134),(135,135,135),
+(136,136,136),(137,137,137),(138,138,138),(139,139,139),(140,140,140),
+(141,141,141),(142,142,142),(143,143,143),(144,144,144),(145,145,145),
+(146,146,146),(147,147,147),(148,148,148),(149,149,149),(150,150,150),
+(151,151,151),(152,152,152),(153,153,153),(154,154,154),(155,155,155),
+(156,156,156),(157,157,157),(158,158,158),(159,159,159),(160,160,160),
+(161,161,161),(162,162,162),(163,163,163),(164,164,164),(165,165,165),
+(166,166,166),(167,167,167),(168,168,168),(169,169,169),(170,170,170),
+(171,171,171),(172,172,172),(173,173,173),(174,174,174),(175,175,175),
+(176,176,176),(177,177,177),(178,178,178),(179,179,179),(180,180,180),
+(181,181,181),(182,182,182),(183,183,183),(184,184,184),(185,185,185),
+(186,186,186),(187,187,187),(188,188,188),(189,189,189),(190,190,190),
+(191,191,191),(192,192,192),(193,193,193),(194,194,194),(195,195,195),
+(196,196,196),(197,197,197),(198,198,198),(199,199,199),(200,200,200),
+(201,201,201),(202,202,202),(203,203,203),(204,204,204),(205,205,205),
+(206,206,206),(207,207,207),(208,208,208),(209,209,209),(210,210,210),
+(211,211,211),(212,212,212),(213,213,213),(214,214,214),(215,215,215),
+(216,216,216),(217,217,217),(218,218,218),(219,219,219),(220,220,220),
+(221,221,221),(222,222,222),(223,223,223),(224,224,224),(225,225,225),
+(226,226,226),(227,227,227),(228,228,228),(229,229,229),(230,230,230),
+(231,231,231),(232,232,232),(233,233,233),(234,234,234),(235,235,235),
+(236,236,236),(237,237,237),(238,238,238),(239,239,239),(240,240,240),
+(241,241,241),(242,242,242),(243,243,243),(244,244,244),(245,245,245),
+(246,246,246),(247,247,247),(248,248,248),(249,249,249),(250,250,250),
+(251,251,251),(252,252,252),(253,253,253),(254,254,254),(255,255,255),
+(256,256,256),(257,257,257),(258,258,258),(259,259,259),(260,260,260),
+(261,261,261),(262,262,262),(263,263,263),(264,264,264),(265,265,265),
+(266,266,266),(267,267,267),(268,268,268),(269,269,269),(270,270,270),
+(271,271,271),(272,272,272),(273,273,273),(274,274,274),(275,275,275),
+(276,276,276),(277,277,277),(278,278,278),(279,279,279),(280,280,280),
+(281,281,281),(282,282,282),(283,283,283),(284,284,284),(285,285,285),
+(286,286,286),(287,287,287),(288,288,288),(289,289,289),(290,290,290),
+(291,291,291),(292,292,292),(293,293,293),(294,294,294),(295,295,295),
+(296,296,296),(297,297,297),(298,298,298),(299,299,299),(300,300,300),
+(301,301,301),(302,302,302),(303,303,303),(304,304,304),(305,305,305),
+(306,306,306),(307,307,307),(308,308,308),(309,309,309),(310,310,310),
+(311,311,311),(312,312,312),(313,313,313),(314,314,314),(315,315,315),
+(316,316,316),(317,317,317),(318,318,318),(319,319,319),(320,320,320),
+(321,321,321),(322,322,322),(323,323,323),(324,324,324),(325,325,325),
+(326,326,326),(327,327,327),(328,328,328),(329,329,329),(330,330,330),
+(331,331,331),(332,332,332),(333,333,333),(334,334,334),(335,335,335),
+(336,336,336),(337,337,337),(338,338,338),(339,339,339),(340,340,340),
+(341,341,341),(342,342,342),(343,343,343),(344,344,344),(345,345,345),
+(346,346,346),(347,347,347),(348,348,348),(349,349,349),(350,350,350),
+(351,351,351),(352,352,352),(353,353,353),(354,354,354),(355,355,355),
+(356,356,356),(357,357,357),(358,358,358),(359,359,359),(360,360,360),
+(361,361,361),(362,362,362),(363,363,363),(364,364,364),(365,365,365),
+(366,366,366),(367,367,367),(368,368,368),(369,369,369),(370,370,370),
+(371,371,371),(372,372,372),(373,373,373),(374,374,374),(375,375,375),
+(376,376,376),(377,377,377),(378,378,378),(379,379,379),(380,380,380),
+(381,381,381),(382,382,382),(383,383,383),(384,384,384),(385,385,385),
+(386,386,386),(387,387,387),(388,388,388),(389,389,389),(390,390,390),
+(391,391,391),(392,392,392),(393,393,393),(394,394,394),(395,395,395),
+(396,396,396),(397,397,397),(398,398,398),(399,399,399),(400,400,400),
+(401,401,401),(402,402,402),(403,403,403),(404,404,404),(405,405,405),
+(406,406,406),(407,407,407),(408,408,408),(409,409,409),(410,410,410),
+(411,411,411),(412,412,412),(413,413,413),(414,414,414),(415,415,415),
+(416,416,416),(417,417,417),(418,418,418),(419,419,419),(420,420,420),
+(421,421,421),(422,422,422),(423,423,423),(424,424,424),(425,425,425),
+(426,426,426),(427,427,427),(428,428,428),(429,429,429),(430,430,430),
+(431,431,431),(432,432,432),(433,433,433),(434,434,434),(435,435,435),
+(436,436,436),(437,437,437),(438,438,438),(439,439,439),(440,440,440),
+(441,441,441),(442,442,442),(443,443,443),(444,444,444),(445,445,445),
+(446,446,446),(447,447,447),(448,448,448),(449,449,449),(450,450,450),
+(451,451,451),(452,452,452),(453,453,453),(454,454,454),(455,455,455),
+(456,456,456),(457,457,457),(458,458,458),(459,459,459),(460,460,460),
+(461,461,461),(462,462,462),(463,463,463),(464,464,464),(465,465,465),
+(466,466,466),(467,467,467),(468,468,468),(469,469,469),(470,470,470),
+(471,471,471),(472,472,472),(473,473,473),(474,474,474),(475,475,475),
+(476,476,476),(477,477,477),(478,478,478),(479,479,479),(480,480,480),
+(481,481,481),(482,482,482),(483,483,483),(484,484,484),(485,485,485),
+(486,486,486),(487,487,487),(488,488,488),(489,489,489),(490,490,490),
+(491,491,491),(492,492,492),(493,493,493),(494,494,494),(495,495,495),
+(496,496,496),(497,497,497),(498,498,498),(499,499,499),(500, 500, 500);
+
+SELECT COUNT(*) FROM t1;
+
+INSERT INTO t1 VALUES
+(501,501,501),(502,502,502),(503,503,503),(504,504,504),(505,505,505),
+(506,506,506),(507,507,507),(508,508,508),(509,509,509),(510,510,510),
+(511,511,511),(512,512,512),(513,513,513),(514,514,514),(515,515,515),
+(516,516,516),(517,517,517),(518,518,518),(519,519,519),(520,520,520),
+(521,521,521),(522,522,522),(523,523,523),(524,524,524),(525,525,525),
+(526,526,526),(527,527,527),(528,528,528),(529,529,529),(530,530,530),
+(531,531,531),(532,532,532),(533,533,533),(534,534,534),(535,535,535),
+(536,536,536),(537,537,537),(538,538,538),(539,539,539),(540,540,540),
+(541,541,541),(542,542,542),(543,543,543),(544,544,544),(545,545,545),
+(546,546,546),(547,547,547),(548,548,548),(549,549,549),(550,550,550),
+(551,551,551),(552,552,552),(553,553,553),(554,554,554),(555,555,555),
+(556,556,556),(557,557,557),(558,558,558),(559,559,559),(560,560,560),
+(561,561,561),(562,562,562),(563,563,563),(564,564,564),(565,565,565),
+(566,566,566),(567,567,567),(568,568,568),(569,569,569),(570,570,570),
+(571,571,571),(572,572,572),(573,573,573),(574,574,574),(575,575,575),
+(576,576,576),(577,577,577),(578,578,578),(579,579,579),(580,580,580),
+(581,581,581),(582,582,582),(583,583,583),(584,584,584),(585,585,585),
+(586,586,586),(587,587,587),(588,588,588),(589,589,589),(590,590,590),
+(591,591,591),(592,592,592),(593,593,593),(594,594,594),(595,595,595),
+(596,596,596),(597,597,597),(598,598,598),(599,599,599),(600,600,600),
+(601,601,601),(602,602,602),(603,603,603),(604,604,604),(605,605,605),
+(606,606,606),(607,607,607),(608,608,608),(609,609,609),(610,610,610),
+(611,611,611),(612,612,612),(613,613,613),(614,614,614),(615,615,615),
+(616,616,616),(617,617,617),(618,618,618),(619,619,619),(620,620,620),
+(621,621,621),(622,622,622),(623,623,623),(624,624,624),(625,625,625),
+(626,626,626),(627,627,627),(628,628,628),(629,629,629),(630,630,630),
+(631,631,631),(632,632,632),(633,633,633),(634,634,634),(635,635,635),
+(636,636,636),(637,637,637),(638,638,638),(639,639,639),(640,640,640),
+(641,641,641),(642,642,642),(643,643,643),(644,644,644),(645,645,645),
+(646,646,646),(647,647,647),(648,648,648),(649,649,649),(650,650,650),
+(651,651,651),(652,652,652),(653,653,653),(654,654,654),(655,655,655),
+(656,656,656),(657,657,657),(658,658,658),(659,659,659),(660,660,660),
+(661,661,661),(662,662,662),(663,663,663),(664,664,664),(665,665,665),
+(666,666,666),(667,667,667),(668,668,668),(669,669,669),(670,670,670),
+(671,671,671),(672,672,672),(673,673,673),(674,674,674),(675,675,675),
+(676,676,676),(677,677,677),(678,678,678),(679,679,679),(680,680,680),
+(681,681,681),(682,682,682),(683,683,683),(684,684,684),(685,685,685),
+(686,686,686),(687,687,687),(688,688,688),(689,689,689),(690,690,690),
+(691,691,691),(692,692,692),(693,693,693),(694,694,694),(695,695,695),
+(696,696,696),(697,697,697),(698,698,698),(699,699,699),(700,700,700),
+(701,701,701),(702,702,702),(703,703,703),(704,704,704),(705,705,705),
+(706,706,706),(707,707,707),(708,708,708),(709,709,709),(710,710,710),
+(711,711,711),(712,712,712),(713,713,713),(714,714,714),(715,715,715),
+(716,716,716),(717,717,717),(718,718,718),(719,719,719),(720,720,720),
+(721,721,721),(722,722,722),(723,723,723),(724,724,724),(725,725,725),
+(726,726,726),(727,727,727),(728,728,728),(729,729,729),(730,730,730),
+(731,731,731),(732,732,732),(733,733,733),(734,734,734),(735,735,735),
+(736,736,736),(737,737,737),(738,738,738),(739,739,739),(740,740,740),
+(741,741,741),(742,742,742),(743,743,743),(744,744,744),(745,745,745),
+(746,746,746),(747,747,747),(748,748,748),(749,749,749),(750,750,750),
+(751,751,751),(752,752,752),(753,753,753),(754,754,754),(755,755,755),
+(756,756,756),(757,757,757),(758,758,758),(759,759,759),(760,760,760),
+(761,761,761),(762,762,762),(763,763,763),(764,764,764),(765,765,765),
+(766,766,766),(767,767,767),(768,768,768),(769,769,769),(770,770,770),
+(771,771,771),(772,772,772),(773,773,773),(774,774,774),(775,775,775),
+(776,776,776),(777,777,777),(778,778,778),(779,779,779),(780,780,780),
+(781,781,781),(782,782,782),(783,783,783),(784,784,784),(785,785,785),
+(786,786,786),(787,787,787),(788,788,788),(789,789,789),(790,790,790),
+(791,791,791),(792,792,792),(793,793,793),(794,794,794),(795,795,795),
+(796,796,796),(797,797,797),(798,798,798),(799,799,799),(800,800,800),
+(801,801,801),(802,802,802),(803,803,803),(804,804,804),(805,805,805),
+(806,806,806),(807,807,807),(808,808,808),(809,809,809),(810,810,810),
+(811,811,811),(812,812,812),(813,813,813),(814,814,814),(815,815,815),
+(816,816,816),(817,817,817),(818,818,818),(819,819,819),(820,820,820),
+(821,821,821),(822,822,822),(823,823,823),(824,824,824),(825,825,825),
+(826,826,826),(827,827,827),(828,828,828),(829,829,829),(830,830,830),
+(831,831,831),(832,832,832),(833,833,833),(834,834,834),(835,835,835),
+(836,836,836),(837,837,837),(838,838,838),(839,839,839),(840,840,840),
+(841,841,841),(842,842,842),(843,843,843),(844,844,844),(845,845,845),
+(846,846,846),(847,847,847),(848,848,848),(849,849,849),(850,850,850),
+(851,851,851),(852,852,852),(853,853,853),(854,854,854),(855,855,855),
+(856,856,856),(857,857,857),(858,858,858),(859,859,859),(860,860,860),
+(861,861,861),(862,862,862),(863,863,863),(864,864,864),(865,865,865),
+(866,866,866),(867,867,867),(868,868,868),(869,869,869),(870,870,870),
+(871,871,871),(872,872,872),(873,873,873),(874,874,874),(875,875,875),
+(876,876,876),(877,877,877),(878,878,878),(879,879,879),(880,880,880),
+(881,881,881),(882,882,882),(883,883,883),(884,884,884),(885,885,885),
+(886,886,886),(887,887,887),(888,888,888),(889,889,889),(890,890,890),
+(891,891,891),(892,892,892),(893,893,893),(894,894,894),(895,895,895),
+(896,896,896),(897,897,897),(898,898,898),(899,899,899),(900,900,900),
+(901,901,901),(902,902,902),(903,903,903),(904,904,904),(905,905,905),
+(906,906,906),(907,907,907),(908,908,908),(909,909,909),(910,910,910),
+(911,911,911),(912,912,912),(913,913,913),(914,914,914),(915,915,915),
+(916,916,916),(917,917,917),(918,918,918),(919,919,919),(920,920,920),
+(921,921,921),(922,922,922),(923,923,923),(924,924,924),(925,925,925),
+(926,926,926),(927,927,927),(928,928,928),(929,929,929),(930,930,930),
+(931,931,931),(932,932,932),(933,933,933),(934,934,934),(935,935,935),
+(936,936,936),(937,937,937),(938,938,938),(939,939,939),(940,940,940),
+(941,941,941),(942,942,942),(943,943,943),(944,944,944),(945,945,945),
+(946,946,946),(947,947,947),(948,948,948),(949,949,949),(950,950,950),
+(951,951,951),(952,952,952),(953,953,953),(954,954,954),(955,955,955),
+(956,956,956),(957,957,957),(958,958,958),(959,959,959),(960,960,960),
+(961,961,961),(962,962,962),(963,963,963),(964,964,964),(965,965,965),
+(966,966,966),(967,967,967),(968,968,968),(969,969,969),(970,970,970),
+(971,971,971),(972,972,972),(973,973,973),(974,974,974),(975,975,975),
+(976,976,976),(977,977,977),(978,978,978),(979,979,979),(980,980,980),
+(981,981,981),(982,982,982),(983,983,983),(984,984,984),(985,985,985),
+(986,986,986),(987,987,987),(988,988,988),(989,989,989),(990,990,990),
+(991,991,991),(992,992,992),(993,993,993),(994,994,994),(995,995,995),
+(996,996,996),(997,997,997),(998,998,998),(999,999,999),(1000,1000,1000),
+(1001,1001,1001),(1002,1002,1002),(1003,1003,1003),(1004,1004,1004),(1005,1005,1005),
+(1006,1006,1006),(1007,1007,1007),(1008,1008,1008),(1009,1009,1009),(1010,1010,1010),
+(1011,1011,1011),(1012,1012,1012),(1013,1013,1013),(1014,1014,1014),(1015,1015,1015),
+(1016,1016,1016),(1017,1017,1017),(1018,1018,1018),(1019,1019,1019),(1020,1020,1020),
+(1021,1021,1021),(1022,1022,1022),(1023,1023,1023),(1024,1024,1024),(1025,1025,1025),
+(1026,1026,1026),(1027,1027,1027),(1028,1028,1028),(1029,1029,1029),(1030,1030,1030),
+(1031,1031,1031),(1032,1032,1032),(1033,1033,1033),(1034,1034,1034),(1035,1035,1035),
+(1036,1036,1036),(1037,1037,1037),(1038,1038,1038),(1039,1039,1039),(1040,1040,1040),
+(1041,1041,1041),(1042,1042,1042),(1043,1043,1043),(1044,1044,1044),(1045,1045,1045),
+(1046,1046,1046),(1047,1047,1047),(1048,1048,1048),(1049,1049,1049),(1050,1050,1050),
+(1051,1051,1051),(1052,1052,1052),(1053,1053,1053),(1054,1054,1054),(1055,1055,1055),
+(1056,1056,1056),(1057,1057,1057),(1058,1058,1058),(1059,1059,1059),(1060,1060,1060),
+(1061,1061,1061),(1062,1062,1062),(1063,1063,1063),(1064,1064,1064),(1065,1065,1065),
+(1066,1066,1066),(1067,1067,1067),(1068,1068,1068),(1069,1069,1069),(1070,1070,1070),
+(1071,1071,1071),(1072,1072,1072),(1073,1073,1073),(1074,1074,1074),(1075,1075,1075),
+(1076,1076,1076),(1077,1077,1077),(1078,1078,1078),(1079,1079,1079),(1080,1080,1080),
+(1081,1081,1081),(1082,1082,1082),(1083,1083,1083),(1084,1084,1084),(1085,1085,1085),
+(1086,1086,1086),(1087,1087,1087),(1088,1088,1088),(1089,1089,1089),(1090,1090,1090),
+(1091,1091,1091),(1092,1092,1092),(1093,1093,1093),(1094,1094,1094),(1095,1095,1095),
+(1096,1096,1096),(1097,1097,1097),(1098,1098,1098),(1099,1099,1099),(1100,1100,1100),
+(1101,1101,1101),(1102,1102,1102),(1103,1103,1103),(1104,1104,1104),(1105,1105,1105),
+(1106,1106,1106),(1107,1107,1107),(1108,1108,1108),(1109,1109,1109),(1110,1110,1110),
+(1111,1111,1111),(1112,1112,1112),(1113,1113,1113),(1114,1114,1114),(1115,1115,1115),
+(1116,1116,1116),(1117,1117,1117),(1118,1118,1118),(1119,1119,1119),(1120,1120,1120),
+(1121,1121,1121),(1122,1122,1122),(1123,1123,1123),(1124,1124,1124),(1125,1125,1125),
+(1126,1126,1126),(1127,1127,1127),(1128,1128,1128),(1129,1129,1129),(1130,1130,1130),
+(1131,1131,1131),(1132,1132,1132),(1133,1133,1133),(1134,1134,1134),(1135,1135,1135),
+(1136,1136,1136),(1137,1137,1137),(1138,1138,1138),(1139,1139,1139),(1140,1140,1140),
+(1141,1141,1141),(1142,1142,1142),(1143,1143,1143),(1144,1144,1144),(1145,1145,1145),
+(1146,1146,1146),(1147,1147,1147),(1148,1148,1148),(1149,1149,1149),(1150,1150,1150),
+(1151,1151,1151),(1152,1152,1152),(1153,1153,1153),(1154,1154,1154),(1155,1155,1155),
+(1156,1156,1156),(1157,1157,1157),(1158,1158,1158),(1159,1159,1159),(1160,1160,1160),
+(1161,1161,1161),(1162,1162,1162),(1163,1163,1163),(1164,1164,1164),(1165,1165,1165),
+(1166,1166,1166),(1167,1167,1167),(1168,1168,1168),(1169,1169,1169),(1170,1170,1170),
+(1171,1171,1171),(1172,1172,1172),(1173,1173,1173),(1174,1174,1174),(1175,1175,1175),
+(1176,1176,1176),(1177,1177,1177),(1178,1178,1178),(1179,1179,1179),(1180,1180,1180),
+(1181,1181,1181),(1182,1182,1182),(1183,1183,1183),(1184,1184,1184),(1185,1185,1185),
+(1186,1186,1186),(1187,1187,1187),(1188,1188,1188),(1189,1189,1189),(1190,1190,1190),
+(1191,1191,1191),(1192,1192,1192),(1193,1193,1193),(1194,1194,1194),(1195,1195,1195),
+(1196,1196,1196),(1197,1197,1197),(1198,1198,1198),(1199,1199,1199),(1200,1200,1200),
+(1201,1201,1201),(1202,1202,1202),(1203,1203,1203),(1204,1204,1204),(1205,1205,1205),
+(1206,1206,1206),(1207,1207,1207),(1208,1208,1208),(1209,1209,1209),(1210,1210,1210),
+(1211,1211,1211),(1212,1212,1212),(1213,1213,1213),(1214,1214,1214),(1215,1215,1215),
+(1216,1216,1216),(1217,1217,1217),(1218,1218,1218),(1219,1219,1219),(1220,1220,1220),
+(1221,1221,1221),(1222,1222,1222),(1223,1223,1223),(1224,1224,1224),(1225,1225,1225),
+(1226,1226,1226),(1227,1227,1227),(1228,1228,1228),(1229,1229,1229),(1230,1230,1230),
+(1231,1231,1231),(1232,1232,1232),(1233,1233,1233),(1234,1234,1234),(1235,1235,1235),
+(1236,1236,1236),(1237,1237,1237),(1238,1238,1238),(1239,1239,1239),(1240,1240,1240),
+(1241,1241,1241),(1242,1242,1242),(1243,1243,1243),(1244,1244,1244),(1245,1245,1245),
+(1246,1246,1246),(1247,1247,1247),(1248,1248,1248),(1249,1249,1249),(1250,1250,1250),
+(1251,1251,1251),(1252,1252,1252),(1253,1253,1253),(1254,1254,1254),(1255,1255,1255),
+(1256,1256,1256),(1257,1257,1257),(1258,1258,1258),(1259,1259,1259),(1260,1260,1260),
+(1261,1261,1261),(1262,1262,1262),(1263,1263,1263),(1264,1264,1264),(1265,1265,1265),
+(1266,1266,1266),(1267,1267,1267),(1268,1268,1268),(1269,1269,1269),(1270,1270,1270),
+(1271,1271,1271),(1272,1272,1272),(1273,1273,1273),(1274,1274,1274),(1275,1275,1275),
+(1276,1276,1276),(1277,1277,1277),(1278,1278,1278),(1279,1279,1279),(1280,1280,1280),
+(1281,1281,1281),(1282,1282,1282),(1283,1283,1283),(1284,1284,1284),(1285,1285,1285),
+(1286,1286,1286),(1287,1287,1287),(1288,1288,1288),(1289,1289,1289),(1290,1290,1290),
+(1291,1291,1291),(1292,1292,1292),(1293,1293,1293),(1294,1294,1294),(1295,1295,1295),
+(1296,1296,1296),(1297,1297,1297),(1298,1298,1298),(1299,1299,1299),(1300,1300,1300),
+(1301,1301,1301),(1302,1302,1302),(1303,1303,1303),(1304,1304,1304),(1305,1305,1305),
+(1306,1306,1306),(1307,1307,1307),(1308,1308,1308),(1309,1309,1309),(1310,1310,1310),
+(1311,1311,1311),(1312,1312,1312),(1313,1313,1313),(1314,1314,1314),(1315,1315,1315),
+(1316,1316,1316),(1317,1317,1317),(1318,1318,1318),(1319,1319,1319),(1320,1320,1320),
+(1321,1321,1321),(1322,1322,1322),(1323,1323,1323),(1324,1324,1324),(1325,1325,1325),
+(1326,1326,1326),(1327,1327,1327),(1328,1328,1328),(1329,1329,1329),(1330,1330,1330),
+(1331,1331,1331),(1332,1332,1332),(1333,1333,1333),(1334,1334,1334),(1335,1335,1335),
+(1336,1336,1336),(1337,1337,1337),(1338,1338,1338),(1339,1339,1339),(1340,1340,1340),
+(1341,1341,1341),(1342,1342,1342),(1343,1343,1343),(1344,1344,1344),(1345,1345,1345),
+(1346,1346,1346),(1347,1347,1347),(1348,1348,1348),(1349,1349,1349),(1350,1350,1350),
+(1351,1351,1351),(1352,1352,1352),(1353,1353,1353),(1354,1354,1354),(1355,1355,1355),
+(1356,1356,1356),(1357,1357,1357),(1358,1358,1358),(1359,1359,1359),(1360,1360,1360),
+(1361,1361,1361),(1362,1362,1362),(1363,1363,1363),(1364,1364,1364),(1365,1365,1365),
+(1366,1366,1366),(1367,1367,1367),(1368,1368,1368),(1369,1369,1369),(1370,1370,1370),
+(1371,1371,1371),(1372,1372,1372),(1373,1373,1373),(1374,1374,1374),(1375,1375,1375),
+(1376,1376,1376),(1377,1377,1377),(1378,1378,1378),(1379,1379,1379),(1380,1380,1380),
+(1381,1381,1381),(1382,1382,1382),(1383,1383,1383),(1384,1384,1384),(1385,1385,1385),
+(1386,1386,1386),(1387,1387,1387),(1388,1388,1388),(1389,1389,1389),(1390,1390,1390),
+(1391,1391,1391),(1392,1392,1392),(1393,1393,1393),(1394,1394,1394),(1395,1395,1395),
+(1396,1396,1396),(1397,1397,1397),(1398,1398,1398),(1399,1399,1399),(1400,1400,1400),
+(1401,1401,1401),(1402,1402,1402),(1403,1403,1403),(1404,1404,1404),(1405,1405,1405),
+(1406,1406,1406),(1407,1407,1407),(1408,1408,1408),(1409,1409,1409),(1410,1410,1410),
+(1411,1411,1411),(1412,1412,1412),(1413,1413,1413),(1414,1414,1414),(1415,1415,1415),
+(1416,1416,1416),(1417,1417,1417),(1418,1418,1418),(1419,1419,1419),(1420,1420,1420),
+(1421,1421,1421),(1422,1422,1422),(1423,1423,1423),(1424,1424,1424),(1425,1425,1425),
+(1426,1426,1426),(1427,1427,1427),(1428,1428,1428),(1429,1429,1429),(1430,1430,1430),
+(1431,1431,1431),(1432,1432,1432),(1433,1433,1433),(1434,1434,1434),(1435,1435,1435),
+(1436,1436,1436),(1437,1437,1437),(1438,1438,1438),(1439,1439,1439),(1440,1440,1440),
+(1441,1441,1441),(1442,1442,1442),(1443,1443,1443),(1444,1444,1444),(1445,1445,1445),
+(1446,1446,1446),(1447,1447,1447),(1448,1448,1448),(1449,1449,1449),(1450,1450,1450),
+(1451,1451,1451),(1452,1452,1452),(1453,1453,1453),(1454,1454,1454),(1455,1455,1455),
+(1456,1456,1456),(1457,1457,1457),(1458,1458,1458),(1459,1459,1459),(1460,1460,1460),
+(1461,1461,1461),(1462,1462,1462),(1463,1463,1463),(1464,1464,1464),(1465,1465,1465),
+(1466,1466,1466),(1467,1467,1467),(1468,1468,1468),(1469,1469,1469),(1470,1470,1470),
+(1471,1471,1471),(1472,1472,1472),(1473,1473,1473),(1474,1474,1474),(1475,1475,1475),
+(1476,1476,1476),(1477,1477,1477),(1478,1478,1478),(1479,1479,1479),(1480,1480,1480),
+(1481,1481,1481),(1482,1482,1482),(1483,1483,1483),(1484,1484,1484),(1485,1485,1485),
+(1486,1486,1486),(1487,1487,1487),(1488,1488,1488),(1489,1489,1489),(1490,1490,1490),
+(1491,1491,1491),(1492,1492,1492),(1493,1493,1493),(1494,1494,1494),(1495,1495,1495),
+(1496,1496,1496),(1497,1497,1497),(1498,1498,1498),(1499,1499,1499),(1500,1500,1500),
+(1501,1501,1501),(1502,1502,1502),(1503,1503,1503),(1504,1504,1504),(1505,1505,1505),
+(1506,1506,1506),(1507,1507,1507),(1508,1508,1508),(1509,1509,1509),(1510,1510,1510),
+(1511,1511,1511),(1512,1512,1512),(1513,1513,1513),(1514,1514,1514),(1515,1515,1515),
+(1516,1516,1516),(1517,1517,1517),(1518,1518,1518),(1519,1519,1519),(1520,1520,1520),
+(1521,1521,1521),(1522,1522,1522),(1523,1523,1523),(1524,1524,1524),(1525,1525,1525),
+(1526,1526,1526),(1527,1527,1527),(1528,1528,1528),(1529,1529,1529),(1530,1530,1530),
+(1531,1531,1531),(1532,1532,1532),(1533,1533,1533),(1534,1534,1534),(1535,1535,1535),
+(1536,1536,1536),(1537,1537,1537),(1538,1538,1538),(1539,1539,1539),(1540,1540,1540),
+(1541,1541,1541),(1542,1542,1542),(1543,1543,1543),(1544,1544,1544),(1545,1545,1545),
+(1546,1546,1546),(1547,1547,1547),(1548,1548,1548),(1549,1549,1549),(1550,1550,1550),
+(1551,1551,1551),(1552,1552,1552),(1553,1553,1553),(1554,1554,1554),(1555,1555,1555),
+(1556,1556,1556),(1557,1557,1557),(1558,1558,1558),(1559,1559,1559),(1560,1560,1560),
+(1561,1561,1561),(1562,1562,1562),(1563,1563,1563),(1564,1564,1564),(1565,1565,1565),
+(1566,1566,1566),(1567,1567,1567),(1568,1568,1568),(1569,1569,1569),(1570,1570,1570),
+(1571,1571,1571),(1572,1572,1572),(1573,1573,1573),(1574,1574,1574),(1575,1575,1575),
+(1576,1576,1576),(1577,1577,1577),(1578,1578,1578),(1579,1579,1579),(1580,1580,1580),
+(1581,1581,1581),(1582,1582,1582),(1583,1583,1583),(1584,1584,1584),(1585,1585,1585),
+(1586,1586,1586),(1587,1587,1587),(1588,1588,1588),(1589,1589,1589),(1590,1590,1590),
+(1591,1591,1591),(1592,1592,1592),(1593,1593,1593),(1594,1594,1594),(1595,1595,1595),
+(1596,1596,1596),(1597,1597,1597),(1598,1598,1598),(1599,1599,1599),(1600,1600,1600),
+(1601,1601,1601),(1602,1602,1602),(1603,1603,1603),(1604,1604,1604),(1605,1605,1605),
+(1606,1606,1606),(1607,1607,1607),(1608,1608,1608),(1609,1609,1609),(1610,1610,1610),
+(1611,1611,1611),(1612,1612,1612),(1613,1613,1613),(1614,1614,1614),(1615,1615,1615),
+(1616,1616,1616),(1617,1617,1617),(1618,1618,1618),(1619,1619,1619),(1620,1620,1620),
+(1621,1621,1621),(1622,1622,1622),(1623,1623,1623),(1624,1624,1624),(1625,1625,1625),
+(1626,1626,1626),(1627,1627,1627),(1628,1628,1628),(1629,1629,1629),(1630,1630,1630),
+(1631,1631,1631),(1632,1632,1632),(1633,1633,1633),(1634,1634,1634),(1635,1635,1635),
+(1636,1636,1636),(1637,1637,1637),(1638,1638,1638),(1639,1639,1639),(1640,1640,1640),
+(1641,1641,1641),(1642,1642,1642),(1643,1643,1643),(1644,1644,1644),(1645,1645,1645),
+(1646,1646,1646),(1647,1647,1647),(1648,1648,1648),(1649,1649,1649),(1650,1650,1650),
+(1651,1651,1651),(1652,1652,1652),(1653,1653,1653),(1654,1654,1654),(1655,1655,1655),
+(1656,1656,1656),(1657,1657,1657),(1658,1658,1658),(1659,1659,1659),(1660,1660,1660),
+(1661,1661,1661),(1662,1662,1662),(1663,1663,1663),(1664,1664,1664),(1665,1665,1665),
+(1666,1666,1666),(1667,1667,1667),(1668,1668,1668),(1669,1669,1669),(1670,1670,1670),
+(1671,1671,1671),(1672,1672,1672),(1673,1673,1673),(1674,1674,1674),(1675,1675,1675),
+(1676,1676,1676),(1677,1677,1677),(1678,1678,1678),(1679,1679,1679),(1680,1680,1680),
+(1681,1681,1681),(1682,1682,1682),(1683,1683,1683),(1684,1684,1684),(1685,1685,1685),
+(1686,1686,1686),(1687,1687,1687),(1688,1688,1688),(1689,1689,1689),(1690,1690,1690),
+(1691,1691,1691),(1692,1692,1692),(1693,1693,1693),(1694,1694,1694),(1695,1695,1695),
+(1696,1696,1696),(1697,1697,1697),(1698,1698,1698),(1699,1699,1699),(1700,1700,1700),
+(1701,1701,1701),(1702,1702,1702),(1703,1703,1703),(1704,1704,1704),(1705,1705,1705),
+(1706,1706,1706),(1707,1707,1707),(1708,1708,1708),(1709,1709,1709),(1710,1710,1710),
+(1711,1711,1711),(1712,1712,1712),(1713,1713,1713),(1714,1714,1714),(1715,1715,1715),
+(1716,1716,1716),(1717,1717,1717),(1718,1718,1718),(1719,1719,1719),(1720,1720,1720),
+(1721,1721,1721),(1722,1722,1722),(1723,1723,1723),(1724,1724,1724),(1725,1725,1725),
+(1726,1726,1726),(1727,1727,1727),(1728,1728,1728),(1729,1729,1729),(1730,1730,1730),
+(1731,1731,1731),(1732,1732,1732),(1733,1733,1733),(1734,1734,1734),(1735,1735,1735),
+(1736,1736,1736),(1737,1737,1737),(1738,1738,1738),(1739,1739,1739),(1740,1740,1740),
+(1741,1741,1741),(1742,1742,1742),(1743,1743,1743),(1744,1744,1744),(1745,1745,1745),
+(1746,1746,1746),(1747,1747,1747),(1748,1748,1748),(1749,1749,1749),(1750,1750,1750),
+(1751,1751,1751),(1752,1752,1752),(1753,1753,1753),(1754,1754,1754),(1755,1755,1755),
+(1756,1756,1756),(1757,1757,1757),(1758,1758,1758),(1759,1759,1759),(1760,1760,1760),
+(1761,1761,1761),(1762,1762,1762),(1763,1763,1763),(1764,1764,1764),(1765,1765,1765),
+(1766,1766,1766),(1767,1767,1767),(1768,1768,1768),(1769,1769,1769),(1770,1770,1770),
+(1771,1771,1771),(1772,1772,1772),(1773,1773,1773),(1774,1774,1774),(1775,1775,1775),
+(1776,1776,1776),(1777,1777,1777),(1778,1778,1778),(1779,1779,1779),(1780,1780,1780),
+(1781,1781,1781),(1782,1782,1782),(1783,1783,1783),(1784,1784,1784),(1785,1785,1785),
+(1786,1786,1786),(1787,1787,1787),(1788,1788,1788),(1789,1789,1789),(1790,1790,1790),
+(1791,1791,1791),(1792,1792,1792),(1793,1793,1793),(1794,1794,1794),(1795,1795,1795),
+(1796,1796,1796),(1797,1797,1797),(1798,1798,1798),(1799,1799,1799),(1800,1800,1800),
+(1801,1801,1801),(1802,1802,1802),(1803,1803,1803),(1804,1804,1804),(1805,1805,1805),
+(1806,1806,1806),(1807,1807,1807),(1808,1808,1808),(1809,1809,1809),(1810,1810,1810),
+(1811,1811,1811),(1812,1812,1812),(1813,1813,1813),(1814,1814,1814),(1815,1815,1815),
+(1816,1816,1816),(1817,1817,1817),(1818,1818,1818),(1819,1819,1819),(1820,1820,1820),
+(1821,1821,1821),(1822,1822,1822),(1823,1823,1823),(1824,1824,1824),(1825,1825,1825),
+(1826,1826,1826),(1827,1827,1827),(1828,1828,1828),(1829,1829,1829),(1830,1830,1830),
+(1831,1831,1831),(1832,1832,1832),(1833,1833,1833),(1834,1834,1834),(1835,1835,1835),
+(1836,1836,1836),(1837,1837,1837),(1838,1838,1838),(1839,1839,1839),(1840,1840,1840),
+(1841,1841,1841),(1842,1842,1842),(1843,1843,1843),(1844,1844,1844),(1845,1845,1845),
+(1846,1846,1846),(1847,1847,1847),(1848,1848,1848),(1849,1849,1849),(1850,1850,1850),
+(1851,1851,1851),(1852,1852,1852),(1853,1853,1853),(1854,1854,1854),(1855,1855,1855),
+(1856,1856,1856),(1857,1857,1857),(1858,1858,1858),(1859,1859,1859),(1860,1860,1860),
+(1861,1861,1861),(1862,1862,1862),(1863,1863,1863),(1864,1864,1864),(1865,1865,1865),
+(1866,1866,1866),(1867,1867,1867),(1868,1868,1868),(1869,1869,1869),(1870,1870,1870),
+(1871,1871,1871),(1872,1872,1872),(1873,1873,1873),(1874,1874,1874),(1875,1875,1875),
+(1876,1876,1876),(1877,1877,1877),(1878,1878,1878),(1879,1879,1879),(1880,1880,1880),
+(1881,1881,1881),(1882,1882,1882),(1883,1883,1883),(1884,1884,1884),(1885,1885,1885),
+(1886,1886,1886),(1887,1887,1887),(1888,1888,1888),(1889,1889,1889),(1890,1890,1890),
+(1891,1891,1891),(1892,1892,1892),(1893,1893,1893),(1894,1894,1894),(1895,1895,1895),
+(1896,1896,1896),(1897,1897,1897),(1898,1898,1898),(1899,1899,1899),(1900,1900,1900),
+(1901,1901,1901),(1902,1902,1902),(1903,1903,1903),(1904,1904,1904),(1905,1905,1905),
+(1906,1906,1906),(1907,1907,1907),(1908,1908,1908),(1909,1909,1909),(1910,1910,1910),
+(1911,1911,1911),(1912,1912,1912),(1913,1913,1913),(1914,1914,1914),(1915,1915,1915),
+(1916,1916,1916),(1917,1917,1917),(1918,1918,1918),(1919,1919,1919),(1920,1920,1920),
+(1921,1921,1921),(1922,1922,1922),(1923,1923,1923),(1924,1924,1924),(1925,1925,1925),
+(1926,1926,1926),(1927,1927,1927),(1928,1928,1928),(1929,1929,1929),(1930,1930,1930),
+(1931,1931,1931),(1932,1932,1932),(1933,1933,1933),(1934,1934,1934),(1935,1935,1935),
+(1936,1936,1936),(1937,1937,1937),(1938,1938,1938),(1939,1939,1939),(1940,1940,1940),
+(1941,1941,1941),(1942,1942,1942),(1943,1943,1943),(1944,1944,1944),(1945,1945,1945),
+(1946,1946,1946),(1947,1947,1947),(1948,1948,1948),(1949,1949,1949),(1950,1950,1950),
+(1951,1951,1951),(1952,1952,1952),(1953,1953,1953),(1954,1954,1954),(1955,1955,1955),
+(1956,1956,1956),(1957,1957,1957),(1958,1958,1958),(1959,1959,1959),(1960,1960,1960),
+(1961,1961,1961),(1962,1962,1962),(1963,1963,1963),(1964,1964,1964),(1965,1965,1965),
+(1966,1966,1966),(1967,1967,1967),(1968,1968,1968),(1969,1969,1969),(1970,1970,1970),
+(1971,1971,1971),(1972,1972,1972),(1973,1973,1973),(1974,1974,1974),(1975,1975,1975),
+(1976,1976,1976),(1977,1977,1977),(1978,1978,1978),(1979,1979,1979),(1980,1980,1980),
+(1981,1981,1981),(1982,1982,1982),(1983,1983,1983),(1984,1984,1984),(1985,1985,1985),
+(1986,1986,1986),(1987,1987,1987),(1988,1988,1988),(1989,1989,1989),(1990,1990,1990),
+(1991,1991,1991),(1992,1992,1992),(1993,1993,1993),(1994,1994,1994),(1995,1995,1995),
+(1996,1996,1996),(1997,1997,1997),(1998,1998,1998),(1999,1999,1999);
+
+SELECT COUNT(*) FROM t1;
+
+
+
+DROP TABLE t1;
diff --git a/mysql-test/t/ndb_minmax.test b/mysql-test/t/ndb_minmax.test
new file mode 100644
index 00000000000..3be193ce602
--- /dev/null
+++ b/mysql-test/t/ndb_minmax.test
@@ -0,0 +1,66 @@
+-- source include/have_ndb.inc
+
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+
+CREATE TABLE t1 (
+ a int PRIMARY KEY
+) engine = ndb;
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (5);
+INSERT INTO t1 VALUES (6);
+
+select MAX(a) from t1;
+select MAX(a) from t1;
+select MAX(a) from t1;
+select MAX(a) from t1;
+select MIN(a) from t1;
+select MIN(a) from t1;
+select MIN(a) from t1;
+select * from t1 order by a;
+select MIN(a) from t1;
+select MAX(a) from t1;
+select MAX(a) from t1;
+select * from t1 order by a;
+drop table t1;
+
+
+CREATE TABLE t2 (
+ a int PRIMARY KEY,
+ b int not null,
+ c int not null,
+ KEY(b),
+ UNIQUE(c)
+) engine = ndb;
+
+INSERT INTO t2 VALUES (1, 5, 1);
+INSERT INTO t2 VALUES (2, 2, 7);
+INSERT INTO t2 VALUES (3, 3, 3);
+INSERT INTO t2 VALUES (4, 4, 4);
+INSERT INTO t2 VALUES (5, 5, 5);
+INSERT INTO t2 VALUES (6, 6, 6);
+INSERT INTO t2 VALUES (7, 2, 10);
+INSERT INTO t2 VALUES (8, 10, 2);
+
+
+select MAX(a) from t2;
+select MAX(b) from t2;
+select MAX(c) from t2;
+select MIN(a) from t2;
+select MIN(b) from t2;
+select MIN(c) from t2;
+select * from t2 order by a;
+select MIN(b) from t2;
+select MAX(a) from t2;
+select MAX(c) from t2;
+select * from t2 order by a;
+drop table t2;
+
+
+
+
diff --git a/mysql-test/t/ndb_replace.test b/mysql-test/t/ndb_replace.test
new file mode 100644
index 00000000000..8ba332fc7af
--- /dev/null
+++ b/mysql-test/t/ndb_replace.test
@@ -0,0 +1,27 @@
+-- source include/have_ndb.inc
+
+#
+# Test of REPLACE with NDB
+#
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+CREATE TABLE t1 (
+ gesuchnr int(11) DEFAULT '0' NOT NULL,
+ benutzer_id int(11) DEFAULT '0' NOT NULL,
+ PRIMARY KEY (gesuchnr,benutzer_id)
+) engine=ndbcluster;
+
+replace into t1 (gesuchnr,benutzer_id) values (2,1);
+replace into t1 (gesuchnr,benutzer_id) values (1,1);
+replace into t1 (gesuchnr,benutzer_id) values (1,1);
+insert into t1 (gesuchnr, benutzer_id) value (3,2);
+replace into t1 (gesuchnr,benutzer_id) values (1,1);
+replace into t1 (gesuchnr,benutzer_id) values (1,1);
+--error 1022
+insert into t1 (gesuchnr,benutzer_id) values (1,1);
+replace into t1 (gesuchnr,benutzer_id) values (1,1);
+select * from t1 order by gesuchnr;
+drop table t1;
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
new file mode 100644
index 00000000000..35f9b193fe4
--- /dev/null
+++ b/mysql-test/t/ps.test
@@ -0,0 +1,208 @@
+#
+# SQL Syntax for Prepared Statements test
+#
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+
+create table t1
+(
+ a int primary key,
+ b char(10)
+);
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+
+# basic functionality
+set @a=2;
+prepare stmt1 from 'select * from t1 where a <= ?';
+execute stmt1 using @a;
+set @a=3;
+execute stmt1 using @a;
+
+# non-existant statement
+--error 1243
+deallocate prepare no_such_statement;
+
+--error 1210
+execute stmt1;
+
+# Nesting ps commands is not allowed:
+--error 1064
+prepare stmt2 from 'prepare nested_stmt from "select 1"';
+
+--error 1064
+prepare stmt2 from 'execute stmt1';
+
+--error 1064
+prepare stmt2 from 'deallocate prepare z';
+
+# PS insert
+prepare stmt3 from 'insert into t1 values (?,?)';
+set @arg1=5, @arg2='five';
+execute stmt3 using @arg1, @arg2;
+select * from t1 where a>3;
+
+# PS update
+prepare stmt4 from 'update t1 set a=? where b=?';
+set @arg1=55, @arg2='five';
+execute stmt4 using @arg1, @arg2;
+select * from t1 where a>3;
+
+# PS create/delete
+prepare stmt4 from 'create table t2 (a int)';
+execute stmt4;
+prepare stmt4 from 'drop table t2';
+execute stmt4;
+
+# Do something that will cause error
+--error 1051
+execute stmt4;
+
+# placeholders in result field names.
+prepare stmt5 from 'select ? + a from t1';
+set @a=1;
+execute stmt5 using @a;
+
+execute stmt5 using @no_such_var;
+
+set @nullvar=1;
+set @nullvar=NULL;
+execute stmt5 using @nullvar;
+
+set @nullvar2=NULL;
+execute stmt5 using @nullvar2;
+
+# Check that multiple SQL statements are disabled inside PREPARE
+--error 1064
+prepare stmt6 from 'select 1; select2';
+
+--error 1064
+prepare stmt6 from 'insert into t1 values (5,"five"); select2';
+
+# This shouldn't parse
+--error 1064
+explain prepare stmt6 from 'insert into t1 values (5,"five"); select2';
+
+create table t2
+(
+ a int
+);
+
+insert into t2 values (0);
+
+# parameter is NULL
+set @arg00=NULL ;
+prepare stmt1 from 'select 1 FROM t2 where a=?' ;
+execute stmt1 using @arg00 ;
+
+# prepare using variables:
+--error 1064
+prepare stmt1 from @nosuchvar;
+
+set @ivar= 1234;
+--error 1064
+prepare stmt1 from @ivar;
+
+set @fvar= 123.4567;
+--error 1064
+prepare stmt1 from @fvar;
+
+set @str1 = 'select ?';
+set @str2 = convert(@str1 using ucs2);
+prepare stmt1 from @str2;
+execute stmt1 using @ivar;
+drop table t1,t2;
+
+#
+# Bug #4105: Server crash on attempt to prepare a statement with character
+# set introducer
+#
+PREPARE stmt1 FROM "select _utf8 'A' collate utf8_bin = ?";
+set @var='A';
+EXECUTE stmt1 USING @var;
+DEALLOCATE PREPARE stmt1;
+
+#
+# BUG#3486: FOUND_ROWS() fails inside stored procedure [and prepared statement]
+#
+create table t1 (id int);
+prepare stmt1 from "select FOUND_ROWS()";
+select SQL_CALC_FOUND_ROWS * from t1;
+# Expect 0
+execute stmt1;
+insert into t1 values (1);
+select SQL_CALC_FOUND_ROWS * from t1;
+# Expect 1
+execute stmt1;
+# Expect 0
+execute stmt1;
+deallocate prepare stmt1;
+drop table t1;
+
+#
+# prepared EXPLAIN
+#
+create table t1
+(
+ c1 tinyint, c2 smallint, c3 mediumint, c4 int,
+ c5 integer, c6 bigint, c7 float, c8 double,
+ c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
+ c13 date, c14 datetime, c15 timestamp(14), c16 time,
+ c17 year, c18 bit, c19 bool, c20 char,
+ c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
+ c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
+ c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'),
+ c32 set('monday', 'tuesday', 'wednesday')
+) engine = MYISAM ;
+create table t2 like t1;
+
+set @stmt= ' explain SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 where (t1.c2 - 0e-3) = t2.c2 GROUP BY t1.c15 LIMIT 1) as scalar_s, exists (select 1.0e+0 from t2 where t2.c3 * 9.0000000000 = t1.c4) as exists_s, c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s FROM t1, (select c25 x, c32 y from t2) tt WHERE x * 1 = c25 ' ;
+prepare stmt1 from @stmt ;
+execute stmt1 ;
+execute stmt1 ;
+explain SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 where (t1.c2 - 0e-3) = t2.c2 GROUP BY t1.c15 LIMIT 1) as scalar_s, exists (select 1.0e+0 from t2 where t2.c3 * 9.0000000000 = t1.c4) as exists_s, c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s FROM t1, (select c25 x, c32 y from t2) tt WHERE x * 1 = c25;
+deallocate prepare stmt1;
+drop tables t1,t2;
+
+#
+# parameters from variables (for field creation)
+#
+set @arg00=1;
+prepare stmt1 from ' create table t1 (m int) as select 1 as m ' ;
+execute stmt1 ;
+select m from t1;
+drop table t1;
+prepare stmt1 from ' create table t1 (m int) as select ? as m ' ;
+execute stmt1 using @arg00;
+select m from t1;
+deallocate prepare stmt1;
+drop table t1;
+
+#
+# eq() for parameters
+#
+create table t1 (id int(10) unsigned NOT NULL default '0',
+ name varchar(64) NOT NULL default '',
+ PRIMARY KEY (id), UNIQUE KEY `name` (`name`));
+insert into t1 values (1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7');
+prepare stmt1 from 'select name from t1 where id=? or id=?';
+set @id1=1,@id2=6;
+execute stmt1 using @id1, @id2;
+select name from t1 where id=1 or id=6;
+deallocate prepare stmt1;
+drop table t1;
+
+#
+# SHOW TABLE STATUS test
+#
+create table t1 ( a int primary key, b varchar(30)) engine = MYISAM ;
+prepare stmt1 from ' show table status from test like ''t1%'' ';
+--replace_column 12 # 13 # 14 #
+execute stmt1;
+--replace_column 12 # 13 # 14 #
+show table status from test like 't1%' ;
+deallocate prepare stmt1 ;
+drop table t1;
diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test
new file mode 100644
index 00000000000..b7686bbd26a
--- /dev/null
+++ b/mysql-test/t/ps_1general.test
@@ -0,0 +1,739 @@
+###################### ps_general.test #######################
+# #
+# basic and miscellaneous tests for prepared statements #
+# #
+##############################################################
+
+
+# Please do not
+# - modify (INSERT/UPDATE/DELETE) the content of the tables
+# t1 and t_many_col_types. Such tests should be done in
+# include/ps_modify.inc
+# - insert test cases where the results depend on the
+# table type. Such tests should be done in the files
+# include/ps_query.inc, include/ps_modify ...
+#
+
+use test;
+--disable_query_log
+select '------ basic tests ------' as test_sequence ;
+--enable_query_log
+
+let $type= 'MYISAM' ;
+# create the tables (t1 and t_many_col_types) used in many tests
+--source include/ps_create.inc
+# insert data into these tables
+--source include/ps_renew.inc
+
+
+##### The basic functions ####
+
+# 1. PREPARE stmt_name FROM <preparable statement>;
+# <preparable statement> ::=
+# 'literal_stmt' |
+# @variable_ref_stmt.
+# The statement may contain question marks as placeholders for parameters.
+#
+# Bind a statement name to a string containing a SQL statement and
+# send it to the server. The server will parse the statement and
+# reply with "Query Ok" or an error message.
+#
+PREPARE stmt FROM ' select * from t1 where a = ? ' ;
+
+# 2. EXECUTE stmt_name [USING @var [, @var ]];
+# Current values of supplied variables are used as parameters.
+#
+# Send the server the order to execute the statement and supply values
+# for the input parameters needed.
+# If no error occurs the server reply will be identical to the reply for
+# the query used in PREPARE with question marks replaced with values of
+# the input variables.
+#
+SET @var= 2 ;
+EXECUTE stmt USING @var ;
+# The non prepared statement with the same server reply would be:
+select * from t1 where a = @var ;
+
+# 3. DEALLOCATE PREPARE stmt_name;
+#
+# Send the server the order to drop the parse informations.
+# The server will reply with "Query Ok" or an error message.
+DEALLOCATE PREPARE stmt ;
+
+## prepare
+# prepare without parameter
+prepare stmt1 from ' select 1 as my_col ' ;
+# prepare with parameter
+prepare stmt1 from ' select ? as my_col ' ;
+# prepare must fail (incomplete statements/wrong syntax)
+--error 1064
+prepare ;
+--error 1064
+prepare stmt1 ;
+--error 1064
+prepare stmt1 from ;
+--error 1064
+prepare_garbage stmt1 from ' select 1 ' ;
+--error 1064
+prepare stmt1 from_garbage ' select 1 ' ;
+--error 1064
+prepare stmt1 from ' select_garbage 1 ' ;
+--error 1064
+prepare from ' select 1 ' ;
+--error 1064
+prepare stmt1 ' select 1 ' ;
+--error 1064
+prepare ? from ' select ? as my_col ' ;
+# statement in variable
+set @arg00='select 1 as my_col';
+prepare stmt1 from @arg00;
+# prepare must fail (query variable is empty)
+set @arg00='';
+--error 1065
+prepare stmt1 from @arg00;
+set @arg00=NULL;
+# prepare must fail (query variable is NULL)
+--error 1064
+prepare stmt1 from @arg01;
+
+prepare stmt1 from ' select * from t1 where a <= 2 ' ;
+# prepare must fail (column does not exist)
+--error 1054
+prepare stmt1 from ' select * from t1 where x <= 2 ' ;
+--disable_warnings
+drop table if exists not_exist ;
+--enable_warnings
+# prepare must fail (table does not exist)
+--error 1146
+prepare stmt1 from ' select * from not_exist where a <= 2 ' ;
+
+# case derived from client_test.c: test_prepare_syntax()
+# prepare must fail (incomplete statement)
+--error 1064
+prepare stmt1 from ' insert into t1 values(? ' ;
+--error 1064
+prepare stmt1 from ' select a, b from t1
+ where a=? and where ' ;
+
+## execute
+# execute must fail (statement never_prepared never prepared)
+--error 1243
+execute never_prepared ;
+# execute must fail (prepare stmt1 just failed,
+# but there was a successful prepare of stmt1 before)
+prepare stmt1 from ' select * from t1 where a <= 2 ' ;
+--error 1146
+prepare stmt1 from ' select * from not_exist where a <= 2 ' ;
+--error 1243
+execute stmt1 ;
+
+# drop the table between prepare and execute
+create table to_be_dropped
+(
+ a int primary key,
+ b char(30),
+ c int
+);
+insert into to_be_dropped( a, b, c) values( 1, 'original table', 1);
+prepare stmt2 from ' select * from to_be_dropped ' ;
+execute stmt2 ;
+drop table to_be_dropped ;
+# execute must fail (table was dropped after prepare)
+--error 1146
+execute stmt2 ;
+# cases derived from client_test.c: test_select_prepare()
+# 1. drop + create table (same column names/types/order)
+# between prepare and execute
+create table to_be_dropped
+(
+ a int primary key,
+ b char(30),
+ c int
+);
+insert into to_be_dropped( a, b, c) values( 9, 'recreated table', 9);
+execute stmt2 ;
+drop table to_be_dropped ;
+# 2. drop + create table (same column names/types but different order)
+# between prepare and execute
+create table to_be_dropped
+(
+ a int primary key,
+ c int,
+ b char(30)
+);
+insert into to_be_dropped( a, b, c) values( 9, 'recreated table', 9);
+execute stmt2 ;
+drop table to_be_dropped ;
+# 3. drop + create table (same column names/types/order+extra column)
+# between prepare and execute
+create table to_be_dropped
+(
+ a int primary key,
+ b char(30),
+ c int,
+ d timestamp default current_timestamp
+);
+insert into to_be_dropped( a, b, c) values( 9, 'recreated table', 9);
+execute stmt2 ;
+drop table to_be_dropped ;
+# 4. drop + create table (same column names/types, different order +
+# additional column) between prepare and execute
+create table to_be_dropped
+(
+ a int primary key,
+ d timestamp default current_timestamp,
+ b char(30),
+ c int
+);
+insert into to_be_dropped( a, b, c) values( 9, 'recreated table', 9);
+execute stmt2 ;
+drop table to_be_dropped ;
+# 5. drop + create table (same column names/order, different types)
+# between prepare and execute
+create table to_be_dropped
+(
+ a timestamp default '2004-02-29 18:01:59',
+ b char(30),
+ c int
+);
+insert into to_be_dropped( b, c) values( 'recreated table', 9);
+execute stmt2 ;
+drop table to_be_dropped ;
+# 6. drop + create table (same column types/order, different names)
+# between prepare and execute
+create table to_be_dropped
+(
+ f1 int primary key,
+ f2 char(30),
+ f3 int
+);
+insert into to_be_dropped( f1, f2, f3) values( 9, 'recreated table', 9);
+--error 1054
+execute stmt2 ;
+drop table to_be_dropped ;
+
+# execute without parameter
+prepare stmt1 from ' select * from t1 where a <= 2 ' ;
+execute stmt1 ;
+# execute with parameter
+set @arg00=1 ;
+set @arg01='two' ;
+prepare stmt1 from ' select * from t1 where a <= ? ' ;
+execute stmt1 using @arg00;
+# execute must fail (too small number of parameters)
+--error 1210
+execute stmt1 ;
+# execute must fail (too big number of parameters)
+--error 1210
+execute stmt1 using @arg00, @arg01;
+# execute must fail (parameter is not set)
+execute stmt1 using @not_set;
+
+## deallocate
+# deallocate must fail (never_prepared was never prepared)
+--error 1243
+deallocate prepare never_prepared ;
+# deallocate must fail (prepare stmt1 just failed,
+# but there was a successful prepare before)
+prepare stmt1 from ' select * from t1 where a <= 2 ' ;
+--error 1146
+prepare stmt1 from ' select * from not_exist where a <= 2 ' ;
+--error 1243
+deallocate prepare stmt1;
+create table to_be_dropped
+(
+ a int primary key,
+ b char(10)
+);
+prepare stmt2 from ' select a,b from to_be_dropped where a <= 2 ' ;
+drop table to_be_dropped ;
+# deallocate prepared statement where the table was dropped after prepare
+deallocate prepare stmt2;
+
+## parallel use of more than one prepared statement handlers
+# switch between different queries
+prepare stmt1 from ' select a from t1 where a <= 2 ' ;
+prepare stmt2 from ' select b from t1 where a <= 2 ' ;
+execute stmt2 ;
+execute stmt1 ;
+# switch between statement handlers of the same query
+prepare stmt1 from ' select a from t1 where a <= 2 ' ;
+prepare stmt2 from ' select a from t1 where a <= 2 ' ;
+execute stmt2 ;
+execute stmt1 ;
+deallocate prepare stmt1 ;
+# Will the deallocate of stmt1 with the same query affect stmt2 ?
+execute stmt2 ;
+
+--disable_query_log
+select '------ show and misc tests ------' as test_sequence ;
+--enable_query_log
+
+--disable_warnings
+drop table if exists t2;
+--enable_warnings
+create table t2
+(
+ a int primary key, b char(10)
+);
+
+###### SHOW COMMANDS
+prepare stmt4 from ' show databases ';
+execute stmt4;
+prepare stmt4 from ' show tables from test like ''t2%'' ';
+execute stmt4;
+prepare stmt4 from ' show columns from t2 from test like ''a%'' ';
+execute stmt4;
+create index t2_idx on t2(b);
+prepare stmt4 from ' show index from t2 from test ';
+execute stmt4;
+prepare stmt4 from ' show table status from test like ''t2%'' ';
+# egalize date and time values
+--replace_column 12 # 13 # 14 #
+# Bug#4288 : prepared statement 'show table status ..', wrong output on execute
+execute stmt4;
+# try the same with the big table
+prepare stmt4 from ' show table status from test like ''t_many_col_types%'' ';
+# egalize date and time values
+--replace_column 12 # 13 # 14 #
+# Bug#4288
+execute stmt4;
+prepare stmt4 from ' show status like ''Threads_running'' ';
+execute stmt4;
+prepare stmt4 from ' show variables like ''sql_mode'' ';
+execute stmt4;
+prepare stmt4 from ' show engine bdb logs ';
+# The output depends on the history (actions of the bdb engine).
+# That is the reason why, we switch the output here off.
+# (The real output will be tested in ps_6bdb.test)
+# --replace_result $MYSQL_TEST_DIR TEST_DIR
+--disable_result_log
+execute stmt4;
+--enable_result_log
+prepare stmt4 from ' show full processlist ';
+--replace_column 1 number
+execute stmt4;
+prepare stmt4 from ' show grants for user ';
+--error 1295
+prepare stmt4 from ' show create table t2 ';
+--error 1295
+prepare stmt4 from ' show master status ';
+--error 1295
+prepare stmt4 from ' show master logs ';
+--error 1295
+prepare stmt4 from ' show slave status ';
+--error 1295
+prepare stmt4 from ' show warnings limit 20 ';
+--error 1295
+prepare stmt4 from ' show errors limit 20 ';
+prepare stmt4 from ' show storage engines ';
+--replace_column 2 YES/NO
+execute stmt4;
+
+###### MISC STUFF
+## get a warning and an error
+# cases derived from client_test.c: test_warnings(), test_errors()
+--disable_warnings
+drop table if exists tx;
+--enable_warnings
+prepare stmt1 from ' drop table if exists tx ' ;
+execute stmt1 ;
+prepare stmt1 from ' drop table tx ' ;
+--error 1051
+execute stmt1 ;
+
+## nonsense like prepare of prepare,execute or deallocate
+--error 1064
+prepare stmt1 from ' prepare stmt2 from '' select 1 '' ' ;
+--error 1064
+prepare stmt1 from ' execute stmt2 ' ;
+--error 1064
+prepare stmt1 from ' deallocate prepare never_prepared ' ;
+
+## switch the database connection
+--error 1295
+prepare stmt4 from ' use test ' ;
+
+## create/drop database
+--error 1295
+prepare stmt3 from ' create database drop_me ';
+create database drop_me ;
+--error 1295
+prepare stmt3 from ' drop database drop_me ';
+drop database drop_me ;
+
+## grant/revoke + drop user
+--error 1295
+prepare stmt3 from ' grant all on test.t1 to drop_user@localhost
+identified by ''looser'' ';
+grant all on test.t1 to drop_user@localhost
+identified by 'looser' ;
+--error 1295
+prepare stmt3 from ' revoke all privileges on test.t1 from
+drop_user@localhost ';
+revoke all privileges on test.t1 from drop_user@localhost ;
+--error 1295
+prepare stmt3 from ' drop user drop_user@localhost ';
+drop user drop_user@localhost;
+--error 1141
+
+#### table related commands
+## describe
+prepare stmt3 from ' describe t2 ';
+execute stmt3;
+drop table t2 ;
+--error 1146
+execute stmt3;
+## lock/unlock
+--error 1295
+prepare stmt3 from ' lock tables t1 read ' ;
+--error 1295
+prepare stmt3 from ' unlock tables ' ;
+## Load/Unload table contents
+--error 1295
+prepare stmt1 from ' load data infile ''data.txt''
+into table t1 fields terminated by ''\t'' ';
+prepare stmt1 from ' select * into outfile ''data.txt'' from t1 ';
+execute stmt1 ;
+##
+--error 1295
+prepare stmt1 from ' optimize table t1 ' ;
+--error 1295
+prepare stmt1 from ' analyze table t1 ' ;
+--error 1295
+prepare stmt1 from ' checksum table t1 ' ;
+--error 1295
+prepare stmt1 from ' repair table t1 ' ;
+--error 1295
+prepare stmt1 from ' restore table t1 from ''data.txt'' ' ;
+## handler
+--error 1295
+prepare stmt1 from ' handler t1 open ';
+
+
+## commit/rollback
+--error 1295
+prepare stmt3 from ' commit ' ;
+--error 1295
+prepare stmt3 from ' rollback ' ;
+
+
+## switch the sql_mode
+prepare stmt4 from ' SET sql_mode=ansi ';
+execute stmt4;
+# check if the sql_mode is now ansi
+select 'a' || 'b' ;
+prepare stmt4 from ' SET sql_mode="" ';
+execute stmt4;
+# check if the sql_mode is not ansi
+select 'a' || 'b' ;
+# Will a switch of the sqlmode affect the execution of already prepared
+# statements ?
+prepare stmt5 from ' select ''a'' || ''b'' ' ;
+execute stmt5;
+SET sql_mode=ansi;
+execute stmt5;
+SET sql_mode="";
+
+--error 1295
+prepare stmt1 from ' flush local privileges ' ;
+--error 1295
+prepare stmt1 from ' reset query cache ' ;
+--error 1295
+prepare stmt1 from ' KILL 0 ';
+
+## simple explain
+# cases derived from client_test.c: test_explain_bug()
+prepare stmt1 from ' explain select a from t1 order by b ';
+--enable_metadata
+execute stmt1;
+--disable_metadata
+SET @arg00=1 ;
+prepare stmt1 from ' explain select a from t1 where a > ? order by b ';
+--enable_metadata
+execute stmt1 using @arg00;
+--disable_metadata
+
+--disable_query_log
+select '------ create/drop/alter/rename tests ------' as test_sequence ;
+--enable_query_log
+
+--disable_warnings
+drop table if exists t2, t3;
+--enable_warnings
+
+prepare stmt_drop from ' drop table if exists t2 ' ;
+--disable_warnings
+execute stmt_drop;
+--enable_warnings
+
+prepare stmt_create from ' create table t2 (
+ a int primary key, b char(10)) ';
+execute stmt_create;
+prepare stmt3 from ' create table t3 like t2 ';
+execute stmt3;
+drop table t3;
+
+set @arg00=1;
+prepare stmt3 from ' create table t3 (m int) select ? as m ' ;
+# Bug#4280 server hangs, prepared "create table .. as select ? .."
+execute stmt3 using @arg00;
+select m from t3;
+drop table t3;
+
+--error 1295
+prepare stmt3 from ' create index t2_idx on t2(b) ';
+--error 1295
+prepare stmt3 from ' drop index t2_idx on t2 ' ;
+--error 1295
+prepare stmt3 from ' alter table t2 drop primary key ';
+--disable_warnings
+drop table if exists new_t2;
+--enable_warnings
+prepare stmt3 from ' rename table t2 to new_t2 ';
+execute stmt3;
+--error 1050
+execute stmt3;
+rename table new_t2 to t2;
+drop table t2;
+
+--disable_query_log
+select '------ big statement tests ------' as test_sequence ;
+--enable_query_log
+# Attention: The limits used are NOT derived from the manual
+# or other sources.
+
+## many lines ( 50 )
+select 'ABC' as my_const_col from t1 where
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 ;
+prepare stmt1 from ' select ''ABC'' as my_const_col FROM t1 WHERE
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 AND
+1 = 1 ' ;
+execute stmt1 ;
+execute stmt1 ;
+
+## many characters ( about 1400 )
+
+select 'ABC' as my_const_col FROM t1 WHERE
+'1234567890123456789012345678901234567890123456789012345678901234567890'
+= '1234567890123456789012345678901234567890123456789012345678901234567890' AND
+'1234567890123456789012345678901234567890123456789012345678901234567890'
+= '1234567890123456789012345678901234567890123456789012345678901234567890' AND
+'1234567890123456789012345678901234567890123456789012345678901234567890'
+= '1234567890123456789012345678901234567890123456789012345678901234567890' AND
+'1234567890123456789012345678901234567890123456789012345678901234567890'
+= '1234567890123456789012345678901234567890123456789012345678901234567890' AND
+'1234567890123456789012345678901234567890123456789012345678901234567890'
+= '1234567890123456789012345678901234567890123456789012345678901234567890' AND
+'1234567890123456789012345678901234567890123456789012345678901234567890'
+= '1234567890123456789012345678901234567890123456789012345678901234567890' AND
+'1234567890123456789012345678901234567890123456789012345678901234567890'
+= '1234567890123456789012345678901234567890123456789012345678901234567890' AND
+'1234567890123456789012345678901234567890123456789012345678901234567890'
+= '1234567890123456789012345678901234567890123456789012345678901234567890' AND
+'1234567890123456789012345678901234567890123456789012345678901234567890'
+= '1234567890123456789012345678901234567890123456789012345678901234567890' ;
+prepare stmt1 from ' select ''ABC'' as my_const_col FROM t1 WHERE
+''1234567890123456789012345678901234567890123456789012345678901234567890''
+= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND
+''1234567890123456789012345678901234567890123456789012345678901234567890''
+= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND
+''1234567890123456789012345678901234567890123456789012345678901234567890''
+= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND
+''1234567890123456789012345678901234567890123456789012345678901234567890''
+= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND
+''1234567890123456789012345678901234567890123456789012345678901234567890''
+= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND
+''1234567890123456789012345678901234567890123456789012345678901234567890''
+= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND
+''1234567890123456789012345678901234567890123456789012345678901234567890''
+= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND
+''1234567890123456789012345678901234567890123456789012345678901234567890''
+= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND
+''1234567890123456789012345678901234567890123456789012345678901234567890''
+= ''1234567890123456789012345678901234567890123456789012345678901234567890'' ';
+execute stmt1 ;
+execute stmt1 ;
+
+
+## many parameters ( 50 )
+set @arg00= 1;
+set @arg01= 1;
+set @arg02= 1;
+set @arg03= 1;
+set @arg04= 1;
+set @arg05= 1;
+set @arg06= 1;
+set @arg07= 1;
+set @arg10= 1;
+set @arg11= 1;
+set @arg12= 1;
+set @arg13= 1;
+set @arg14= 1;
+set @arg15= 1;
+set @arg16= 1;
+set @arg17= 1;
+set @arg20= 1;
+set @arg21= 1;
+set @arg22= 1;
+set @arg23= 1;
+set @arg24= 1;
+set @arg25= 1;
+set @arg26= 1;
+set @arg27= 1;
+set @arg30= 1;
+set @arg31= 1;
+set @arg32= 1;
+set @arg33= 1;
+set @arg34= 1;
+set @arg35= 1;
+set @arg36= 1;
+set @arg37= 1;
+set @arg40= 1;
+set @arg41= 1;
+set @arg42= 1;
+set @arg43= 1;
+set @arg44= 1;
+set @arg45= 1;
+set @arg46= 1;
+set @arg47= 1;
+set @arg50= 1;
+set @arg51= 1;
+set @arg52= 1;
+set @arg53= 1;
+set @arg54= 1;
+set @arg55= 1;
+set @arg56= 1;
+set @arg57= 1;
+set @arg60= 1;
+set @arg61= 1;
+
+select 'ABC' as my_const_col FROM t1 WHERE
+@arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and
+@arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and
+@arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and
+@arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and
+@arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and
+@arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and
+@arg00=@arg00 ;
+prepare stmt1 from ' select ''ABC'' as my_const_col FROM t1 WHERE
+ ? = ? and ? = ? and ? = ? and ? = ? and
+ ? = ? and ? = ? and ? = ? and ? = ? and
+ ? = ? and ? = ? and ? = ? and ? = ? and
+ ? = ? and ? = ? and ? = ? and ? = ? and
+ ? = ? and ? = ? and ? = ? and ? = ? and
+ ? = ? and ? = ? and ? = ? and ? = ? and
+ ? = ? ' ;
+execute stmt1 using
+@arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00;
+execute stmt1 using
+@arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07,
+@arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, @arg17,
+@arg20, @arg21, @arg22, @arg23, @arg24, @arg25, @arg26, @arg27,
+@arg30, @arg31, @arg32, @arg33, @arg34, @arg35, @arg36, @arg37,
+@arg40, @arg41, @arg42, @arg43, @arg44, @arg45, @arg46, @arg47,
+@arg50, @arg51, @arg52, @arg53, @arg54, @arg55, @arg56, @arg57,
+@arg60, @arg61 ;
+
+drop table t1 ;
diff --git a/mysql-test/t/ps_2myisam.test b/mysql-test/t/ps_2myisam.test
new file mode 100644
index 00000000000..3bb8b01cf87
--- /dev/null
+++ b/mysql-test/t/ps_2myisam.test
@@ -0,0 +1,17 @@
+###############################################
+# #
+# Prepared Statements test on MYISAM tables #
+# #
+###############################################
+
+use test;
+
+let $type= 'MYISAM' ;
+-- source include/ps_create.inc
+-- source include/ps_renew.inc
+
+-- source include/ps_query.inc
+-- source include/ps_modify.inc
+-- source include/ps_modify1.inc
+
+drop table t1, t_many_col_types;
diff --git a/mysql-test/t/ps_3innodb.test b/mysql-test/t/ps_3innodb.test
new file mode 100644
index 00000000000..71acf3b76f1
--- /dev/null
+++ b/mysql-test/t/ps_3innodb.test
@@ -0,0 +1,17 @@
+###############################################
+# #
+# Prepared Statements test on InnoDB tables #
+# #
+###############################################
+
+use test;
+
+let $type= 'InnoDB' ;
+-- source include/ps_create.inc
+-- source include/ps_renew.inc
+
+-- source include/ps_query.inc
+-- source include/ps_modify.inc
+-- source include/ps_modify1.inc
+
+drop table t1, t_many_col_types;
diff --git a/mysql-test/t/ps_4heap.test b/mysql-test/t/ps_4heap.test
new file mode 100644
index 00000000000..8aa715b095e
--- /dev/null
+++ b/mysql-test/t/ps_4heap.test
@@ -0,0 +1,43 @@
+###############################################
+# #
+# Prepared Statements test on HEAP tables #
+# #
+###############################################
+
+use test;
+
+let $type= 'HEAP' ;
+--disable_warnings
+drop table if exists t1, t_many_col_types ;
+--enable_warnings
+eval create table t1
+(
+ a int, b varchar(30),
+ primary key(a)
+) engine = $type ;
+
+--disable_warnings
+drop table if exists t_many_col_types;
+--enable_warnings
+# The used table type doesn't support BLOB/TEXT columns (error 1163)
+# So we use char(100) instead.
+eval create table t_many_col_types
+(
+ c1 tinyint, c2 smallint, c3 mediumint, c4 int,
+ c5 integer, c6 bigint, c7 float, c8 double,
+ c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
+ c13 date, c14 datetime, c15 timestamp(14), c16 time,
+ c17 year, c18 bit, c19 bool, c20 char,
+ c21 char(10), c22 varchar(30), c23 char(100), c24 char(100),
+ c25 char(100), c26 char(100), c27 char(100), c28 char(100),
+ c29 char(100), c30 char(100), c31 enum('one', 'two', 'three'),
+ c32 set('monday', 'tuesday', 'wednesday'),
+ primary key(c1)
+) engine = $type ;
+-- source include/ps_renew.inc
+
+-- source include/ps_query.inc
+-- source include/ps_modify.inc
+-- source include/ps_modify1.inc
+
+drop table t1, t_many_col_types;
diff --git a/mysql-test/t/ps_5merge.test b/mysql-test/t/ps_5merge.test
new file mode 100644
index 00000000000..ee4beea78c4
--- /dev/null
+++ b/mysql-test/t/ps_5merge.test
@@ -0,0 +1,78 @@
+###############################################
+# #
+# Prepared Statements test on MERGE tables #
+# #
+###############################################
+
+use test;
+
+--disable_warnings
+drop table if exists t1, t1_1, t1_2,
+ t_many_col_types, t_many_col_types_1, t_many_col_types_2;
+--enable_warnings
+let $type= 'MYISAM' ;
+-- source include/ps_create.inc
+rename table t1 to t1_1, t_many_col_types to t_many_col_types_1 ;
+-- source include/ps_create.inc
+rename table t1 to t1_2, t_many_col_types to t_many_col_types_2 ;
+
+create table t1
+(
+ a int, b varchar(30),
+ primary key(a)
+) ENGINE = MERGE UNION=(t1_1,t1_2)
+INSERT_METHOD=FIRST;
+create table t_many_col_types
+(
+ c1 tinyint, c2 smallint, c3 mediumint, c4 int,
+ c5 integer, c6 bigint, c7 float, c8 double,
+ c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
+ c13 date, c14 datetime, c15 timestamp(14), c16 time,
+ c17 year, c18 bit, c19 bool, c20 char,
+ c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
+ c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
+ c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'),
+ c32 set('monday', 'tuesday', 'wednesday'),
+ primary key(c1)
+) ENGINE = MERGE UNION=(t_many_col_types_1,t_many_col_types_2)
+INSERT_METHOD=FIRST;
+-- source include/ps_renew.inc
+
+-- source include/ps_query.inc
+-- source include/ps_modify.inc
+# no test of ps_modify1, because insert .. select
+# is not allowed on MERGE tables
+# -- source include/ps_modify1.inc
+
+# Lets's try the same tests with INSERT_METHOD=LAST
+drop table t1, t_many_col_types ;
+create table t1
+(
+ a int, b varchar(30),
+ primary key(a)
+) ENGINE = MERGE UNION=(t1_1,t1_2)
+INSERT_METHOD=LAST;
+create table t_many_col_types
+(
+ c1 tinyint, c2 smallint, c3 mediumint, c4 int,
+ c5 integer, c6 bigint, c7 float, c8 double,
+ c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
+ c13 date, c14 datetime, c15 timestamp(14), c16 time,
+ c17 year, c18 bit, c19 bool, c20 char,
+ c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
+ c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
+ c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'),
+ c32 set('monday', 'tuesday', 'wednesday'),
+ primary key(c1)
+) ENGINE = MERGE UNION=(t_many_col_types_1,t_many_col_types_2)
+INSERT_METHOD=LAST;
+-- source include/ps_renew.inc
+
+-- source include/ps_query.inc
+-- source include/ps_modify.inc
+# no test of ps_modify1, because insert .. select
+# is not allowed on MERGE tables
+# -- source include/ps_modify1.inc
+
+drop table t1, t1_1, t1_2,
+ t_many_col_types_1, t_many_col_types_2, t_many_col_types;
diff --git a/mysql-test/t/ps_6bdb.test b/mysql-test/t/ps_6bdb.test
new file mode 100644
index 00000000000..dde6a05268e
--- /dev/null
+++ b/mysql-test/t/ps_6bdb.test
@@ -0,0 +1,18 @@
+###############################################
+# #
+# Prepared Statements test on BDB tables #
+# #
+###############################################
+
+use test;
+
+-- source include/have_bdb.inc
+let $type= 'BDB' ;
+-- source include/ps_create.inc
+-- source include/ps_renew.inc
+
+-- source include/ps_query.inc
+-- source include/ps_modify.inc
+-- source include/ps_modify1.inc
+
+drop table t1, t_many_col_types;
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index 4665cd02ed8..471af8e4a5b 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -255,7 +255,34 @@ WHERE
);
DROP TABLE t1;
+#
+# Test of problem with IN on many different keyparts. (Bug #4157)
+#
+
+CREATE TABLE t1 (
+id int( 11 ) unsigned NOT NULL AUTO_INCREMENT ,
+line int( 5 ) unsigned NOT NULL default '0',
+columnid int( 3 ) unsigned NOT NULL default '0',
+owner int( 3 ) unsigned NOT NULL default '0',
+ordinal int( 3 ) unsigned NOT NULL default '0',
+showid smallint( 6 ) unsigned NOT NULL default '1',
+tableid int( 1 ) unsigned NOT NULL default '1',
+content int( 5 ) unsigned NOT NULL default '188',
+PRIMARY KEY ( owner, id ) ,
+KEY menu( owner, showid, columnid ) ,
+KEY `COLUMN` ( owner, columnid, line ) ,
+KEY `LINES` ( owner, tableid, content, id ) ,
+KEY recount( owner, line )
+) ENGINE = MYISAM;
+
+INSERT into t1 (owner,id,columnid,line) values (11,15,15,1),(11,13,13,5);
+
+SELECT id, columnid, tableid, content, showid, line, ordinal FROM t1 WHERE owner=11 AND ((columnid IN ( 15, 13, 14 ) AND line IN ( 1, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 31 )) OR (columnid IN ( 13, 14 ) AND line IN ( 15 ))) LIMIT 0 , 30;
+drop table t1;
+
+#
# test for a bug with in() and unique key
+#
create table t1 (id int(10) primary key);
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9);
diff --git a/mysql-test/t/rpl000015.test b/mysql-test/t/rpl000015.test
index 00c14c43ff3..60262fdf59c 100644
--- a/mysql-test/t/rpl000015.test
+++ b/mysql-test/t/rpl000015.test
@@ -12,7 +12,7 @@ show slave status;
change master to master_host='127.0.0.1';
# The following needs to be cleaned up when change master is fixed
---replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT
+--replace_result $MASTER_MYPORT MASTER_PORT $MYSQL_TCP_PORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
--replace_result $MASTER_MYPORT MASTER_PORT
diff --git a/mysql-test/t/rpl_charset.test b/mysql-test/t/rpl_charset.test
new file mode 100644
index 00000000000..c13b57a3108
--- /dev/null
+++ b/mysql-test/t/rpl_charset.test
@@ -0,0 +1,153 @@
+# Replication of character sets.
+# This test will fail if the server/client does not support enough charsets.
+
+# Remember that there currently exists
+# Bug #2326: Charset of table is determined by charset of db only if "USE db;"
+
+source include/master-slave.inc;
+--disable_warnings
+drop database if exists test2;
+drop database if exists test3;
+--enable_warnings
+
+create database test2 character set latin2;
+set @@character_set_server=latin5;
+create database test3;
+--disable_query_log
+select "--- --master--" as "";
+--enable_query_log
+show create database test2;
+show create database test3;
+sync_slave_with_master;
+--disable_query_log
+select "--- --slave--" as "";
+--enable_query_log
+show create database test2;
+show create database test3;
+
+connection master;
+set @@collation_server=armscii_bin;
+drop database test3;
+create database test3;
+--disable_query_log
+select "--- --master--" as "";
+--enable_query_log
+show create database test3;
+sync_slave_with_master;
+--disable_query_log
+select "--- --slave--" as "";
+--enable_query_log
+show create database test3;
+
+connection master;
+use test2;
+create table t1 (a int auto_increment primary key, b varchar(100));
+set character_set_client=cp850, collation_connection=latin2_croatian_ci;
+insert into t1 (b) values(@@character_set_server);
+insert into t1 (b) values(@@collation_server);
+# character_set_database and collation_database are not tested as they
+# are not replicated (Bar said that this variable may be removed shortly).
+insert into t1 (b) values(@@character_set_client);
+# collation_client does not exist
+insert into t1 (b) values(@@character_set_connection);
+insert into t1 (b) values(@@collation_connection);
+--disable_query_log
+select "--- --master--" as "";
+--enable_query_log
+select * from t1 order by a;
+sync_slave_with_master;
+--disable_query_log
+select "--- --slave--" as "";
+--enable_query_log
+select * from test2.t1 order by a;
+
+connection master;
+set character_set_client=latin1, collation_connection=latin1_german1_ci;
+truncate table t1;
+insert into t1 (b) values(@@collation_connection);
+insert into t1 (b) values(LEAST("Mller","Muffler"));
+set collation_connection=latin1_german2_ci;
+insert into t1 (b) values(@@collation_connection);
+insert into t1 (b) values(LEAST("Mller","Muffler"));
+--disable_query_log
+select "--- --master--" as "";
+--enable_query_log
+select * from t1 order by a;
+sync_slave_with_master;
+--disable_query_log
+select "--- --slave--" as "";
+--enable_query_log
+select * from test2.t1 order by a;
+
+# See if SET ONE_SHOT gets into binlog when LOAD DATA
+connection master;
+load data infile '../../std_data/words.dat' into table t1 (b);
+
+# See if user var is prefixed with collation in binlog and replicated well.
+# Note: replication of user variables is broken as far as derivation is
+# concerned. That's because when we store a user variable in the binlog,
+# we lose its derivation. So later on the slave, it's impossible to
+# know if the collation was explicit or not, so we use DERIVATION_NONE,
+# which provokes error messages (like 'Illegal mix of collation') when
+# we replay the master's INSERT/etc statements.
+set @a= _cp850 'Mller' collate cp850_general_ci;
+truncate table t1;
+insert into t1 (b) values(collation(@a));
+--disable_query_log
+select "--- --master--" as "";
+--enable_query_log
+select * from t1 order by a;
+sync_slave_with_master;
+--disable_query_log
+select "--- --slave--" as "";
+--enable_query_log
+select * from test2.t1 order by a;
+
+connection master;
+drop database test2;
+drop database test3;
+show binlog events from 79;
+sync_slave_with_master;
+
+# Check that we can't change global.collation_server
+
+error 1105;
+set global character_set_server=latin2;
+connection master;
+error 1105;
+set global character_set_server=latin2;
+
+# Check that SET ONE_SHOT is really one shot
+
+set one_shot @@character_set_server=latin5;
+set @@max_join_size=1000;
+select @@character_set_server;
+select @@character_set_server;
+set @@character_set_server=latin5;
+select @@character_set_server;
+select @@character_set_server;
+
+# ONE_SHOT on not charset/collation stuff is not allowed
+error 1105;
+set one_shot max_join_size=10;
+
+# Test of wrong character set numbers;
+error 1115;
+set character_set_client=9999999;
+error 1273;
+set collation_server=9999998;
+
+# This one was contributed by Sergey Petrunia (BUG#3943)
+
+use test;
+CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255));
+SET CHARACTER_SET_CLIENT=koi8r,
+ CHARACTER_SET_CONNECTION=cp1251,
+ CHARACTER_SET_RESULTS=koi8r;
+INSERT INTO t1 (c1, c2) VALUES (', ',', ');
+select hex(c1), hex(c2) from t1;
+sync_slave_with_master;
+select hex(c1), hex(c2) from t1;
+connection master;
+drop table t1;
+sync_slave_with_master;
diff --git a/mysql-test/t/rpl_delete_all.test b/mysql-test/t/rpl_delete_all.test
new file mode 100644
index 00000000000..6ca98b34caf
--- /dev/null
+++ b/mysql-test/t/rpl_delete_all.test
@@ -0,0 +1,41 @@
+source include/master-slave.inc;
+
+connection slave;
+create database test1;
+connection master;
+drop database if exists test1;
+sync_slave_with_master;
+# can't read dir
+--replace_result "Errcode: 1" "Errcode: X" "Errcode: 2" "Errcode: X"
+--error 12
+show tables from test1;
+
+connection slave;
+create table t1 (a int);
+connection master;
+drop table if exists t1;
+sync_slave_with_master;
+# table does not exist
+--error 1146
+select * from t1;
+
+connection master;
+create table t1 (a int);
+sync_slave_with_master;
+insert into t1 values(1);
+connection master;
+delete from t1;
+sync_slave_with_master;
+select * from t1;
+
+insert into t1 values(1);
+connection master;
+insert into t1 values(2);
+update t1 set a=2;
+sync_slave_with_master;
+select * from t1;
+
+# cleanup
+connection master;
+drop table t1;
+sync_slave_with_master;
diff --git a/mysql-test/t/rpl_free_items-slave.opt b/mysql-test/t/rpl_free_items-slave.opt
new file mode 100644
index 00000000000..b828d03fafb
--- /dev/null
+++ b/mysql-test/t/rpl_free_items-slave.opt
@@ -0,0 +1 @@
+--replicate-wild-ignore-table=test.%
diff --git a/mysql-test/t/rpl_free_items.test b/mysql-test/t/rpl_free_items.test
new file mode 100644
index 00000000000..3228ffd9cde
--- /dev/null
+++ b/mysql-test/t/rpl_free_items.test
@@ -0,0 +1,20 @@
+source include/master-slave.inc;
+create table t1 (a int);
+create table t2 (a int);
+disable_query_log;
+SET @query="INSERT INTO t2 SELECT * FROM t1 WHERE a REGEXP \"0\"";
+let $1 = 2000;
+while ($1)
+{
+ eval SET @query=concat(@query, " OR a REGEXP '$1'");
+ dec $1;
+}
+let $1=`select @query`;
+eval $1;
+enable_query_log;
+# I have seen the slave crash either now or at shutdown
+sync_slave_with_master;
+connection master;
+drop table t1;
+drop table t2;
+sync_slave_with_master;
diff --git a/mysql-test/t/rpl_get_lock.test b/mysql-test/t/rpl_get_lock.test
index c3b033fb03a..5e58753e59a 100644
--- a/mysql-test/t/rpl_get_lock.test
+++ b/mysql-test/t/rpl_get_lock.test
@@ -22,7 +22,7 @@ connection slave;
sync_with_master;
select get_lock("lock",3);
select * from t1;
-select is_free_lock("lock"), is_used_lock("lock");
+select is_free_lock("lock"), is_used_lock("lock") = connection_id();
explain extended select is_free_lock("lock"), is_used_lock("lock");
# Check lock functions
select is_free_lock("lock2");
diff --git a/mysql-test/t/rpl_ps.test b/mysql-test/t/rpl_ps.test
new file mode 100644
index 00000000000..79f48381a4f
--- /dev/null
+++ b/mysql-test/t/rpl_ps.test
@@ -0,0 +1,43 @@
+#
+# Test of replicating user variables
+#
+source include/master-slave.inc;
+
+#save_master_pos;
+#connection slave;
+#sync_with_master;
+#reset master;
+#connection master;
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+create table t1(n char(30));
+
+prepare stmt1 from 'insert into t1 values (?)';
+set @var1= "from-master-1";
+execute stmt1 using @var1;
+set @var1= "from-master-2-'',";
+execute stmt1 using @var1;
+select * from t1;
+
+set @var2= 'insert into t1 values (concat("from-var-", ?))';
+prepare stmt2 from @var2;
+set @var1='from-master-3';
+execute stmt2 using @var1;
+
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from t1;
+
+connection master;
+
+drop table t1;
+
+save_master_pos;
+connection slave;
+sync_with_master;
+stop slave;
+
diff --git a/mysql-test/t/rpl_relayspace-slave.opt b/mysql-test/t/rpl_relayspace-slave.opt
index 05cb01731d2..06d96aa3b9a 100644
--- a/mysql-test/t/rpl_relayspace-slave.opt
+++ b/mysql-test/t/rpl_relayspace-slave.opt
@@ -1 +1 @@
- -O relay_log_space_limit=10 \ No newline at end of file
+--relay_log_space_limit=10
diff --git a/mysql-test/t/rpl_server_id1.test b/mysql-test/t/rpl_server_id1.test
index aefcb81c930..4d504325294 100644
--- a/mysql-test/t/rpl_server_id1.test
+++ b/mysql-test/t/rpl_server_id1.test
@@ -1,5 +1,8 @@
-# This test checks that a slave does not execute queries originating
-# from itself, by default.
+# This test checks that the slave I/O thread refuses to start if slave
+# and master have the same server id (because this is a useless setup,
+# and otherwise SHOW SLAVE STATUS shows progress but all queries are
+# ignored, which has caught our customers), unless
+# --replicate-same-server-id.
source include/master-slave.inc;
connection slave;
@@ -18,5 +21,4 @@ insert into t1 values (1);
# (when slave is its own master without --replicate-same-server-id)
sleep 2; # enough time for the event to be replicated (it should not)
show status like "slave_running";
-select * from t1;
drop table t1;
diff --git a/mysql-test/t/rpl_timezone-master.opt b/mysql-test/t/rpl_timezone-master.opt
new file mode 100644
index 00000000000..8e43bfbbb7e
--- /dev/null
+++ b/mysql-test/t/rpl_timezone-master.opt
@@ -0,0 +1 @@
+--default-time-zone=Europe/Moscow
diff --git a/mysql-test/t/rpl_timezone-slave.opt b/mysql-test/t/rpl_timezone-slave.opt
new file mode 100644
index 00000000000..8e43bfbbb7e
--- /dev/null
+++ b/mysql-test/t/rpl_timezone-slave.opt
@@ -0,0 +1 @@
+--default-time-zone=Europe/Moscow
diff --git a/mysql-test/t/rpl_timezone.test b/mysql-test/t/rpl_timezone.test
new file mode 100644
index 00000000000..8dff90a84cf
--- /dev/null
+++ b/mysql-test/t/rpl_timezone.test
@@ -0,0 +1,84 @@
+# Test of replication of time zones.
+source include/master-slave.inc;
+
+# Some preparations
+let $VERSION=`select version()`;
+create table t1 (t timestamp);
+create table t2 (t char(32));
+
+#
+# Let us check how well replication works when we are saving datetime
+# value in TIMESTAMP field.
+#
+connection master;
+select @@time_zone;
+set time_zone='UTC';
+insert into t1 values ('20040101000000'), ('20040611093902');
+select * from t1;
+# On slave we still in 'Europe/Moscow' so we should see equivalent but
+# textually different values.
+sync_slave_with_master;
+select * from t1;
+
+# Let us check also that setting of time_zone back to default also works
+# well
+connection master;
+delete from t1;
+set time_zone='Europe/Moscow';
+insert into t1 values ('20040101000000'), ('20040611093902');
+select * from t1;
+sync_slave_with_master;
+select * from t1;
+connection master;
+# We should not see SET ONE_SHOT time_zone before second insert
+--replace_result $VERSION VERSION
+show binlog events;
+
+#
+# Now let us check how well we replicate statments reading TIMESTAMP fields
+# (We should see the same data on master and on slave but it should differ
+# from originally inserted)
+#
+set time_zone='MET';
+insert into t2 (select t from t1);
+select * from t1;
+sync_slave_with_master;
+select * from t2;
+
+#
+# Now let us check how well we replicate various CURRENT_* functions
+#
+connection master;
+delete from t2;
+set timestamp=1000072000;
+insert into t2 values (current_timestamp), (current_date), (current_time);
+sync_slave_with_master;
+# Values in ouput of these to queries should differ because we are in
+# in 'MET' on master and in 'Europe/Moscow on slave...
+set timestamp=1000072000;
+select current_timestamp, current_date, current_time;
+select * from t2;
+
+#
+# At last let us check replication of FROM_UNIXTIME/UNIX_TIMESTAMP functions.
+#
+connection master;
+delete from t2;
+insert into t2 values (from_unixtime(1000000000)),
+ (unix_timestamp('2001-09-09 03:46:40'));
+select * from t2;
+sync_slave_with_master;
+# We should get same result on slave as on master
+select * from t2;
+
+#
+# Let us check that we are not allowing to set global time_zone with
+# replication
+#
+connection master;
+--error 1105
+set global time_zone='MET';
+
+# Clean up
+drop table t1, t2;
+sync_slave_with_master;
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 0a3de178456..57827f3cc7f 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -1771,7 +1771,9 @@ CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned defa
INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL);
CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35);
-SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'NULL' AND b.sampletime < 'NULL' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid;
+SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid;
+# Testing the same select with NULL's instead of invalid datetime values
+SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid;
DROP TABLE t1,t2;
#
diff --git a/mysql-test/t/select_found.test b/mysql-test/t/select_found.test
index e63e894c1cf..c20b6e9ab6c 100644
--- a/mysql-test/t/select_found.test
+++ b/mysql-test/t/select_found.test
@@ -137,3 +137,22 @@ WHERE ( r = 1 AND a IN ( 1, 2 ) AND ( u = 'w' OR u LIKE 'w/%' ) )
OR ( r = 1 AND a IN ( 1, 2, 3 ) AND ( u = 'w' ) );
drop table t1;
+#
+# Bug #3738: we have a ref key
+#
+
+CREATE TABLE t1 (a VARCHAR(16), UNIQUE(a));
+INSERT INTO t1 VALUES ('1'), ('2'), ('3');
+SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a = '2' LIMIT 0, 1;
+SELECT FOUND_ROWS();
+DROP TABLE t1;
+
+#
+# Bug #3845: group by, having and empty result
+#
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (0), (0), (1), (2);
+SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a = 0 GROUP BY a HAVING a > 10;
+SELECT FOUND_ROWS();
+DROP TABLE t1;
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index deb95af9168..3ff2605cff4 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -222,37 +222,37 @@ CREATE TABLE t3 (
insert into t1 values (1),(2);
insert into t2 values (1),(2);
insert into t3 values (1,1),(2,2);
---replace_column 6 # 7 # 8 #
+--replace_column 7 # 8 # 9 #
show table status;
insert into t1 values (3),(4);
insert into t2 values (3),(4);
insert into t3 values (3,3),(4,4);
---replace_column 6 # 7 # 8 #
+--replace_column 7 # 8 # 9 #
show table status;
insert into t1 values (5);
insert into t2 values (5);
insert into t3 values (5,5);
---replace_column 6 # 7 # 8 #
+--replace_column 7 # 8 # 9 #
show table status;
delete from t1 where a=3;
delete from t2 where b=3;
delete from t3 where a=3;
---replace_column 6 # 7 # 8 #
+--replace_column 7 # 8 # 9 #
show table status;
delete from t1;
delete from t2;
delete from t3;
---replace_column 6 # 7 # 8 #
+--replace_column 7 # 8 # 9 #
show table status;
insert into t1 values (5);
insert into t2 values (5);
insert into t3 values (5,5);
---replace_column 6 # 7 # 8 #
+--replace_column 7 # 8 # 9 #
show table status;
delete from t1 where a=5;
delete from t2 where b=5;
delete from t3 where a=5;
---replace_column 6 # 7 # 8 #
+--replace_column 7 # 8 # 9 #
show table status;
drop table t1, t2, t3;
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 7807f139a93..3a729b37d99 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -135,7 +135,7 @@ explain extended select * from t6 where exists (select * from t7 where uq = clin
select * from t1 where a= (select a from t2,t4 where t2.b=t4.b);
# different tipes & group functions
-drop table if exists t1,t2,t3;
+drop table t1,t2,t3;
CREATE TABLE t3 (a varchar(20),b char(1) NOT NULL default '0');
INSERT INTO t3 VALUES ('W','a'),('A','c'),('J','b');
@@ -1163,3 +1163,57 @@ SELECT a FROM t1 WHERE a >= ALL ( SELECT a FROM t1 WHERE b = 2 );
SELECT a FROM t1 WHERE a <= ALL ( SELECT a FROM t1 WHERE b = 2 );
SELECT a FROM t1 WHERE a <> ALL ( SELECT a FROM t1 WHERE b = 2 );
DROP TABLE t1;
+
+#
+# SELECT(EXISTS * ...)optimisation
+#
+create table t1 (a int, b int);
+insert into t1 values (1,2),(3,4);
+select * from t1 up where exists (select * from t1 where t1.a=up.a);
+explain extended select * from t1 up where exists (select * from t1 where t1.a=up.a);
+drop table t1;
+
+#
+# Bug #4102: subselect in HAVING
+#
+
+CREATE TABLE t1 (t1_a int);
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t2 (t2_a int, t2_b int, PRIMARY KEY (t2_a, t2_b));
+INSERT INTO t2 VALUES (1, 1), (1, 2);
+SELECT * FROM t1, t2 table2 WHERE t1_a = 1 AND table2.t2_a = 1
+ HAVING table2.t2_b = (SELECT MAX(t2_b) FROM t2 WHERE t2_a = table2.t2_a);
+DROP TABLE t1, t2;
+
+#
+# Test problem with NULL and derived tables (Bug #4097)
+#
+
+CREATE TABLE t1 (id int(11) default NULL,name varchar(10) default NULL);
+INSERT INTO t1 VALUES (1,'Tim'),(2,'Rebecca'),(3,NULL);
+CREATE TABLE t2 (id int(11) default NULL, pet varchar(10) default NULL);
+INSERT INTO t2 VALUES (1,'Fido'),(2,'Spot'),(3,'Felix');
+SELECT a.*, b.* FROM (SELECT * FROM t1) AS a JOIN t2 as b on a.id=b.id;
+drop table t1,t2;
+
+#
+# outer fields resolving in INSERT/REPLACE and CRETE with SELECT
+#
+CREATE TABLE t1 ( a int, b int );
+CREATE TABLE t2 ( c int, d int );
+INSERT INTO t1 VALUES (1,2), (2,3), (3,4);
+SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);
+INSERT INTO t2 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);
+select * from t2;
+CREATE TABLE t3 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);
+select * from t3;
+prepare stmt1 from "INSERT INTO t2 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);";
+execute stmt1;
+deallocate prepare stmt1;
+select * from t2;
+drop table t3;
+prepare stmt1 from "CREATE TABLE t3 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);";
+execute stmt1;
+select * from t3;
+deallocate prepare stmt1;
+DROP TABLE t1, t2, t3;
diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test
index 47642832158..8c13171d221 100644
--- a/mysql-test/t/subselect_innodb.test
+++ b/mysql-test/t/subselect_innodb.test
@@ -101,3 +101,13 @@ insert into t2 values (1,'z'),(2,'x');
select t2.id,t2.value,(select t1.value from t1 where t1.id=t2.id) from t2;
select t2.id,t2.value,(select t1.value from t1 where t1.id=t2.id) from t2;
drop table t1,t2;
+
+#
+# unlocking tables with subqueries in HAVING
+#
+create table t1 (a int, b int) engine=innodb;
+insert into t1 values (1,2), (1,3), (2,3), (2,4), (2,5), (3,4), (4,5), (4,100);
+create table t2 (a int) engine=innodb;
+insert into t2 values (1),(2),(3),(4);
+select a, sum(b) as b from t1 group by a having b > (select max(a) from t2);
+drop table t1, t2;
diff --git a/mysql-test/t/system_mysql_db_fix.test b/mysql-test/t/system_mysql_db_fix.test
index 6f3979bf66e..a81772c74e4 100644
--- a/mysql-test/t/system_mysql_db_fix.test
+++ b/mysql-test/t/system_mysql_db_fix.test
@@ -74,5 +74,10 @@ DROP TABLE user;
DROP TABLE func;
DROP TABLE tables_priv;
DROP TABLE columns_priv;
+DROP TABLE help_category;
+DROP TABLE help_keyword;
+DROP TABLE help_relation;
+DROP TABLE help_topic;
-- enable_query_log
+
diff --git a/mysql-test/t/system_mysql_db_refs.test b/mysql-test/t/system_mysql_db_refs.test
index 62d6f3de944..4c6557ba5c7 100644
--- a/mysql-test/t/system_mysql_db_refs.test
+++ b/mysql-test/t/system_mysql_db_refs.test
@@ -99,3 +99,4 @@ drop table test_func;
drop table test_host;
drop table test_user;
drop table test_db;
+
diff --git a/mysql-test/t/timezone.test b/mysql-test/t/timezone.test
index 194602f376c..ffc2e3a3ebf 100644
--- a/mysql-test/t/timezone.test
+++ b/mysql-test/t/timezone.test
@@ -1,5 +1,6 @@
#
-# Test of timezone handling. This script must be run with TZ=MET
+# Test of SYSTEM time zone handling ( for my_system_gmt_sec()).
+# This script must be run with TZ=MET
-- require r/have_met_timezone.require
disable_query_log;
@@ -13,7 +14,7 @@ DROP TABLE IF EXISTS t1;
# The following is because of daylight saving time
--replace_result MEST MET
-show variables like "timezone";
+show variables like "system_time_zone";
#
# Test unix timestamp
@@ -40,6 +41,16 @@ INSERT INTO t1 (ts) VALUES (Unix_timestamp('2003-03-30 04:00:01'));
SELECT ts,from_unixtime(ts) FROM t1;
DROP TABLE t1;
+
+#
+# Test of warning for spring time-gap values for system time zone
+#
+CREATE TABLE t1 (ts timestamp);
+INSERT INTO t1 (ts) VALUES ('2003-03-30 01:59:59'),
+ ('2003-03-30 02:59:59'),
+ ('2003-03-30 03:00:00');
+DROP TABLE t1;
+
#
# Test for fix for Bug#2523
#
diff --git a/mysql-test/t/timezone2.test b/mysql-test/t/timezone2.test
new file mode 100644
index 00000000000..49579421570
--- /dev/null
+++ b/mysql-test/t/timezone2.test
@@ -0,0 +1,189 @@
+# This script tests our own time zone support functions
+
+# Preparing playground
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+
+#
+# Let us first check +HH:MM style timezones
+#
+create table t1 (ts timestamp);
+
+set time_zone='+00:00';
+select unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp());
+insert into t1 (ts) values ('2003-03-30 02:30:00');
+
+set time_zone='+10:30';
+select unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp());
+insert into t1 (ts) values ('2003-03-30 02:30:00');
+
+set time_zone='-10:00';
+select unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp());
+insert into t1 (ts) values ('2003-03-30 02:30:00');
+
+# Here we will get different results
+select * from t1;
+
+drop table t1;
+
+
+#
+# Let us try DB specified time zones
+#
+select Name from mysql.time_zone_name where Name in
+ ('UTC','Universal','MET','Europe/Moscow','leap/Europe/Moscow');
+
+create table t1 (i int, ts timestamp);
+
+set time_zone='MET';
+
+# We check common date time value and non existent or ambiguios values
+# Normal value without DST
+insert into t1 (i, ts) values
+ (unix_timestamp('2003-03-01 00:00:00'),'2003-03-01 00:00:00');
+# Values around and in spring time-gap
+insert into t1 (i, ts) values
+ (unix_timestamp('2003-03-30 01:59:59'),'2003-03-30 01:59:59'),
+ (unix_timestamp('2003-03-30 02:30:00'),'2003-03-30 02:30:00'),
+ (unix_timestamp('2003-03-30 03:00:00'),'2003-03-30 03:00:00');
+# Normal value with DST
+insert into t1 (i, ts) values
+ (unix_timestamp('2003-05-01 00:00:00'),'2003-05-01 00:00:00');
+# Ambiguos values (also check for determenism)
+insert into t1 (i, ts) values
+ (unix_timestamp('2003-10-26 01:00:00'),'2003-10-26 01:00:00'),
+ (unix_timestamp('2003-10-26 02:00:00'),'2003-10-26 02:00:00'),
+ (unix_timestamp('2003-10-26 02:59:59'),'2003-10-26 02:59:59'),
+ (unix_timestamp('2003-10-26 04:00:00'),'2003-10-26 04:00:00'),
+ (unix_timestamp('2003-10-26 02:59:59'),'2003-10-26 02:59:59');
+
+set time_zone='UTC';
+
+select * from t1;
+
+delete from t1;
+
+# Simple check for 'Europe/Moscow' time zone just for showing that it works
+set time_zone='Europe/Moscow';
+insert into t1 (i, ts) values
+ (unix_timestamp('2004-01-01 00:00:00'),'2004-01-01 00:00:00'),
+ (unix_timestamp('2004-03-28 02:30:00'),'2004-03-28 02:30:00'),
+ (unix_timestamp('2004-08-01 00:00:00'),'2003-08-01 00:00:00'),
+ (unix_timestamp('2004-10-31 02:30:00'),'2004-10-31 02:30:00');
+select * from t1;
+delete from t1;
+
+
+#
+# Check for time zone with leap seconds
+# Values in ts column must be the same but values in i column should
+# differ from corresponding values for Europe/Moscow a bit.
+#
+set time_zone='leap/Europe/Moscow';
+insert into t1 (i, ts) values
+ (unix_timestamp('2004-01-01 00:00:00'),'2004-01-01 00:00:00'),
+ (unix_timestamp('2004-03-28 02:30:00'),'2004-03-28 02:30:00'),
+ (unix_timestamp('2004-08-01 00:00:00'),'2003-08-01 00:00:00'),
+ (unix_timestamp('2004-10-31 02:30:00'),'2004-10-31 02:30:00');
+select * from t1;
+delete from t1;
+# Let us test leap jump
+insert into t1 (i, ts) values
+ (unix_timestamp('1981-07-01 03:59:59'),'1981-07-01 03:59:59'),
+ (unix_timestamp('1981-07-01 04:00:00'),'1981-07-01 04:00:00');
+select * from t1;
+# Additional 60ieth second!
+select from_unixtime(362793609);
+
+drop table t1;
+
+
+#
+# Let us test range for TIMESTAMP
+#
+create table t1 (ts timestamp);
+set time_zone='UTC';
+insert into t1 values ('0000-00-00 00:00:00'),('1969-12-31 23:59:59'),
+ ('1970-01-01 00:00:00'),('1970-01-01 00:00:01'),
+ ('2037-12-31 23:59:59'),('2038-01-01 00:00:00');
+select * from t1;
+delete from t1;
+# MET time zone has range shifted by one hour
+set time_zone='MET';
+insert into t1 values ('0000-00-00 00:00:00'),('1970-01-01 00:30:00'),
+ ('1970-01-01 01:00:00'),('1970-01-01 01:00:01'),
+ ('2038-01-01 00:59:59'),('2038-01-01 01:00:00');
+select * from t1;
+delete from t1;
+# same for +01:30 time zone
+set time_zone='+01:30';
+insert into t1 values ('0000-00-00 00:00:00'),('1970-01-01 01:00:00'),
+ ('1970-01-01 01:30:00'),('1970-01-01 01:30:01'),
+ ('2038-01-01 01:29:59'),('2038-01-01 01:30:00');
+select * from t1;
+
+drop table t1;
+
+
+#
+# Test of show variables
+#
+show variables like 'time_zone';
+set time_zone = default;
+show variables like 'time_zone';
+
+
+#
+# Let us try some invalid time zone specifications
+#
+--error 1298
+set time_zone= '0';
+--error 1298
+set time_zone= '0:0';
+--error 1298
+set time_zone= '-20:00';
+--error 1298
+set time_zone= '+20:00';
+--error 1298
+set time_zone= 'Some/Unknown/Time/Zone';
+
+
+# Let us check that aliases for time zones work and they are
+# case-insensitive
+select convert_tz(now(),'UTC', 'Universal') = now();
+select convert_tz(now(),'utc', 'UTC') = now();
+
+
+#
+# Let us test CONVERT_TZ function (may be func_time.test is better place).
+#
+select convert_tz('1917-11-07 12:00:00', 'MET', 'UTC');
+select convert_tz('1970-01-01 01:00:00', 'MET', 'UTC');
+select convert_tz('1970-01-01 01:00:01', 'MET', 'UTC');
+select convert_tz('2003-03-01 00:00:00', 'MET', 'UTC');
+select convert_tz('2003-03-30 01:59:59', 'MET', 'UTC');
+select convert_tz('2003-03-30 02:30:00', 'MET', 'UTC');
+select convert_tz('2003-03-30 03:00:00', 'MET', 'UTC');
+select convert_tz('2003-05-01 00:00:00', 'MET', 'UTC');
+select convert_tz('2003-10-26 01:00:00', 'MET', 'UTC');
+select convert_tz('2003-10-26 02:00:00', 'MET', 'UTC');
+select convert_tz('2003-10-26 02:59:59', 'MET', 'UTC');
+select convert_tz('2003-10-26 04:00:00', 'MET', 'UTC');
+select convert_tz('2038-01-01 00:59:59', 'MET', 'UTC');
+select convert_tz('2038-01-01 01:00:00', 'MET', 'UTC');
+select convert_tz('2103-01-01 04:00:00', 'MET', 'UTC');
+
+# Let us test variable time zone argument
+create table t1 (tz varchar(3));
+insert into t1 (tz) values ('MET'), ('UTC');
+select tz, convert_tz('2003-12-31 00:00:00',tz,'UTC'), convert_tz('2003-12-31 00:00:00','UTC',tz) from t1 order by tz;
+drop table t1;
+
+# Parameters to CONVERT_TZ() what should give NULL
+select convert_tz('2003-12-31 04:00:00', NULL, 'UTC');
+select convert_tz('2003-12-31 04:00:00', 'SomeNotExistingTimeZone', 'UTC');
+select convert_tz('2003-12-31 04:00:00', 'MET', 'SomeNotExistingTimeZone');
+select convert_tz('2003-12-31 04:00:00', 'MET', NULL);
+select convert_tz( NULL, 'MET', 'UTC');
diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test
index 5a53c635e6e..8d67802d42a 100644
--- a/mysql-test/t/type_date.test
+++ b/mysql-test/t/type_date.test
@@ -79,3 +79,12 @@ SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.
INSERT INTO t1 VALUES(1);
SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)), DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) FROM t1,t2 GROUP BY t1.AFIELD;
drop table t1,t2;
+
+#
+# Multiple SELECT DATE_FORMAT gave incorrect results (Bug #4036)
+#
+
+CREATE TABLE t1 (f1 time default NULL, f2 time default NULL);
+INSERT INTO t1 (f1, f2) VALUES ('09:00', '12:00');
+SELECT DATE_FORMAT(f1, "%l.%i %p") , DATE_FORMAT(f2, "%l.%i %p") FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test
index cec2aa3582b..47866058524 100644
--- a/mysql-test/t/type_datetime.test
+++ b/mysql-test/t/type_datetime.test
@@ -7,13 +7,13 @@ drop table if exists t1;
--enable_warnings
create table t1 (t datetime);
-insert into t1 values(101),(691231),(700101),(991231),(10000101),(99991231),(101000000),(691231000000),(700101000000),(991231235959),(10000101000000),(99991231235959),(20030102030460),(20030102036301),(20030102240401),(20030132030401),(20031302030460);
+insert into t1 values (101),(691231),(700101),(991231),(10000101),(99991231),(101000000),(691231000000),(700101000000),(991231235959),(10000101000000),(99991231235959),(20030100000000),(20030000000000);
select * from t1;
delete from t1 where t > 0;
optimize table t1;
check table t1;
delete from t1;
-insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030102030460"),("20030102036301"),("20030102240401"),("20030132030401"),("20031302030460");
+insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030100000000"),("20030000000000");
select * from t1;
drop table t1;
@@ -71,3 +71,18 @@ insert into t1 values (now(), now());
insert into t1 values (now(), now());
select * from t1 where a is null or b is null;
drop table t1;
+
+#
+# Let us check if we properly treat wrong datetimes and produce proper
+# warnings (for both strings and numbers)
+#
+create table t1 (t datetime);
+insert into t1 values (20030102030460),(20030102036301),(20030102240401),(20030132030401),(20031302030460);
+select * from t1;
+delete from t1;
+insert into t1 values ("20030102030460"),("20030102036301"),("20030102240401"),("20030132030401"),("20031302030460");
+select * from t1;
+delete from t1;
+insert into t1 values ("0000-00-00 00:00:00 some trailer"),("2003-01-01 00:00:00 some trailer");
+select * from t1;
+drop table t1;
diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test
index 3257002ae2c..414a06deaa9 100644
--- a/mysql-test/t/type_decimal.test
+++ b/mysql-test/t/type_decimal.test
@@ -244,6 +244,9 @@ CREATE TABLE t1 (a_dec DECIMAL(-1,0));
CREATE TABLE t1 (a_dec DECIMAL(-2,1));
--error 1064
CREATE TABLE t1 (a_dec DECIMAL(-1,1));
+CREATE TABLE t1 (a_dec DECIMAL(0,11));
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
#
# Zero prepend overflow bug
diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test
index 72633f9ef7d..9b3abc9f155 100644
--- a/mysql-test/t/type_timestamp.test
+++ b/mysql-test/t/type_timestamp.test
@@ -37,10 +37,10 @@ select date_format(a,"%Y %y"),year(a),year(now()) from t1;
drop table t1;
create table t1 (ix timestamp);
-insert into t1 values (19991101000000),(19990102030405),(19990630232922),(19990601000000),(19990930232922),(19990531232922),(19990501000000),(19991101000000),(19990501000000),(20030101010160),(20030101016001),(20030101240101),(20030132010101),(20031301010101);
+insert into t1 values (19991101000000),(19990102030405),(19990630232922),(19990601000000),(19990930232922),(19990531232922),(19990501000000),(19991101000000),(19990501000000);
select ix+0 from t1;
delete from t1;
-insert into t1 values ("19991101000000"),("19990102030405"),("19990630232922"),("19990601000000"),("20030101010160"),("20030101016001"),("20030101240101"),("20030132010101"),("20031301010101");
+insert into t1 values ("19991101000000"),("19990102030405"),("19990630232922"),("19990601000000");
select ix+0 from t1;
drop table t1;
@@ -76,6 +76,21 @@ select * from t1;
drop table t1;
#
+# Let us check if we properly treat wrong datetimes and produce proper warnings
+# (for both strings and numbers)
+#
+create table t1 (ix timestamp);
+insert into t1 values (0),(20030101010160),(20030101016001),(20030101240101),(20030132010101),(20031301010101),(20031200000000),(20030000000000);
+select ix+0 from t1;
+delete from t1;
+insert into t1 values ("00000000000000"),("20030101010160"),("20030101016001"),("20030101240101"),("20030132010101"),("20031301010101"),("20031200000000"),("20030000000000");
+select ix+0 from t1;
+delete from t1;
+insert into t1 values ("0000-00-00 00:00:00 some trailer"),("2003-01-01 00:00:00 some trailer");
+select ix+0 from t1;
+drop table t1;
+
+#
# Test for TIMESTAMP column with default now() and on update now() clauses
#
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index f6006a87d47..206b40f8ce7 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -527,3 +527,43 @@ CREATE TABLE t2 (i int(11) default NULL,c char(1) default NULL,KEY i (i));
--error 1054
explain (select * from t1) union (select * from t2) order by not_existing_column;
drop table t1, t2;
+
+#
+# length detecting
+#
+CREATE TABLE t1 (uid int(1));
+INSERT INTO t1 SELECT 150;
+SELECT 'a' UNION SELECT uid FROM t1;
+drop table t1;
+
+#
+# parser stack overflow
+#
+CREATE TABLE t1 ( ID1 int(10) unsigned NOT NULL DEFAULT '0' , ID2 datetime NOT NULL DEFAULT '0000-00-00 00:00:00' , DATA1 varchar(10) , DATA2 double(5,4) , DATA3 datetime , PRIMARY KEY (ID1,ID2));
+
+CREATE TABLE t2 ( ID int(3) unsigned NOT NULL DEFAULT '0' , DATA1 timestamp DEFAULT '0000-00-00 00:00:00' , PRIMARY KEY (ID));
+(SELECT * FROM t1 AS PARTITIONED, t2 AS
+PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION
+(SELECT * FROM t1 AS PARTITIONED, t2 AS
+PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION
+(SELECT * FROM t1 AS PARTITIONED, t2 AS
+PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION
+(SELECT * FROM t1 AS PARTITIONED, t2 AS
+PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION
+(SELECT * FROM t1 AS PARTITIONED, t2 AS
+PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION
+(SELECT * FROM t1 AS PARTITIONED, t2 AS
+PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION
+(SELECT * FROM t1 AS PARTITIONED, t2 AS
+PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION
+(SELECT * FROM t1 AS PARTITIONED, t2 AS
+PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION
+(SELECT * FROM t1 AS PARTITIONED, t2 AS
+PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION
+(SELECT * FROM t1 AS PARTITIONED, t2 AS
+PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION
+(SELECT * FROM t1 AS PARTITIONED, t2 AS
+PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION
+(SELECT * FROM t1 AS PARTITIONED, t2 AS
+PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1);
+drop table t1,t2;
diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test
index a28b327cf58..601724e68c8 100644
--- a/mysql-test/t/user_var.test
+++ b/mysql-test/t/user_var.test
@@ -99,3 +99,24 @@ select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST';
select charset(@a),collation(@a),coercibility(@a);
--error 1267
select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' collate latin2_general_ci;
+
+# Check that user variables are binlogged correctly (BUG#3875)
+create table t1 (a varchar(50));
+reset master;
+SET TIMESTAMP=10000;
+SET @`a b`='hello';
+INSERT INTO t1 VALUES(@`a b`);
+set @var1= "';aaa";
+insert into t1 values (@var1);
+create table t2 (c char(30)) charset=ucs2;
+set @v=convert('abc' using ucs2);
+insert into t2 values (@v);
+show binlog events from 79;
+# more important than SHOW BINLOG EVENTS, mysqlbinlog (where we
+# absolutely need variables names to be quoted and strings to be
+# escaped).
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001
+drop table t1, t2;
+
+
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index 81bfacf4ee7..5669d11ddac 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -303,6 +303,7 @@ set global ft_boolean_syntax = @@init_connect;
# variables are set
set global myisam_max_sort_file_size=4294967296;
+--replace_result 4294967296 MAX_FILE_SIZE 2146435072 MAX_FILE_SIZE
show global variables like 'myisam_max_sort_file_size';
set global myisam_max_sort_file_size=default;