summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-07-15 04:28:42 +0300
committerunknown <monty@mysql.com>2004-07-15 04:28:42 +0300
commita96bb92f4a6542409e801c1410d58fa36eb55cad (patch)
treefc4aab8e00b642d92acb665697ea33f18288f4be /mysql-test/r
parentc78da28a4f9489ff8a6268f836512ce1dc4bc44d (diff)
parent46ea874fb78743e1a315fbfa09b012dc382fcbbf (diff)
downloadmariadb-git-a96bb92f4a6542409e801c1410d58fa36eb55cad.tar.gz
Merge
sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_select.cc: Auto merged sql/table.h: Auto merged
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/alter_table.result12
-rw-r--r--mysql-test/r/archive.result1396
-rw-r--r--mysql-test/r/auto_increment.result7
-rw-r--r--mysql-test/r/bdb-deadlock.result2
-rw-r--r--mysql-test/r/bdb.result70
-rw-r--r--mysql-test/r/connect.result19
-rw-r--r--mysql-test/r/create.result12
-rw-r--r--mysql-test/r/ctype_create.result42
-rw-r--r--mysql-test/r/ctype_recoding.result31
-rw-r--r--mysql-test/r/ctype_uca.result1764
-rw-r--r--mysql-test/r/ctype_ucs.result9
-rw-r--r--mysql-test/r/ctype_ujis.result15
-rw-r--r--mysql-test/r/ctype_utf8.result22
-rw-r--r--mysql-test/r/date_formats.result16
-rw-r--r--mysql-test/r/delete.result10
-rw-r--r--mysql-test/r/derived.result10
-rw-r--r--mysql-test/r/flush_table.result66
-rw-r--r--mysql-test/r/fulltext.result21
-rw-r--r--mysql-test/r/func_compress.result2
-rw-r--r--mysql-test/r/func_gconcat.result21
-rw-r--r--mysql-test/r/func_group.result30
-rw-r--r--mysql-test/r/func_if.result6
-rw-r--r--mysql-test/r/func_like.result6
-rw-r--r--mysql-test/r/func_regexp.result17
-rw-r--r--mysql-test/r/func_sapdb.result6
-rw-r--r--mysql-test/r/func_str.result15
-rw-r--r--mysql-test/r/func_time.result10
-rw-r--r--mysql-test/r/gis-rtree.result10
-rw-r--r--mysql-test/r/grant.result3
-rw-r--r--mysql-test/r/grant2.result3
-rw-r--r--mysql-test/r/grant_cache.result13
-rw-r--r--mysql-test/r/handler.result8
-rw-r--r--mysql-test/r/have_archive.require2
-rw-r--r--mysql-test/r/have_debug.require2
-rw-r--r--mysql-test/r/have_geometry.require2
-rw-r--r--mysql-test/r/innodb_cache.result21
-rw-r--r--mysql-test/r/innodb_handler.result4
-rw-r--r--mysql-test/r/insert.result88
-rw-r--r--mysql-test/r/insert_select.result4
-rw-r--r--mysql-test/r/isam.result2
-rw-r--r--mysql-test/r/join.result2
-rw-r--r--mysql-test/r/join_outer.result8
-rw-r--r--mysql-test/r/key.result4
-rw-r--r--mysql-test/r/key_cache.result4
-rw-r--r--mysql-test/r/loaddata.result4
-rw-r--r--mysql-test/r/lowercase_table2.result14
-rw-r--r--mysql-test/r/lowercase_table3.result4
-rw-r--r--mysql-test/r/merge.result18
-rw-r--r--mysql-test/r/multi_update.result5
-rw-r--r--mysql-test/r/mysqlbinlog.result6
-rw-r--r--mysql-test/r/mysqldump.result38
-rw-r--r--mysql-test/r/ndb_alter_table.result29
-rw-r--r--mysql-test/r/ndb_autodiscover.result183
-rw-r--r--mysql-test/r/ndb_autodiscover2.result10
-rw-r--r--mysql-test/r/ndb_basic.result266
-rw-r--r--mysql-test/r/ndb_index.result154
-rw-r--r--mysql-test/r/ndb_index_ordered.result190
-rw-r--r--mysql-test/r/ndb_index_unique.result413
-rw-r--r--mysql-test/r/ndb_insert.result419
-rw-r--r--mysql-test/r/ndb_minmax.result120
-rw-r--r--mysql-test/r/ndb_replace.result21
-rw-r--r--mysql-test/r/null.result18
-rw-r--r--mysql-test/r/null_key.result2
-rw-r--r--mysql-test/r/openssl_1.result8
-rw-r--r--mysql-test/r/packet.result2
-rw-r--r--mysql-test/r/ps.result221
-rw-r--r--mysql-test/r/ps_1general.result745
-rw-r--r--mysql-test/r/ps_2myisam.result1269
-rw-r--r--mysql-test/r/ps_3innodb.result1269
-rw-r--r--mysql-test/r/ps_4heap.result1270
-rw-r--r--mysql-test/r/ps_5merge.result2410
-rw-r--r--mysql-test/r/ps_6bdb.result1269
-rw-r--r--mysql-test/r/query_cache.result8
-rw-r--r--mysql-test/r/range.result23
-rw-r--r--mysql-test/r/rpl000001.result8
-rw-r--r--mysql-test/r/rpl_charset.result201
-rw-r--r--mysql-test/r/rpl_delete_all.result31
-rw-r--r--mysql-test/r/rpl_do_grant.result16
-rw-r--r--mysql-test/r/rpl_flush_log_loop.result2
-rw-r--r--mysql-test/r/rpl_free_items.result10
-rw-r--r--mysql-test/r/rpl_get_lock.result6
-rw-r--r--mysql-test/r/rpl_ignore_grant.result24
-rw-r--r--mysql-test/r/rpl_ps.result28
-rw-r--r--mysql-test/r/rpl_replicate_do.result2
-rw-r--r--mysql-test/r/rpl_rotate_logs.result6
-rw-r--r--mysql-test/r/rpl_server_id1.result5
-rw-r--r--mysql-test/r/rpl_temporary.result27
-rw-r--r--mysql-test/r/rpl_timezone.result75
-rw-r--r--mysql-test/r/rpl_until.result10
-rw-r--r--mysql-test/r/rpl_user_variables.result34
-rw-r--r--mysql-test/r/select.result7
-rw-r--r--mysql-test/r/select_found.result17
-rw-r--r--mysql-test/r/select_safe.result6
-rw-r--r--mysql-test/r/show_check.result82
-rw-r--r--mysql-test/r/sp-error.result10
-rw-r--r--mysql-test/r/sp-security.result16
-rw-r--r--mysql-test/r/sp.result2
-rw-r--r--mysql-test/r/subselect.result118
-rw-r--r--mysql-test/r/subselect_innodb.result10
-rw-r--r--mysql-test/r/system_mysql_db.result5
-rw-r--r--mysql-test/r/system_mysql_db_refs.result56
-rw-r--r--mysql-test/r/timezone.result11
-rw-r--r--mysql-test/r/timezone2.result246
-rw-r--r--mysql-test/r/type_blob.result2
-rw-r--r--mysql-test/r/type_date.result6
-rw-r--r--mysql-test/r/type_datetime.result70
-rw-r--r--mysql-test/r/type_decimal.result107
-rw-r--r--mysql-test/r/type_float.result4
-rw-r--r--mysql-test/r/type_ranges.result38
-rw-r--r--mysql-test/r/type_time.result10
-rw-r--r--mysql-test/r/type_timestamp.result80
-rw-r--r--mysql-test/r/type_uint.result2
-rw-r--r--mysql-test/r/union.result57
-rw-r--r--mysql-test/r/user_var.result35
-rw-r--r--mysql-test/r/varbinary.result2
-rw-r--r--mysql-test/r/variables.result16
-rw-r--r--mysql-test/r/warnings.result24
117 files changed, 15244 insertions, 505 deletions
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index a7c1dbde697..5d50a3da666 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -121,9 +121,9 @@ create database mysqltest;
create table mysqltest.t1 (a int,b int,c int);
grant all on mysqltest.t1 to mysqltest_1@localhost;
alter table t1 rename t2;
-ERROR 42000: insert command denied to user: 'mysqltest_1'@'localhost' for table 't2'
+ERROR 42000: insert command denied to user 'mysqltest_1'@'localhost' for table 't2'
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
-delete from mysql.user where user='mysqltest_1';
+delete from mysql.user where user=_binary'mysqltest_1';
drop database mysqltest;
create table t1 (n1 int not null, n2 int, n3 int, n4 float,
unique(n1),
@@ -468,5 +468,11 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `b` (`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE t1 DROP PRIMARY KEY;
-ERROR 42000: Can't DROP 'PRIMARY'. Check that column/key exists
+ERROR 42000: Can't DROP 'PRIMARY'; check that column/key exists
DROP TABLE t1;
+create table t1 (a int, b int, key(a));
+insert into t1 values (1,1), (2,2);
+alter table t1 drop key no_such_key;
+ERROR 42000: Can't DROP 'no_such_key'; check that column/key exists
+alter table t1 drop key a;
+drop table t1;
diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result
new file mode 100644
index 00000000000..b380ea910de
--- /dev/null
+++ b/mysql-test/r/archive.result
@@ -0,0 +1,1396 @@
+drop table if exists t1,t2;
+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;
+period
+9410
+select * from t1;
+Period Varor_period
+9410 9412
+select t1.* from t1;
+Period Varor_period
+9410 9412
+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;
+select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%";
+fld3
+imaginable
+select fld3 from t2 where fld3 like "%cultivation" ;
+fld3
+cultivation
+select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3;
+fld3 companynr
+concoct 58
+druggists 58
+engrossing 58
+Eurydice 58
+exclaimers 58
+ferociousness 58
+hopelessness 58
+Huey 58
+imaginable 58
+judges 58
+merging 58
+ostrich 58
+peering 58
+Phelps 58
+presumes 58
+Ruth 58
+sentences 58
+Shylock 58
+straggled 58
+synergy 58
+thanking 58
+tying 58
+unlocks 58
+select fld3,companynr from t2 where companynr = 58 order by fld3;
+fld3 companynr
+concoct 58
+druggists 58
+engrossing 58
+Eurydice 58
+exclaimers 58
+ferociousness 58
+hopelessness 58
+Huey 58
+imaginable 58
+judges 58
+merging 58
+ostrich 58
+peering 58
+Phelps 58
+presumes 58
+Ruth 58
+sentences 58
+Shylock 58
+straggled 58
+synergy 58
+thanking 58
+tying 58
+unlocks 58
+select fld3 from t2 order by fld3 desc limit 10;
+fld3
+youthfulness
+yelped
+Wotan
+workers
+Witt
+witchcraft
+Winsett
+Willy
+willed
+wildcats
+select fld3 from t2 order by fld3 desc limit 5;
+fld3
+youthfulness
+yelped
+Wotan
+workers
+Witt
+select fld3 from t2 order by fld3 desc limit 5,5;
+fld3
+witchcraft
+Winsett
+Willy
+willed
+wildcats
+select t2.fld3 from t2 where fld3 = 'honeysuckle';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'h%le';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_';
+fld3
+select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%';
+fld3
+select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
+fld3
+honeysuckle
+honoring
+select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3;
+fld1 fld3
+148504 Colombo
+068305 Colombo
+000000 nondecreasing
+select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%';
+fld1 fld3
+012001 flanking
+013602 foldout
+013606 fingerings
+018007 fanatic
+018017 featherweight
+018054 fetters
+018103 flint
+018104 flopping
+036002 funereal
+038017 fetched
+038205 firearm
+058004 Fenton
+088303 feminine
+186002 freakish
+188007 flurried
+188505 fitting
+198006 furthermore
+202301 Fitzpatrick
+208101 fiftieth
+208113 freest
+218008 finishers
+218022 feed
+218401 faithful
+226205 foothill
+226209 furnishings
+228306 forthcoming
+228311 fated
+231315 freezes
+232102 forgivably
+238007 filial
+238008 fixedly
+select fld3 from t2 where fld3 like "L%" and fld3 = "ok";
+fld3
+select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly");
+fld3
+Chantilly
+select fld1,fld3 from t2 where fld1 like "25050%";
+fld1 fld3
+250501 poisoning
+250502 Iraqis
+250503 heaving
+250504 population
+250505 bomb
+select fld1,fld3 from t2 where fld1 like "25050_";
+fld1 fld3
+250501 poisoning
+250502 Iraqis
+250503 heaving
+250504 population
+250505 bomb
+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;
+auto fld1 companynr fld3 fld4 fld5 fld6
+1 000001 00 Omaha teethe neat
+2 011401 37 breaking dreaded Steinberg W
+3 011402 37 Romans scholastics jarring
+4 011403 37 intercepted audiology tinily
+5 011501 37 bewilderingly wallet balled
+6 011701 37 astound parters persist W
+7 011702 37 admonishing eschew attainments
+8 011703 37 sumac quitter fanatic
+9 012001 37 flanking neat measures FAS
+10 012003 37 combed Steinberg rightfulness
+11 012004 37 subjective jarring capably
+12 012005 37 scatterbrain tinily impulsive
+13 012301 37 Eulerian balled starlet
+14 012302 36 dubbed persist terminators
+15 012303 37 Kane attainments untying
+16 012304 37 overlay fanatic announces FAS
+17 012305 37 perturb measures featherweight FAS
+18 012306 37 goblins rightfulness pessimist FAS
+19 012501 37 annihilates capably daughter
+20 012602 37 Wotan impulsive decliner FAS
+21 012603 37 snatching starlet lawgiver
+22 012604 37 concludes terminators stated
+23 012605 37 laterally untying readable
+24 012606 37 yelped announces attrition
+25 012701 37 grazing featherweight cascade FAS
+26 012702 37 Baird pessimist motors FAS
+27 012703 37 celery daughter interrogate
+28 012704 37 misunderstander decliner pests W
+29 013601 37 handgun lawgiver stairway
+30 013602 37 foldout stated dopers FAS
+31 013603 37 mystic readable testicle W
+32 013604 37 succumbed attrition Parsifal W
+33 013605 37 Nabisco cascade leavings
+34 013606 37 fingerings motors postulation W
+35 013607 37 aging interrogate squeaking
+36 013608 37 afield pests contrasted
+37 013609 37 ammonium stairway leftover
+38 013610 37 boat dopers whiteners
+39 013801 37 intelligibility testicle erases W
+40 013802 37 Augustine Parsifal Punjab W
+41 013803 37 teethe leavings Merritt
+42 013804 37 dreaded postulation Quixotism
+43 013901 37 scholastics squeaking sweetish FAS
+44 016001 37 audiology contrasted dogging FAS
+45 016201 37 wallet leftover scornfully FAS
+46 016202 37 parters whiteners bellow
+47 016301 37 eschew erases bills
+48 016302 37 quitter Punjab cupboard FAS
+49 016303 37 neat Merritt sureties FAS
+50 016304 37 Steinberg Quixotism puddings
+51 018001 37 jarring sweetish tapestry
+52 018002 37 tinily dogging fetters
+53 018003 37 balled scornfully bivalves
+54 018004 37 persist bellow incurring
+55 018005 37 attainments bills Adolph
+56 018007 37 fanatic cupboard pithed
+57 018008 37 measures sureties emergency
+58 018009 37 rightfulness puddings Miles
+59 018010 37 capably tapestry trimmings
+60 018012 37 impulsive fetters tragedies W
+61 018013 37 starlet bivalves skulking W
+62 018014 37 terminators incurring flint
+63 018015 37 untying Adolph flopping W
+64 018016 37 announces pithed relaxing FAS
+65 018017 37 featherweight emergency offload FAS
+66 018018 37 pessimist Miles suites W
+67 018019 37 daughter trimmings lists FAS
+68 018020 37 decliner tragedies animized FAS
+69 018021 37 lawgiver skulking multilayer W
+70 018022 37 stated flint standardizes FAS
+71 018023 37 readable flopping Judas
+72 018024 37 attrition relaxing vacuuming W
+73 018025 37 cascade offload dentally W
+74 018026 37 motors suites humanness W
+75 018027 37 interrogate lists inch W
+76 018028 37 pests animized Weissmuller W
+77 018029 37 stairway multilayer irresponsibly W
+78 018030 37 dopers standardizes luckily FAS
+79 018032 37 testicle Judas culled W
+80 018033 37 Parsifal vacuuming medical FAS
+81 018034 37 leavings dentally bloodbath FAS
+82 018035 37 postulation humanness subschema W
+83 018036 37 squeaking inch animals W
+84 018037 37 contrasted Weissmuller Micronesia
+85 018038 37 leftover irresponsibly repetitions
+86 018039 37 whiteners luckily Antares
+87 018040 37 erases culled ventilate W
+88 018041 37 Punjab medical pityingly
+89 018042 37 Merritt bloodbath interdependent
+90 018043 37 Quixotism subschema Graves FAS
+91 018044 37 sweetish animals neonatal
+92 018045 37 dogging Micronesia scribbled FAS
+93 018046 37 scornfully repetitions chafe W
+94 018048 37 bellow Antares honoring
+95 018049 37 bills ventilate realtor
+96 018050 37 cupboard pityingly elite
+97 018051 37 sureties interdependent funereal
+98 018052 37 puddings Graves abrogating
+99 018053 50 tapestry neonatal sorters
+100 018054 37 fetters scribbled Conley
+101 018055 37 bivalves chafe lectured
+102 018056 37 incurring honoring Abraham
+103 018057 37 Adolph realtor Hawaii W
+104 018058 37 pithed elite cage
+105 018059 36 emergency funereal hushes
+106 018060 37 Miles abrogating Simla
+107 018061 37 trimmings sorters reporters
+108 018101 37 tragedies Conley Dutchman FAS
+109 018102 37 skulking lectured descendants FAS
+110 018103 37 flint Abraham groupings FAS
+111 018104 37 flopping Hawaii dissociate
+112 018201 37 relaxing cage coexist W
+113 018202 37 offload hushes Beebe
+114 018402 37 suites Simla Taoism
+115 018403 37 lists reporters Connally
+116 018404 37 animized Dutchman fetched FAS
+117 018405 37 multilayer descendants checkpoints FAS
+118 018406 37 standardizes groupings rusting
+119 018409 37 Judas dissociate galling
+120 018601 37 vacuuming coexist obliterates
+121 018602 37 dentally Beebe traitor
+122 018603 37 humanness Taoism resumes FAS
+123 018801 37 inch Connally analyzable FAS
+124 018802 37 Weissmuller fetched terminator FAS
+125 018803 37 irresponsibly checkpoints gritty FAS
+126 018804 37 luckily rusting firearm W
+127 018805 37 culled galling minima
+128 018806 37 medical obliterates Selfridge
+129 018807 37 bloodbath traitor disable
+130 018808 37 subschema resumes witchcraft W
+131 018809 37 animals analyzable betroth W
+132 018810 37 Micronesia terminator Manhattanize
+133 018811 37 repetitions gritty imprint
+134 018812 37 Antares firearm peeked
+135 019101 37 ventilate minima swelling
+136 019102 37 pityingly Selfridge interrelationships W
+137 019103 37 interdependent disable riser
+138 019201 37 Graves witchcraft Gandhian W
+139 030501 37 neonatal betroth peacock A
+140 030502 50 scribbled Manhattanize bee A
+141 030503 37 chafe imprint kanji
+142 030504 37 honoring peeked dental
+143 031901 37 realtor swelling scarf FAS
+144 036001 37 elite interrelationships chasm A
+145 036002 37 funereal riser insolence A
+146 036004 37 abrogating Gandhian syndicate
+147 036005 37 sorters peacock alike
+148 038001 37 Conley bee imperial A
+149 038002 37 lectured kanji convulsion A
+150 038003 37 Abraham dental railway A
+151 038004 37 Hawaii scarf validate A
+152 038005 37 cage chasm normalizes A
+153 038006 37 hushes insolence comprehensive
+154 038007 37 Simla syndicate chewing
+155 038008 37 reporters alike denizen
+156 038009 37 Dutchman imperial schemer
+157 038010 37 descendants convulsion chronicle
+158 038011 37 groupings railway Kline
+159 038012 37 dissociate validate Anatole
+160 038013 37 coexist normalizes partridges
+161 038014 37 Beebe comprehensive brunch
+162 038015 37 Taoism chewing recruited
+163 038016 37 Connally denizen dimensions W
+164 038017 37 fetched schemer Chicana W
+165 038018 37 checkpoints chronicle announced
+166 038101 37 rusting Kline praised FAS
+167 038102 37 galling Anatole employing
+168 038103 37 obliterates partridges linear
+169 038104 37 traitor brunch quagmire
+170 038201 37 resumes recruited western A
+171 038202 37 analyzable dimensions relishing
+172 038203 37 terminator Chicana serving A
+173 038204 37 gritty announced scheduling
+174 038205 37 firearm praised lore
+175 038206 37 minima employing eventful
+176 038208 37 Selfridge linear arteriole A
+177 042801 37 disable quagmire disentangle
+178 042802 37 witchcraft western cured A
+179 046101 37 betroth relishing Fenton W
+180 048001 37 Manhattanize serving avoidable A
+181 048002 37 imprint scheduling drains A
+182 048003 37 peeked lore detectably FAS
+183 048004 37 swelling eventful husky
+184 048005 37 interrelationships arteriole impelling
+185 048006 37 riser disentangle undoes
+186 048007 37 Gandhian cured evened
+187 048008 37 peacock Fenton squeezes
+188 048101 37 bee avoidable destroyer FAS
+189 048102 37 kanji drains rudeness
+190 048201 37 dental detectably beaner FAS
+191 048202 37 scarf husky boorish
+192 048203 37 chasm impelling Everhart
+193 048204 37 insolence undoes encompass A
+194 048205 37 syndicate evened mushrooms
+195 048301 37 alike squeezes Alison A
+196 048302 37 imperial destroyer externally FAS
+197 048303 37 convulsion rudeness pellagra
+198 048304 37 railway beaner cult
+199 048305 37 validate boorish creek A
+200 048401 37 normalizes Everhart Huffman
+201 048402 37 comprehensive encompass Majorca FAS
+202 048403 37 chewing mushrooms governing A
+203 048404 37 denizen Alison gadfly FAS
+204 048405 37 schemer externally reassigned FAS
+205 048406 37 chronicle pellagra intentness W
+206 048407 37 Kline cult craziness
+207 048408 37 Anatole creek psychic
+208 048409 37 partridges Huffman squabbled
+209 048410 37 brunch Majorca burlesque
+210 048411 37 recruited governing capped
+211 048412 37 dimensions gadfly extracted A
+212 048413 37 Chicana reassigned DiMaggio
+213 048601 37 announced intentness exclamation FAS
+214 048602 37 praised craziness subdirectory
+215 048603 37 employing psychic fangs
+216 048604 37 linear squabbled buyer A
+217 048801 37 quagmire burlesque pithing A
+218 050901 37 western capped transistorizing A
+219 051201 37 relishing extracted nonbiodegradable
+220 056002 37 serving DiMaggio dislocate
+221 056003 37 scheduling exclamation monochromatic FAS
+222 056004 37 lore subdirectory batting
+223 056102 37 eventful fangs postcondition A
+224 056203 37 arteriole buyer catalog FAS
+225 056204 37 disentangle pithing Remus
+226 058003 37 cured transistorizing devices A
+227 058004 37 Fenton nonbiodegradable bike A
+228 058005 37 avoidable dislocate qualify
+229 058006 37 drains monochromatic detained
+230 058007 37 detectably batting commended
+231 058101 37 husky postcondition civilize
+232 058102 37 impelling catalog Elmhurst
+233 058103 37 undoes Remus anesthetizing
+234 058105 37 evened devices deaf
+235 058111 37 squeezes bike Brigham
+236 058112 37 destroyer qualify title
+237 058113 37 rudeness detained coarse
+238 058114 37 beaner commended combinations
+239 058115 37 boorish civilize grayness
+240 058116 37 Everhart Elmhurst innumerable FAS
+241 058117 37 encompass anesthetizing Caroline A
+242 058118 37 mushrooms deaf fatty FAS
+243 058119 37 Alison Brigham eastbound
+244 058120 37 externally title inexperienced
+245 058121 37 pellagra coarse hoarder A
+246 058122 37 cult combinations scotch W
+247 058123 37 creek grayness passport A
+248 058124 37 Huffman innumerable strategic FAS
+249 058125 37 Majorca Caroline gated
+250 058126 37 governing fatty flog
+251 058127 37 gadfly eastbound Pipestone
+252 058128 37 reassigned inexperienced Dar
+253 058201 37 intentness hoarder Corcoran
+254 058202 37 craziness scotch flyers A
+255 058303 37 psychic passport competitions W
+256 058304 37 squabbled strategic suppliers FAS
+257 058602 37 burlesque gated skips
+258 058603 37 capped flog institutes
+259 058604 37 extracted Pipestone troop A
+260 058605 37 DiMaggio Dar connective W
+261 058606 37 exclamation Corcoran denies
+262 058607 37 subdirectory flyers polka
+263 060401 36 fangs competitions observations FAS
+264 061701 36 buyer suppliers askers
+265 066201 36 pithing skips homeless FAS
+266 066501 36 transistorizing institutes Anna
+267 068001 36 nonbiodegradable troop subdirectories W
+268 068002 36 dislocate connective decaying FAS
+269 068005 36 monochromatic denies outwitting W
+270 068006 36 batting polka Harpy W
+271 068007 36 postcondition observations crazed
+272 068008 36 catalog askers suffocate
+273 068009 36 Remus homeless provers FAS
+274 068010 36 devices Anna technically
+275 068011 36 bike subdirectories Franklinizations
+276 068202 36 qualify decaying considered
+277 068302 36 detained outwitting tinnily
+278 068303 36 commended Harpy uninterruptedly
+279 068401 36 civilize crazed whistled A
+280 068501 36 Elmhurst suffocate automate
+281 068502 36 anesthetizing provers gutting W
+282 068503 36 deaf technically surreptitious
+283 068602 36 Brigham Franklinizations Choctaw
+284 068603 36 title considered cooks
+285 068701 36 coarse tinnily millivolt FAS
+286 068702 36 combinations uninterruptedly counterpoise
+287 068703 36 grayness whistled Gothicism
+288 076001 36 innumerable automate feminine
+289 076002 36 Caroline gutting metaphysically W
+290 076101 36 fatty surreptitious sanding A
+291 076102 36 eastbound Choctaw contributorily
+292 076103 36 inexperienced cooks receivers FAS
+293 076302 36 hoarder millivolt adjourn
+294 076303 36 scotch counterpoise straggled A
+295 076304 36 passport Gothicism druggists
+296 076305 36 strategic feminine thanking FAS
+297 076306 36 gated metaphysically ostrich
+298 076307 36 flog sanding hopelessness FAS
+299 076402 36 Pipestone contributorily Eurydice
+300 076501 36 Dar receivers excitation W
+301 076502 36 Corcoran adjourn presumes FAS
+302 076701 36 flyers straggled imaginable FAS
+303 078001 36 competitions druggists concoct W
+304 078002 36 suppliers thanking peering W
+305 078003 36 skips ostrich Phelps FAS
+306 078004 36 institutes hopelessness ferociousness FAS
+307 078005 36 troop Eurydice sentences
+308 078006 36 connective excitation unlocks
+309 078007 36 denies presumes engrossing W
+310 078008 36 polka imaginable Ruth
+311 078101 36 observations concoct tying
+312 078103 36 askers peering exclaimers
+313 078104 36 homeless Phelps synergy
+314 078105 36 Anna ferociousness Huey W
+315 082101 36 subdirectories sentences merging
+316 083401 36 decaying unlocks judges A
+317 084001 36 outwitting engrossing Shylock W
+318 084002 36 Harpy Ruth Miltonism
+319 086001 36 crazed tying hen W
+320 086102 36 suffocate exclaimers honeybee FAS
+321 086201 36 provers synergy towers
+322 088001 36 technically Huey dilutes W
+323 088002 36 Franklinizations merging numerals FAS
+324 088003 36 considered judges democracy FAS
+325 088004 36 tinnily Shylock Ibero-
+326 088101 36 uninterruptedly Miltonism invalids
+327 088102 36 whistled hen behavior
+328 088103 36 automate honeybee accruing
+329 088104 36 gutting towers relics A
+330 088105 36 surreptitious dilutes rackets
+331 088106 36 Choctaw numerals Fischbein W
+332 088201 36 cooks democracy phony W
+333 088203 36 millivolt Ibero- cross FAS
+334 088204 36 counterpoise invalids cleanup
+335 088302 37 Gothicism behavior conspirator
+336 088303 37 feminine accruing label FAS
+337 088305 37 metaphysically relics university
+338 088402 37 sanding rackets cleansed FAS
+339 088501 36 contributorily Fischbein ballgown
+340 088502 36 receivers phony starlet
+341 088503 36 adjourn cross aqueous
+342 098001 58 straggled cleanup portrayal A
+343 098002 58 druggists conspirator despising W
+344 098003 58 thanking label distort W
+345 098004 58 ostrich university palmed
+346 098005 58 hopelessness cleansed faced
+347 098006 58 Eurydice ballgown silverware
+348 141903 29 excitation starlet assessor
+349 098008 58 presumes aqueous spiders
+350 098009 58 imaginable portrayal artificially
+351 098010 58 concoct despising reminiscence
+352 098011 58 peering distort Mexican
+353 098012 58 Phelps palmed obnoxious
+354 098013 58 ferociousness faced fragile
+355 098014 58 sentences silverware apprehensible
+356 098015 58 unlocks assessor births
+357 098016 58 engrossing spiders garages
+358 098017 58 Ruth artificially panty
+359 098018 58 tying reminiscence anteater
+360 098019 58 exclaimers Mexican displacement A
+361 098020 58 synergy obnoxious drovers A
+362 098021 58 Huey fragile patenting A
+363 098022 58 merging apprehensible far A
+364 098023 58 judges births shrieks
+365 098024 58 Shylock garages aligning W
+366 098025 37 Miltonism panty pragmatism
+367 106001 36 hen anteater fevers W
+368 108001 36 honeybee displacement reexamines A
+369 108002 36 towers drovers occupancies
+370 108003 36 dilutes patenting sweats FAS
+371 108004 36 numerals far modulators
+372 108005 36 democracy shrieks demand W
+373 108007 36 Ibero- aligning Madeira
+374 108008 36 invalids pragmatism Viennese W
+375 108009 36 behavior fevers chillier W
+376 108010 36 accruing reexamines wildcats FAS
+377 108011 36 relics occupancies gentle
+378 108012 36 rackets sweats Angles W
+379 108101 36 Fischbein modulators accuracies
+380 108102 36 phony demand toggle
+381 108103 36 cross Madeira Mendelssohn W
+382 108111 50 cleanup Viennese behaviorally
+383 108105 36 conspirator chillier Rochford
+384 108106 36 label wildcats mirror W
+385 108107 36 university gentle Modula
+386 108108 50 cleansed Angles clobbering
+387 108109 36 ballgown accuracies chronography
+388 108110 36 starlet toggle Eskimoizeds
+389 108201 36 aqueous Mendelssohn British W
+390 108202 36 portrayal behaviorally pitfalls
+391 108203 36 despising Rochford verify W
+392 108204 36 distort mirror scatter FAS
+393 108205 36 palmed Modula Aztecan
+394 108301 36 faced clobbering acuity W
+395 108302 36 silverware chronography sinking W
+396 112101 36 assessor Eskimoizeds beasts FAS
+397 112102 36 spiders British Witt W
+398 113701 36 artificially pitfalls physicists FAS
+399 116001 36 reminiscence verify folksong A
+400 116201 36 Mexican scatter strokes FAS
+401 116301 36 obnoxious Aztecan crowder
+402 116302 36 fragile acuity merry
+403 116601 36 apprehensible sinking cadenced
+404 116602 36 births beasts alimony A
+405 116603 36 garages Witt principled A
+406 116701 36 panty physicists golfing
+407 116702 36 anteater folksong undiscovered
+408 118001 36 displacement strokes irritates
+409 118002 36 drovers crowder patriots A
+410 118003 36 patenting merry rooms FAS
+411 118004 36 far cadenced towering W
+412 118005 36 shrieks alimony displease
+413 118006 36 aligning principled photosensitive
+414 118007 36 pragmatism golfing inking
+415 118008 36 fevers undiscovered gainers
+416 118101 36 reexamines irritates leaning A
+417 118102 36 occupancies patriots hydrant A
+418 118103 36 sweats rooms preserve
+419 118202 36 modulators towering blinded A
+420 118203 36 demand displease interactions A
+421 118204 36 Madeira photosensitive Barry
+422 118302 36 Viennese inking whiteness A
+423 118304 36 chillier gainers pastimes W
+424 118305 36 wildcats leaning Edenization
+425 118306 36 gentle hydrant Muscat
+426 118307 36 Angles preserve assassinated
+427 123101 36 accuracies blinded labeled
+428 123102 36 toggle interactions glacial A
+429 123301 36 Mendelssohn Barry implied W
+430 126001 36 behaviorally whiteness bibliographies W
+431 126002 36 Rochford pastimes Buchanan
+432 126003 36 mirror Edenization forgivably FAS
+433 126101 36 Modula Muscat innuendo A
+434 126301 36 clobbering assassinated den FAS
+435 126302 36 chronography labeled submarines W
+436 126402 36 Eskimoizeds glacial mouthful A
+437 126601 36 British implied expiring
+438 126602 36 pitfalls bibliographies unfulfilled FAS
+439 126702 36 verify Buchanan precession
+440 128001 36 scatter forgivably nullified
+441 128002 36 Aztecan innuendo affects
+442 128003 36 acuity den Cynthia
+443 128004 36 sinking submarines Chablis A
+444 128005 36 beasts mouthful betterments FAS
+445 128007 36 Witt expiring advertising
+446 128008 36 physicists unfulfilled rubies A
+447 128009 36 folksong precession southwest FAS
+448 128010 36 strokes nullified superstitious A
+449 128011 36 crowder affects tabernacle W
+450 128012 36 merry Cynthia silk A
+451 128013 36 cadenced Chablis handsomest A
+452 128014 36 alimony betterments Persian A
+453 128015 36 principled advertising analog W
+454 128016 36 golfing rubies complex W
+455 128017 36 undiscovered southwest Taoist
+456 128018 36 irritates superstitious suspend
+457 128019 36 patriots tabernacle relegated
+458 128020 36 rooms silk awesome W
+459 128021 36 towering handsomest Bruxelles
+460 128022 36 displease Persian imprecisely A
+461 128023 36 photosensitive analog televise
+462 128101 36 inking complex braking
+463 128102 36 gainers Taoist true FAS
+464 128103 36 leaning suspend disappointing FAS
+465 128104 36 hydrant relegated navally W
+466 128106 36 preserve awesome circus
+467 128107 36 blinded Bruxelles beetles
+468 128108 36 interactions imprecisely trumps
+469 128202 36 Barry televise fourscore W
+470 128203 36 whiteness braking Blackfoots
+471 128301 36 pastimes true Grady
+472 128302 36 Edenization disappointing quiets FAS
+473 128303 36 Muscat navally floundered FAS
+474 128304 36 assassinated circus profundity W
+475 128305 36 labeled beetles Garrisonian W
+476 128307 36 glacial trumps Strauss
+477 128401 36 implied fourscore cemented FAS
+478 128502 36 bibliographies Blackfoots contrition A
+479 128503 36 Buchanan Grady mutations
+480 128504 36 forgivably quiets exhibits W
+481 128505 36 innuendo floundered tits
+482 128601 36 den profundity mate A
+483 128603 36 submarines Garrisonian arches
+484 128604 36 mouthful Strauss Moll
+485 128702 36 expiring cemented ropers
+486 128703 36 unfulfilled contrition bombast
+487 128704 36 precession mutations difficultly A
+488 138001 36 nullified exhibits adsorption
+489 138002 36 affects tits definiteness FAS
+490 138003 36 Cynthia mate cultivation A
+491 138004 36 Chablis arches heals A
+492 138005 36 betterments Moll Heusen W
+493 138006 36 advertising ropers target FAS
+494 138007 36 rubies bombast cited A
+495 138008 36 southwest difficultly congresswoman W
+496 138009 36 superstitious adsorption Katherine
+497 138102 36 tabernacle definiteness titter A
+498 138103 36 silk cultivation aspire A
+499 138104 36 handsomest heals Mardis
+500 138105 36 Persian Heusen Nadia W
+501 138201 36 analog target estimating FAS
+502 138302 36 complex cited stuck A
+503 138303 36 Taoist congresswoman fifteenth A
+504 138304 36 suspend Katherine Colombo
+505 138401 29 relegated titter survey A
+506 140102 29 awesome aspire staffing
+507 140103 29 Bruxelles Mardis obtain
+508 140104 29 imprecisely Nadia loaded
+509 140105 29 televise estimating slaughtered
+510 140201 29 braking stuck lights A
+511 140701 29 true fifteenth circumference
+512 141501 29 disappointing Colombo dull A
+513 141502 29 navally survey weekly A
+514 141901 29 circus staffing wetness
+515 141902 29 beetles obtain visualized
+516 142101 29 trumps loaded Tannenbaum
+517 142102 29 fourscore slaughtered moribund
+518 142103 29 Blackfoots lights demultiplex
+519 142701 29 Grady circumference lockings
+520 143001 29 quiets dull thugs FAS
+521 143501 29 floundered weekly unnerves
+522 143502 29 profundity wetness abut
+523 148001 29 Garrisonian visualized Chippewa A
+524 148002 29 Strauss Tannenbaum stratifications A
+525 148003 29 cemented moribund signaled
+526 148004 29 contrition demultiplex Italianizes A
+527 148005 29 mutations lockings algorithmic A
+528 148006 29 exhibits thugs paranoid FAS
+529 148007 29 tits unnerves camping A
+530 148009 29 mate abut signifying A
+531 148010 29 arches Chippewa Patrice W
+532 148011 29 Moll stratifications search A
+533 148012 29 ropers signaled Angeles A
+534 148013 29 bombast Italianizes semblance
+535 148023 36 difficultly algorithmic taxed
+536 148015 29 adsorption paranoid Beatrice
+537 148016 29 definiteness camping retrace
+538 148017 29 cultivation signifying lockout
+539 148018 29 heals Patrice grammatic
+540 148019 29 Heusen search helmsman
+541 148020 29 target Angeles uniform W
+542 148021 29 cited semblance hamming
+543 148022 29 congresswoman taxed disobedience
+544 148101 29 Katherine Beatrice captivated A
+545 148102 29 titter retrace transferals A
+546 148201 29 aspire lockout cartographer A
+547 148401 29 Mardis grammatic aims FAS
+548 148402 29 Nadia helmsman Pakistani
+549 148501 29 estimating uniform burglarized FAS
+550 148502 29 stuck hamming saucepans A
+551 148503 29 fifteenth disobedience lacerating A
+552 148504 29 Colombo captivated corny
+553 148601 29 survey transferals megabytes FAS
+554 148602 29 staffing cartographer chancellor
+555 150701 29 obtain aims bulk A
+556 152101 29 loaded Pakistani commits A
+557 152102 29 slaughtered burglarized meson W
+558 155202 36 lights saucepans deputies
+559 155203 29 circumference lacerating northeaster A
+560 155204 29 dull corny dipole
+561 155205 29 weekly megabytes machining 0
+562 156001 29 wetness chancellor therefore
+563 156002 29 visualized bulk Telefunken
+564 156102 29 Tannenbaum commits salvaging
+565 156301 29 moribund meson Corinthianizes A
+566 156302 29 demultiplex deputies restlessly A
+567 156303 29 lockings northeaster bromides
+568 156304 29 thugs dipole generalized A
+569 156305 29 unnerves machining mishaps
+570 156306 29 abut therefore quelling
+571 156501 29 Chippewa Telefunken spiritual A
+572 158001 29 stratifications salvaging beguiles FAS
+573 158002 29 signaled Corinthianizes Trobriand FAS
+574 158101 29 Italianizes restlessly fleeing A
+575 158102 29 algorithmic bromides Armour A
+576 158103 29 paranoid generalized chin A
+577 158201 29 camping mishaps provers A
+578 158202 29 signifying quelling aeronautic A
+579 158203 29 Patrice spiritual voltage W
+580 158204 29 search beguiles sash
+581 158301 29 Angeles Trobriand anaerobic A
+582 158302 29 semblance fleeing simultaneous A
+583 158303 29 taxed Armour accumulating A
+584 158304 29 Beatrice chin Medusan A
+585 158305 29 retrace provers shouted A
+586 158306 29 lockout aeronautic freakish
+587 158501 29 grammatic voltage index FAS
+588 160301 29 helmsman sash commercially
+589 166101 50 uniform anaerobic mistiness A
+590 166102 50 hamming simultaneous endpoint
+591 168001 29 disobedience accumulating straight A
+592 168002 29 captivated Medusan flurried
+593 168003 29 transferals shouted denotative A
+594 168101 29 cartographer freakish coming FAS
+595 168102 29 aims index commencements FAS
+596 168103 29 Pakistani commercially gentleman
+597 168104 29 burglarized mistiness gifted
+598 168202 29 saucepans endpoint Shanghais
+599 168301 29 lacerating straight sportswriting A
+600 168502 29 corny flurried sloping A
+601 168503 29 megabytes denotative navies
+602 168601 29 chancellor coming leaflet A
+603 173001 40 bulk commencements shooter
+604 173701 40 commits gentleman Joplin FAS
+605 173702 40 meson gifted babies
+606 176001 40 deputies Shanghais subdivision FAS
+607 176101 40 northeaster sportswriting burstiness W
+608 176201 40 dipole sloping belted FAS
+609 176401 40 machining navies assails FAS
+610 176501 40 therefore leaflet admiring W
+611 176601 40 Telefunken shooter swaying 0
+612 176602 40 salvaging Joplin Goldstine FAS
+613 176603 40 Corinthianizes babies fitting
+614 178001 40 restlessly subdivision Norwalk W
+615 178002 40 bromides burstiness weakening W
+616 178003 40 generalized belted analogy FAS
+617 178004 40 mishaps assails deludes
+618 178005 40 quelling admiring cokes
+619 178006 40 spiritual swaying Clayton
+620 178007 40 beguiles Goldstine exhausts
+621 178008 40 Trobriand fitting causality
+622 178101 40 fleeing Norwalk sating FAS
+623 178102 40 Armour weakening icon
+624 178103 40 chin analogy throttles
+625 178201 40 provers deludes communicants FAS
+626 178202 40 aeronautic cokes dehydrate FAS
+627 178301 40 voltage Clayton priceless FAS
+628 178302 40 sash exhausts publicly
+629 178401 40 anaerobic causality incidentals FAS
+630 178402 40 simultaneous sating commonplace
+631 178403 40 accumulating icon mumbles
+632 178404 40 Medusan throttles furthermore W
+633 178501 40 shouted communicants cautioned W
+634 186002 37 freakish dehydrate parametrized A
+635 186102 37 index priceless registration A
+636 186201 40 commercially publicly sadly FAS
+637 186202 40 mistiness incidentals positioning
+638 186203 40 endpoint commonplace babysitting
+639 186302 37 straight mumbles eternal A
+640 188007 37 flurried furthermore hoarder
+641 188008 37 denotative cautioned congregates
+642 188009 37 coming parametrized rains
+643 188010 37 commencements registration workers W
+644 188011 37 gentleman sadly sags A
+645 188012 37 gifted positioning unplug W
+646 188013 37 Shanghais babysitting garage A
+647 188014 37 sportswriting eternal boulder A
+648 188015 37 sloping hoarder hollowly A
+649 188016 37 navies congregates specifics
+650 188017 37 leaflet rains Teresa
+651 188102 37 shooter workers Winsett
+652 188103 37 Joplin sags convenient A
+653 188202 37 babies unplug buckboards FAS
+654 188301 40 subdivision garage amenities
+655 188302 40 burstiness boulder resplendent FAS
+656 188303 40 belted hollowly priding FAS
+657 188401 37 assails specifics configurations
+658 188402 37 admiring Teresa untidiness A
+659 188503 37 swaying Winsett Brice W
+660 188504 37 Goldstine convenient sews FAS
+661 188505 37 fitting buckboards participated
+662 190701 37 Norwalk amenities Simon FAS
+663 190703 50 weakening resplendent certificates
+664 191701 37 analogy priding Fitzpatrick
+665 191702 37 deludes configurations Evanston A
+666 191703 37 cokes untidiness misted
+667 196001 37 Clayton Brice textures A
+668 196002 37 exhausts sews save
+669 196003 37 causality participated count
+670 196101 37 sating Simon rightful A
+671 196103 37 icon certificates chaperone
+672 196104 37 throttles Fitzpatrick Lizzy A
+673 196201 37 communicants Evanston clenched A
+674 196202 37 dehydrate misted effortlessly
+675 196203 37 priceless textures accessed
+676 198001 37 publicly save beaters A
+677 198003 37 incidentals count Hornblower FAS
+678 198004 37 commonplace rightful vests A
+679 198005 37 mumbles chaperone indulgences FAS
+680 198006 37 furthermore Lizzy infallibly A
+681 198007 37 cautioned clenched unwilling FAS
+682 198008 37 parametrized effortlessly excrete FAS
+683 198009 37 registration accessed spools A
+684 198010 37 sadly beaters crunches FAS
+685 198011 37 positioning Hornblower overestimating FAS
+686 198012 37 babysitting vests ineffective
+687 198013 37 eternal indulgences humiliation A
+688 198014 37 hoarder infallibly sophomore
+689 198015 37 congregates unwilling star
+690 198017 37 rains excrete rifles
+691 198018 37 workers spools dialysis
+692 198019 37 sags crunches arriving
+693 198020 37 unplug overestimating indulge
+694 198021 37 garage ineffective clockers
+695 198022 37 boulder humiliation languages
+696 198023 50 hollowly sophomore Antarctica A
+697 198024 37 specifics star percentage
+698 198101 37 Teresa rifles ceiling A
+699 198103 37 Winsett dialysis specification
+700 198105 37 convenient arriving regimented A
+701 198106 37 buckboards indulge ciphers
+702 198201 37 amenities clockers pictures A
+703 198204 37 resplendent languages serpents A
+704 198301 53 priding Antarctica allot A
+705 198302 53 configurations percentage realized A
+706 198303 53 untidiness ceiling mayoral A
+707 198304 53 Brice specification opaquely A
+708 198401 37 sews regimented hostess FAS
+709 198402 37 participated ciphers fiftieth
+710 198403 37 Simon pictures incorrectly
+711 202101 37 certificates serpents decomposition FAS
+712 202301 37 Fitzpatrick allot stranglings
+713 202302 37 Evanston realized mixture FAS
+714 202303 37 misted mayoral electroencephalography FAS
+715 202304 37 textures opaquely similarities FAS
+716 202305 37 save hostess charges W
+717 202601 37 count fiftieth freest FAS
+718 202602 37 rightful incorrectly Greenberg FAS
+719 202605 37 chaperone decomposition tinting
+720 202606 37 Lizzy stranglings expelled W
+721 202607 37 clenched mixture warm
+722 202901 37 effortlessly electroencephalography smoothed
+723 202902 37 accessed similarities deductions FAS
+724 202903 37 beaters charges Romano W
+725 202904 37 Hornblower freest bitterroot
+726 202907 37 vests Greenberg corset
+727 202908 37 indulgences tinting securing
+728 203101 37 infallibly expelled environing FAS
+729 203103 37 unwilling warm cute
+730 203104 37 excrete smoothed Crays
+731 203105 37 spools deductions heiress FAS
+732 203401 37 crunches Romano inform FAS
+733 203402 37 overestimating bitterroot avenge
+734 203404 37 ineffective corset universals
+735 203901 37 humiliation securing Kinsey W
+736 203902 37 sophomore environing ravines FAS
+737 203903 37 star cute bestseller
+738 203906 37 rifles Crays equilibrium
+739 203907 37 dialysis heiress extents 0
+740 203908 37 arriving inform relatively
+741 203909 37 indulge avenge pressure FAS
+742 206101 37 clockers universals critiques FAS
+743 206201 37 languages Kinsey befouled
+744 206202 37 Antarctica ravines rightfully FAS
+745 206203 37 percentage bestseller mechanizing FAS
+746 206206 37 ceiling equilibrium Latinizes
+747 206207 37 specification extents timesharing
+748 206208 37 regimented relatively Aden
+749 208001 37 ciphers pressure embassies
+750 208002 37 pictures critiques males FAS
+751 208003 37 serpents befouled shapelessly FAS
+752 208004 37 allot rightfully genres FAS
+753 208008 37 realized mechanizing mastering
+754 208009 37 mayoral Latinizes Newtonian
+755 208010 37 opaquely timesharing finishers FAS
+756 208011 37 hostess Aden abates
+757 208101 37 fiftieth embassies teem
+758 208102 37 incorrectly males kiting FAS
+759 208103 37 decomposition shapelessly stodgy FAS
+760 208104 37 stranglings genres scalps FAS
+761 208105 37 mixture mastering feed FAS
+762 208110 37 electroencephalography Newtonian guitars
+763 208111 37 similarities finishers airships
+764 208112 37 charges abates store
+765 208113 37 freest teem denounces
+766 208201 37 Greenberg kiting Pyle FAS
+767 208203 37 tinting stodgy Saxony
+768 208301 37 expelled scalps serializations FAS
+769 208302 37 warm feed Peruvian FAS
+770 208305 37 smoothed guitars taxonomically FAS
+771 208401 37 deductions airships kingdom A
+772 208402 37 Romano store stint A
+773 208403 37 bitterroot denounces Sault A
+774 208404 37 corset Pyle faithful
+775 208501 37 securing Saxony Ganymede FAS
+776 208502 37 environing serializations tidiness FAS
+777 208503 37 cute Peruvian gainful FAS
+778 208504 37 Crays taxonomically contrary FAS
+779 208505 37 heiress kingdom Tipperary FAS
+780 210101 37 inform stint tropics W
+781 210102 37 avenge Sault theorizers
+782 210103 37 universals faithful renew 0
+783 210104 37 Kinsey Ganymede already
+784 210105 37 ravines tidiness terminal
+785 210106 37 bestseller gainful Hegelian
+786 210107 37 equilibrium contrary hypothesizer
+787 210401 37 extents Tipperary warningly FAS
+788 213201 37 relatively tropics journalizing FAS
+789 213203 37 pressure theorizers nested
+790 213204 37 critiques renew Lars
+791 213205 37 befouled already saplings
+792 213206 37 rightfully terminal foothill
+793 213207 37 mechanizing Hegelian labeled
+794 216101 37 Latinizes hypothesizer imperiously FAS
+795 216103 37 timesharing warningly reporters FAS
+796 218001 37 Aden journalizing furnishings FAS
+797 218002 37 embassies nested precipitable FAS
+798 218003 37 males Lars discounts FAS
+799 218004 37 shapelessly saplings excises FAS
+800 143503 50 genres foothill Stalin
+801 218006 37 mastering labeled despot FAS
+802 218007 37 Newtonian imperiously ripeness FAS
+803 218008 37 finishers reporters Arabia
+804 218009 37 abates furnishings unruly
+805 218010 37 teem precipitable mournfulness
+806 218011 37 kiting discounts boom FAS
+807 218020 37 stodgy excises slaughter A
+808 218021 50 scalps Stalin Sabine
+809 218022 37 feed despot handy FAS
+810 218023 37 guitars ripeness rural
+811 218024 37 airships Arabia organizer
+812 218101 37 store unruly shipyard FAS
+813 218102 37 denounces mournfulness civics FAS
+814 218103 37 Pyle boom inaccuracy FAS
+815 218201 37 Saxony slaughter rules FAS
+816 218202 37 serializations Sabine juveniles FAS
+817 218203 37 Peruvian handy comprised W
+818 218204 37 taxonomically rural investigations
+819 218205 37 kingdom organizer stabilizes A
+820 218301 37 stint shipyard seminaries FAS
+821 218302 37 Sault civics Hunter A
+822 218401 37 faithful inaccuracy sporty FAS
+823 218402 37 Ganymede rules test FAS
+824 218403 37 tidiness juveniles weasels
+825 218404 37 gainful comprised CERN
+826 218407 37 contrary investigations tempering
+827 218408 37 Tipperary stabilizes afore FAS
+828 218409 37 tropics seminaries Galatean
+829 218410 37 theorizers Hunter techniques W
+830 226001 37 renew sporty error
+831 226002 37 already test veranda
+832 226003 37 terminal weasels severely
+833 226004 37 Hegelian CERN Cassites FAS
+834 226005 37 hypothesizer tempering forthcoming
+835 226006 37 warningly afore guides
+836 226007 37 journalizing Galatean vanish FAS
+837 226008 37 nested techniques lied A
+838 226203 37 Lars error sawtooth FAS
+839 226204 37 saplings veranda fated FAS
+840 226205 37 foothill severely gradually
+841 226206 37 labeled Cassites widens
+842 226207 37 imperiously forthcoming preclude
+843 226208 37 reporters guides Jobrel
+844 226209 37 furnishings vanish hooker
+845 226210 37 precipitable lied rainstorm
+846 226211 37 discounts sawtooth disconnects
+847 228001 37 excises fated cruelty
+848 228004 37 Stalin gradually exponentials A
+849 228005 37 despot widens affective A
+850 228006 37 ripeness preclude arteries
+851 228007 37 Arabia Jobrel Crosby FAS
+852 228008 37 unruly hooker acquaint
+853 228009 37 mournfulness rainstorm evenhandedly
+854 228101 37 boom disconnects percentage
+855 228108 37 slaughter cruelty disobedience
+856 228109 37 Sabine exponentials humility
+857 228110 37 handy affective gleaning A
+858 228111 37 rural arteries petted A
+859 228112 37 organizer Crosby bloater A
+860 228113 37 shipyard acquaint minion A
+861 228114 37 civics evenhandedly marginal A
+862 228115 37 inaccuracy percentage apiary A
+863 228116 37 rules disobedience measures
+864 228117 37 juveniles humility precaution
+865 228118 37 comprised gleaning repelled
+866 228119 37 investigations petted primary FAS
+867 228120 37 stabilizes bloater coverings
+868 228121 37 seminaries minion Artemia A
+869 228122 37 Hunter marginal navigate
+870 228201 37 sporty apiary spatial
+871 228206 37 test measures Gurkha
+872 228207 37 weasels precaution meanwhile A
+873 228208 37 CERN repelled Melinda A
+874 228209 37 tempering primary Butterfield
+875 228210 37 afore coverings Aldrich A
+876 228211 37 Galatean Artemia previewing A
+877 228212 37 techniques navigate glut A
+878 228213 37 error spatial unaffected
+879 228214 37 veranda Gurkha inmate
+880 228301 37 severely meanwhile mineral
+881 228305 37 Cassites Melinda impending A
+882 228306 37 forthcoming Butterfield meditation A
+883 228307 37 guides Aldrich ideas
+884 228308 37 vanish previewing miniaturizes W
+885 228309 37 lied glut lewdly
+886 228310 37 sawtooth unaffected title
+887 228311 37 fated inmate youthfulness
+888 228312 37 gradually mineral creak FAS
+889 228313 37 widens impending Chippewa
+890 228314 37 preclude meditation clamored
+891 228401 65 Jobrel ideas freezes
+892 228402 65 hooker miniaturizes forgivably FAS
+893 228403 65 rainstorm lewdly reduce FAS
+894 228404 65 disconnects title McGovern W
+895 228405 65 cruelty youthfulness Nazis W
+896 228406 65 exponentials creak epistle W
+897 228407 65 affective Chippewa socializes W
+898 228408 65 arteries clamored conceptions
+899 228409 65 Crosby freezes Kevin
+900 228410 65 acquaint forgivably uncovering
+901 230301 37 evenhandedly reduce chews FAS
+902 230302 37 percentage McGovern appendixes FAS
+903 230303 37 disobedience Nazis raining
+904 018062 37 humility epistle infest
+905 230501 37 gleaning socializes compartment
+906 230502 37 petted conceptions minting
+907 230503 37 bloater Kevin ducks
+908 230504 37 minion uncovering roped A
+909 230505 37 marginal chews waltz
+910 230506 37 apiary appendixes Lillian
+911 230507 37 measures raining repressions A
+912 230508 37 precaution infest chillingly
+913 230509 37 repelled compartment noncritical
+914 230901 37 primary minting lithograph
+915 230902 37 coverings ducks spongers
+916 230903 37 Artemia roped parenthood
+917 230904 37 navigate waltz posed
+918 230905 37 spatial Lillian instruments
+919 230906 37 Gurkha repressions filial
+920 230907 37 meanwhile chillingly fixedly
+921 230908 37 Melinda noncritical relives
+922 230909 37 Butterfield lithograph Pandora
+923 230910 37 Aldrich spongers watering A
+924 230911 37 previewing parenthood ungrateful
+925 230912 37 glut posed secures
+926 230913 37 unaffected instruments chastisers
+927 230914 37 inmate filial icon
+928 231304 37 mineral fixedly reuniting A
+929 231305 37 impending relives imagining A
+930 231306 37 meditation Pandora abiding A
+931 231307 37 ideas watering omnisciently
+932 231308 37 miniaturizes ungrateful Britannic
+933 231309 37 lewdly secures scholastics A
+934 231310 37 title chastisers mechanics A
+935 231311 37 youthfulness icon humidly A
+936 231312 37 creak reuniting masterpiece
+937 231313 37 Chippewa imagining however
+938 231314 37 clamored abiding Mendelian
+939 231315 37 freezes omnisciently jarred
+940 232102 37 forgivably Britannic scolds
+941 232103 37 reduce scholastics infatuate
+942 232104 37 McGovern mechanics willed A
+943 232105 37 Nazis humidly joyfully
+944 232106 37 epistle masterpiece Microsoft
+945 232107 37 socializes however fibrosities
+946 232108 37 conceptions Mendelian Baltimorean
+947 232601 37 Kevin jarred equestrian
+948 232602 37 uncovering scolds Goodrich
+949 232603 37 chews infatuate apish A
+950 232605 37 appendixes willed Adlerian
+5950 1232605 37 appendixes willed Adlerian
+5951 1232606 37 appendixes willed Adlerian
+5952 1232607 37 appendixes willed Adlerian
+5953 1232608 37 appendixes willed Adlerian
+5954 1232609 37 appendixes willed Adlerian
+951 232606 37 raining joyfully Tropez
+952 232607 37 infest Microsoft nouns
+953 232608 37 compartment fibrosities distracting
+954 232609 37 minting Baltimorean mutton
+955 236104 37 ducks equestrian bridgeable A
+956 236105 37 roped Goodrich stickers A
+957 236106 37 waltz apish transcontinental A
+958 236107 37 Lillian Adlerian amateurish
+959 236108 37 repressions Tropez Gandhian
+960 236109 37 chillingly nouns stratified
+961 236110 37 noncritical distracting chamberlains
+962 236111 37 lithograph mutton creditably
+963 236112 37 spongers bridgeable philosophic
+964 236113 37 parenthood stickers ores
+965 238005 37 posed transcontinental Carleton
+966 238006 37 instruments amateurish tape A
+967 238007 37 filial Gandhian afloat A
+968 238008 37 fixedly stratified goodness A
+969 238009 37 relives chamberlains welcoming
+970 238010 37 Pandora creditably Pinsky FAS
+971 238011 37 watering philosophic halting
+972 238012 37 ungrateful ores bibliography
+973 238013 37 secures Carleton decoding
+974 240401 41 chastisers tape variance A
+975 240402 41 icon afloat allowed A
+976 240901 41 reuniting goodness dire A
+977 240902 41 imagining welcoming dub A
+978 241801 41 abiding Pinsky poisoning
+979 242101 41 omnisciently halting Iraqis A
+980 242102 41 Britannic bibliography heaving
+981 242201 41 scholastics decoding population A
+982 242202 41 mechanics variance bomb A
+983 242501 41 humidly allowed Majorca A
+984 242502 41 masterpiece dire Gershwins
+985 246201 41 however dub explorers
+986 246202 41 Mendelian poisoning libretto A
+987 246203 41 jarred Iraqis occurred
+988 246204 41 scolds heaving Lagos
+989 246205 41 infatuate population rats
+990 246301 41 willed bomb bankruptcies A
+991 246302 41 joyfully Majorca crying
+992 248001 41 Microsoft Gershwins unexpected
+993 248002 41 fibrosities explorers accessed A
+994 248003 41 Baltimorean libretto colorful A
+995 248004 41 equestrian occurred versatility A
+996 248005 41 Goodrich Lagos cosy
+997 248006 41 apish rats Darius A
+998 248007 41 Adlerian bankruptcies mastering A
+999 248008 41 Tropez crying Asiaticizations A
+1000 248009 41 nouns unexpected offerers A
+1001 248010 41 distracting accessed uncles A
+1002 248011 41 mutton colorful sleepwalk
+1003 248012 41 bridgeable versatility Ernestine
+1004 248013 41 stickers cosy checksumming
+1005 248014 41 transcontinental Darius stopped
+1006 248015 41 amateurish mastering sicker
+1007 248016 41 Gandhian Asiaticizations Italianization
+1008 248017 41 stratified offerers alphabetic
+1009 248018 41 chamberlains uncles pharmaceutic
+1010 248019 41 creditably sleepwalk creator
+1011 248020 41 philosophic Ernestine chess
+1012 248021 41 ores checksumming charcoal
+1013 248101 41 Carleton stopped Epiphany A
+1014 248102 41 tape sicker bulldozes A
+1015 248201 41 afloat Italianization Pygmalion A
+1016 248202 41 goodness alphabetic caressing A
+1017 248203 41 welcoming pharmaceutic Palestine A
+1018 248204 41 Pinsky creator regimented A
+1019 248205 41 halting chess scars A
+1020 248206 41 bibliography charcoal realest A
+1021 248207 41 decoding Epiphany diffusing A
+1022 248208 41 variance bulldozes clubroom A
+1023 248209 41 allowed Pygmalion Blythe A
+1024 248210 41 dire caressing ahead
+1025 248211 50 dub Palestine reviver
+1026 250501 34 poisoning regimented retransmitting A
+1027 250502 34 Iraqis scars landslide
+1028 250503 34 heaving realest Eiffel
+1029 250504 34 population diffusing absentee
+1030 250505 34 bomb clubroom aye
+1031 250601 34 Majorca Blythe forked A
+1032 250602 34 Gershwins ahead Peruvianizes
+1033 250603 34 explorers reviver clerked
+1034 250604 34 libretto retransmitting tutor
+1035 250605 34 occurred landslide boulevard
+1036 251001 34 Lagos Eiffel shuttered
+1037 251002 34 rats absentee quotes A
+1038 251003 34 bankruptcies aye Caltech
+1039 251004 34 crying forked Mossberg
+1040 251005 34 unexpected Peruvianizes kept
+1041 251301 34 accessed clerked roundly
+1042 251302 34 colorful tutor features A
+1043 251303 34 versatility boulevard imaginable A
+1044 251304 34 cosy shuttered controller
+1045 251305 34 Darius quotes racial
+1046 251401 34 mastering Caltech uprisings A
+1047 251402 34 Asiaticizations Mossberg narrowed A
+1048 251403 34 offerers kept cannot A
+1049 251404 34 uncles roundly vest
+1050 251405 34 sleepwalk features famine
+1051 251406 34 Ernestine imaginable sugars
+1052 251801 34 checksumming controller exterminated A
+1053 251802 34 stopped racial belays
+1054 252101 34 sicker uprisings Hodges A
+1055 252102 34 Italianization narrowed translatable
+1056 252301 34 alphabetic cannot duality A
+1057 252302 34 pharmaceutic vest recording A
+1058 252303 34 creator famine rouses A
+1059 252304 34 chess sugars poison
+1060 252305 34 charcoal exterminated attitude
+1061 252306 34 Epiphany belays dusted
+1062 252307 34 bulldozes Hodges encompasses
+1063 252308 34 Pygmalion translatable presentation
+1064 252309 34 caressing duality Kantian
+1065 256001 34 Palestine recording imprecision A
+1066 256002 34 regimented rouses saving
+1067 256003 34 scars poison maternal
+1068 256004 34 realest attitude hewed
+1069 256005 34 diffusing dusted kerosene
+1070 258001 34 clubroom encompasses Cubans
+1071 258002 34 Blythe presentation photographers
+1072 258003 34 ahead Kantian nymph A
+1073 258004 34 reviver imprecision bedlam A
+1074 258005 34 retransmitting saving north A
+1075 258006 34 landslide maternal Schoenberg A
+1076 258007 34 Eiffel hewed botany A
+1077 258008 34 absentee kerosene curs
+1078 258009 34 aye Cubans solidification
+1079 258010 34 forked photographers inheritresses
+1080 258011 34 Peruvianizes nymph stiller
+1081 258101 68 clerked bedlam t1 A
+1082 258102 68 tutor north suite A
+1083 258103 34 boulevard Schoenberg ransomer
+1084 258104 68 shuttered botany Willy
+1085 258105 68 quotes curs Rena A
+1086 258106 68 Caltech solidification Seattle A
+1087 258107 68 Mossberg inheritresses relaxes A
+1088 258108 68 kept stiller exclaim
+1089 258109 68 roundly t1 implicated A
+1090 258110 68 features suite distinguish
+1091 258111 68 imaginable ransomer assayed
+1092 258112 68 controller Willy homeowner
+1093 258113 68 racial Rena and
+1094 258201 34 uprisings Seattle stealth
+1095 258202 34 narrowed relaxes coinciding A
+1096 258203 34 cannot exclaim founder A
+1097 258204 34 vest implicated environing
+1098 258205 34 famine distinguish jewelry
+1099 258301 34 sugars assayed lemons A
+1100 258401 34 exterminated homeowner brokenness A
+1101 258402 34 belays and bedpost A
+1102 258403 34 Hodges stealth assurers A
+1103 258404 34 translatable coinciding annoyers
+1104 258405 34 duality founder affixed
+1105 258406 34 recording environing warbling
+1106 258407 34 rouses jewelry seriously
+1107 228123 37 poison lemons boasted
+1108 250606 34 attitude brokenness Chantilly
+1109 208405 37 dusted bedpost Iranizes
+1110 212101 37 encompasses assurers violinist
+1111 218206 37 presentation annoyers extramarital
+1112 150401 37 Kantian affixed spates
+1113 248212 41 imprecision warbling cloakroom
+1114 128026 00 saving seriously gazer
+1115 128024 00 maternal boasted hand
+1116 128027 00 hewed Chantilly tucked
+1117 128025 00 kerosene Iranizes gems
+1118 128109 00 Cubans violinist clinker
+1119 128705 00 photographers extramarital refiner
+1120 126303 00 nymph spates callus
+1121 128308 00 bedlam cloakroom leopards
+1122 128204 00 north gazer comfortingly
+1123 128205 00 Schoenberg hand generically
+1124 128206 00 botany tucked getters
+1125 128207 00 curs gems sexually
+1126 118205 00 solidification clinker spear
+1127 116801 00 inheritresses refiner serums
+1128 116803 00 stiller callus Italianization
+1129 116804 00 t1 leopards attendants
+1130 116802 00 suite comfortingly spies
+1131 128605 00 ransomer generically Anthony
+1132 118308 00 Willy getters planar
+1133 113702 00 Rena sexually cupped
+1134 113703 00 Seattle spear cleanser
+1135 112103 00 relaxes serums commuters
+1136 118009 00 exclaim Italianization honeysuckle
+5136 1118009 00 exclaim Italianization honeysuckle
+1137 138011 00 implicated attendants orphanage
+1138 138010 00 distinguish spies skies
+1139 138012 00 assayed Anthony crushers
+1140 068304 00 homeowner planar Puritan
+1141 078009 00 and cupped squeezer
+1142 108013 00 stealth cleanser bruises
+1143 084004 00 coinciding commuters bonfire
+1144 083402 00 founder honeysuckle Colombo
+1145 084003 00 environing orphanage nondecreasing
+1146 088504 00 jewelry skies innocents
+1147 088005 00 lemons crushers masked
+1148 088007 00 brokenness Puritan file
+1149 088006 00 bedpost squeezer brush
+1150 148025 00 assurers bruises mutilate
+1151 148024 00 annoyers bonfire mommy
+1152 138305 00 affixed Colombo bulkheads
+1153 138306 00 warbling nondecreasing undeclared
+1154 152701 00 seriously innocents displacements
+1155 148505 00 boasted masked nieces
+1156 158003 00 Chantilly file coeducation
+1157 156201 00 Iranizes brush brassy
+1158 156202 00 violinist mutilate authenticator
+1159 158307 00 extramarital mommy Washoe
+1160 158402 00 spates bulkheads penny
+1161 158401 00 cloakroom undeclared Flagler
+1162 068013 00 gazer displacements stoned
+1163 068012 00 hand nieces cranes
+1164 068203 00 tucked coeducation masterful
+1165 088205 00 gems brassy biracial
+1166 068704 00 clinker authenticator steamships
+1167 068604 00 refiner Washoe windmills
+1168 158502 00 callus penny exploit
+1169 123103 00 leopards Flagler riverfront
+1170 148026 00 comfortingly stoned sisterly
+1171 123302 00 generically cranes sharpshoot
+1172 076503 00 getters masterful mittens
+1173 126304 00 sexually biracial interdependency
+1174 068306 00 spear steamships policy
+1175 143504 00 serums windmills unleashing
+1176 160201 00 Italianization exploit pretenders
+1177 148028 00 attendants riverfront overstatements
+1178 148027 00 spies sisterly birthed
+1179 143505 00 Anthony sharpshoot opportunism
+1180 108014 00 planar mittens showroom
+1181 076104 00 cupped interdependency compromisingly
+1182 078106 00 cleanser policy Medicare
+1183 126102 00 commuters unleashing corresponds
+1184 128029 00 honeysuckle pretenders hardware
+1185 128028 00 orphanage overstatements implant
+1186 018410 00 skies birthed Alicia
+1187 128110 00 crushers opportunism requesting
+1188 148506 00 Puritan showroom produced
+1189 123303 00 squeezer compromisingly criticizes
+1190 123304 00 bruises Medicare backer
+1191 068504 00 bonfire corresponds positively
+1192 068305 00 Colombo hardware colicky
+1193 000000 00 nondecreasing implant thrillingly
+1 000001 00 Omaha teethe neat
+2 011401 37 breaking dreaded Steinberg W
+3 011402 37 Romans scholastics jarring
+4 011403 37 intercepted audiology tinily
+drop table t1, t2;
diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result
index 66b24248cf9..6bc59d4771f 100644
--- a/mysql-test/r/auto_increment.result
+++ b/mysql-test/r/auto_increment.result
@@ -1,4 +1,5 @@
drop table if exists t1;
+drop table if exists t2;
SET SQL_WARNINGS=1;
create table t1 (a int not null auto_increment,b int, primary key (a)) engine=myisam auto_increment=3;
insert into t1 values (1,1),(NULL,3),(NULL,4);
@@ -162,7 +163,7 @@ last_insert_id()
255
insert into t1 set i = null;
Warnings:
-Warning 1264 Data truncated, out of range for column 'i' at row 1
+Warning 1264 Data truncated; out of range for column 'i' at row 1
select last_insert_id();
last_insert_id()
255
@@ -213,7 +214,7 @@ a b
delete from t1 where a=0;
update t1 set a=NULL where b=6;
Warnings:
-Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 4
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 4
update t1 set a=300 where b=7;
SET SQL_MODE='';
insert into t1(a,b)values(NULL,8);
@@ -255,7 +256,7 @@ a b
delete from t1 where a=0;
update t1 set a=NULL where b=13;
Warnings:
-Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 9
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 9
update t1 set a=500 where b=14;
select * from t1 order by b;
a b
diff --git a/mysql-test/r/bdb-deadlock.result b/mysql-test/r/bdb-deadlock.result
index c5871ff282a..9394c90ff00 100644
--- a/mysql-test/r/bdb-deadlock.result
+++ b/mysql-test/r/bdb-deadlock.result
@@ -9,7 +9,7 @@ set autocommit=0;
update t2 set x = 1 where id = 0;
select x from t1 where id = 0;
select x from t2 where id = 0;
-ERROR 40001: Deadlock found when trying to get lock; Try restarting transaction
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
commit;
x
1
diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result
index 9a279f702a2..d510ec53dfc 100644
--- a/mysql-test/r/bdb.result
+++ b/mysql-test/r/bdb.result
@@ -1181,3 +1181,73 @@ a
A
a
drop table t1;
+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;
+substring(pk1, 1, 4) substring(pk1, 4001) substring(pk2, 1, 4) substring(pk2, 4001) pk3 key1 key2
+aaa- AAAA eee- eeee a++a 1 1
+bbb- BBBB ggg- GGGG b++b 1 1
+drop table t1;
+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;
+pk1 pk2 key1 key2
+ empt 2 2
+a a--a 2 2
+bb b--b 2 2
+ccc c--c 2 2
+dddd d--d 2 2
+drop table t1;
+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);
+b
+drop table t1;
+set autocommit=1;
+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);
+a
+1
+2
+3
+4
+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;
+a b
+1 one
+2 two
+3 three
+4 four
+drop table t1, t2;
+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;
+a b
+drop table t1;
diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result
index 635c9fd5242..e0a6c0cd141 100644
--- a/mysql-test/r/connect.result
+++ b/mysql-test/r/connect.result
@@ -10,6 +10,11 @@ help_topic
host
proc
tables_priv
+time_zone
+time_zone_leap_second
+time_zone_name
+time_zone_transition
+time_zone_transition_type
user
show tables;
Tables_in_test
@@ -27,10 +32,15 @@ help_topic
host
proc
tables_priv
+time_zone
+time_zone_leap_second
+time_zone_name
+time_zone_transition
+time_zone_transition_type
user
show tables;
Tables_in_test
-update mysql.user set password=old_password("gambling2") where user="test";
+update mysql.user set password=old_password("gambling2") where user=_binary"test";
flush privileges;
set password=old_password('gambling3');
show tables;
@@ -45,8 +55,13 @@ help_topic
host
proc
tables_priv
+time_zone
+time_zone_leap_second
+time_zone_name
+time_zone_transition
+time_zone_transition_type
user
show tables;
Tables_in_test
-delete from mysql.user where user="test";
+delete from mysql.user where user=_binary"test";
flush privileges;
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index b5f7da30bb3..699485ff3f7 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -11,7 +11,7 @@ create table t1 (b char(0) not null);
create table if not exists t1 (b char(0) not null);
insert into t1 values (""),(null);
Warnings:
-Warning 1263 Data truncated, NULL supplied to NOT NULL column 'b' at row 2
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'b' at row 2
select * from t1;
b
@@ -35,7 +35,7 @@ drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=heap;
-ERROR 42000: Incorrect table definition; There can only be one auto column and it must be defined as a key
+ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key
create table not_existing_database.test (a int);
Got one of the listed errors
create table `a/a` (a int);
@@ -47,7 +47,7 @@ ERROR 42000: Identifier name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
create table test (a datetime default now());
ERROR 42000: Invalid default value for 'a'
create table test (a datetime on update now());
-ERROR HY000: Invalid ON UPDATE clause for 'a' field
+ERROR HY000: Invalid ON UPDATE clause for 'a' column
create table test (a int default 100 auto_increment);
ERROR 42000: Invalid default value for 'a'
create table 1ea10 (1a20 int,1e int);
@@ -275,11 +275,11 @@ ERROR 42000: Incorrect database name 'db1 '
create table t1(`a ` int);
ERROR 42000: Incorrect column name 'a '
create table t1 (a int,);
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
create table t1 (a int,,b int);
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'b int)' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'b int)' at line 1
create table t1 (,b int);
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'b int)' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'b int)' at line 1
create table t1 (a int, key(a));
create table t2 (b int, foreign key(b) references t1(a), key(b));
drop table if exists t1,t2;
diff --git a/mysql-test/r/ctype_create.result b/mysql-test/r/ctype_create.result
index e2dc8c1be66..0da76c556e2 100644
--- a/mysql-test/r/ctype_create.result
+++ b/mysql-test/r/ctype_create.result
@@ -1,15 +1,37 @@
SET @@character_set_server=latin5;
-CREATE DATABASE db1 DEFAULT CHARACTER SET cp1251;
-USE db1;
-CREATE DATABASE db2;
-SHOW CREATE DATABASE db1;
+CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET cp1251;
+USE mysqltest1;
+CREATE DATABASE mysqltest2;
+SHOW CREATE DATABASE mysqltest1;
Database Create Database
-db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET cp1251 */
-SHOW CREATE DATABASE db2;
+mysqltest1 CREATE DATABASE `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp1251 */
+SHOW CREATE DATABASE mysqltest2;
Database Create Database
-db2 CREATE DATABASE `db2` /*!40100 DEFAULT CHARACTER SET latin5 */
-DROP DATABASE db2;
-USE db1;
+mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin5 */
+CREATE TABLE mysqltest2.t1 (a char(10));
+SHOW CREATE TABLE mysqltest2.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(10) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin5
+DROP TABLE mysqltest2.t1;
+ALTER DATABASE mysqltest2 DEFAULT CHARACTER SET latin7;
+CREATE TABLE mysqltest2.t1 (a char(10));
+SHOW CREATE TABLE mysqltest2.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(10) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin7
+DROP DATABASE mysqltest2;
+CREATE DATABASE mysqltest2 CHARACTER SET latin2;
+CREATE TABLE mysqltest2.t1 (a char(10));
+SHOW CREATE TABLE mysqltest2.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(10) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin2
+DROP DATABASE mysqltest2;
+USE mysqltest1;
CREATE TABLE t1 (a char(10));
SHOW CREATE TABLE t1;
Table Create Table
@@ -32,4 +54,4 @@ t1 CREATE TABLE `t1` (
`a` char(10) collate latin1_german1_ci default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci
DROP TABLE t1;
-DROP DATABASE db1;
+DROP DATABASE mysqltest1;
diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result
index ed59de87395..805f731f0ec 100644
--- a/mysql-test/r/ctype_recoding.result
+++ b/mysql-test/r/ctype_recoding.result
@@ -111,3 +111,34 @@ SET character_set_connection=cp1251;
SELECT hex('ÔÅÓÔ');
hex('ÔÅÓÔ')
F2E5F1F2
+USE test;
+SET NAMES binary;
+CREATE TABLE `теÑÑ‚` (`теÑÑ‚` int);
+SHOW CREATE TABLE `теÑÑ‚`;
+Table Create Table
+теÑÑ‚ CREATE TABLE `теÑÑ‚` (
+ `теÑÑ‚` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SET NAMES utf8;
+SHOW CREATE TABLE `теÑÑ‚`;
+Table Create Table
+теÑÑ‚ CREATE TABLE `теÑÑ‚` (
+ `теÑÑ‚` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE `теÑÑ‚`;
+SET NAMES binary;
+SET character_set_connection=utf8;
+SELECT 'теÑÑ‚' as s;
+s
+теÑÑ‚
+SET NAMES utf8;
+SET character_set_connection=binary;
+SELECT 'теÑÑ‚' as s;
+s
+теÑÑ‚
+SET NAMES binary;
+CREATE TABLE `goodÐÌÏÈÏ` (a int);
+ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ'
+SET NAMES utf8;
+CREATE TABLE `goodÐÌÏÈÏ` (a int);
+ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ` (a int)'
diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result
new file mode 100644
index 00000000000..2fd654da434
--- /dev/null
+++ b/mysql-test/r/ctype_uca.result
@@ -0,0 +1,1764 @@
+DROP TABLE IF EXISTS t1;
+set names utf8;
+create table t1 (c1 char(10) character set utf8 collate utf8_bin);
+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');
+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);
+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);
+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;
+group_concat(c1 order by c1)
+÷
+×
+A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
+AA,Aa,aA,aa
+Æ,æ,Ǣ,ǣ,Ǽ,ǽ
+B,b
+Æ€
+Ƃ,ƃ
+C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä
+CH,Ch,cH,ch
+Ƈ,ƈ
+D,d,ÄŽ,Ä
+DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
+Ä,Ä‘
+Ɖ
+ÆŠ
+Ƌ,ƌ
+Ã,ð
+E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
+ÆŽ,Ç
+F,f
+Æ‘,Æ’
+G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
+Ǥ,ǥ
+Æ“
+Æ”
+Æ¢,Æ£
+H,h,Ĥ,ĥ
+ƕ,Ƕ
+Ħ,ħ
+I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,Ä°,Ç,Ç
+IJ,Ij,iJ,ij,IJ,ij
+ı
+Æ—
+Æ–
+J,j,Ĵ,ĵ,ǰ
+K,k,Ķ,ķ,Ǩ,ǩ
+Ƙ,ƙ
+L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
+Ä¿,Å€
+LJ,Lj,lJ,lj,LJ,Lj,lj
+LL,Ll,lL,ll
+Å,Å‚
+Æš
+Æ›
+M,m
+N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
+NJ,Nj,nJ,nj,NJ,Nj,nj
+Æž
+ÅŠ,Å‹
+O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
+OE,Oe,oE,oe,Å’,Å“
+Ø,ø,Ǿ,ǿ
+Ɔ
+ÆŸ
+P,p
+Ƥ,ƥ
+Q,q
+ĸ
+R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
+RR,Rr,rR,rr
+Ʀ
+S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿
+SS,Ss,sS,ss,ß
+Æ©
+ƪ
+T,t,Ţ,ţ,Ť,ť
+ƾ
+Ŧ,ŧ
+Æ«
+Ƭ,ƭ
+Æ®
+U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
+Ɯ
+Ʊ
+V,v
+Ʋ
+W,w,Ŵ,ŵ
+X,x
+Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ
+Ƴ,ƴ
+Z,z,Ź,ź,Ż,ż,Ž,ž
+Ƶ,ƶ
+Ʒ,Ǯ,ǯ
+Ƹ,ƹ
+ƺ
+Þ,þ
+Æ¿,Ç·
+Æ»
+Ƨ,ƨ
+Ƽ,ƽ
+Æ„,Æ…
+ʼn
+Ç€
+Ç‚
+ǃ
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_icelandic_ci;
+group_concat(c1 order by c1)
+÷
+×
+A,a,À,Â,Ã,à,â,ã,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
+AA,Aa,aA,aa
+Ã,á
+Ǣ,ǣ,Ǽ,ǽ
+B,b
+Æ€
+Ƃ,ƃ
+C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä
+CH,Ch,cH,ch
+Ƈ,ƈ
+D,d,ÄŽ,Ä
+DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
+Ã,ð
+Ä,Ä‘
+Ɖ
+ÆŠ
+Ƌ,ƌ
+E,e,È,Ê,Ë,è,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
+É,é
+ÆŽ,Ç
+F,f
+Æ‘,Æ’
+G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
+Ǥ,ǥ
+Æ“
+Æ”
+Æ¢,Æ£
+H,h,Ĥ,ĥ
+ƕ,Ƕ
+Ħ,ħ
+I,i,ÃŒ,ÃŽ,Ã,ì,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,Ä°,Ç,Ç
+IJ,Ij,iJ,ij,IJ,ij
+Ã,í
+ı
+Æ—
+Æ–
+J,j,Ĵ,ĵ,ǰ
+K,k,Ķ,ķ,Ǩ,ǩ
+Ƙ,ƙ
+L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
+Ä¿,Å€
+LJ,Lj,lJ,lj,LJ,Lj,lj
+LL,Ll,lL,ll
+Å,Å‚
+Æš
+Æ›
+M,m
+N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
+NJ,Nj,nJ,nj,NJ,Nj,nj
+Æž
+ÅŠ,Å‹
+O,o,Ã’,Ô,Õ,ò,ô,õ,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
+OE,Oe,oE,oe,Å’,Å“
+Ó,ó
+Ǿ,ǿ
+Ɔ
+ÆŸ
+P,p
+Ƥ,ƥ
+Q,q
+ĸ
+R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
+RR,Rr,rR,rr
+Ʀ
+S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿
+SS,Ss,sS,ss,ß
+Æ©
+ƪ
+T,t,Ţ,ţ,Ť,ť
+ƾ
+Ŧ,ŧ
+Æ«
+Ƭ,ƭ
+Æ®
+U,u,Ù,Û,Ü,ù,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
+Ú,ú
+Ɯ
+Ʊ
+V,v
+Ʋ
+W,w,Ŵ,ŵ
+X,x
+Y,y,ÿ,Ŷ,ŷ,Ÿ
+Ã,ý
+Ƴ,ƴ
+Z,z,Ź,ź,Ż,ż,Ž,ž
+Þ,þ
+Ä,Æ,ä,æ
+Ö,Ø,ö,ø
+Ã…,Ã¥
+Ƶ,ƶ
+Ʒ,Ǯ,ǯ
+Ƹ,ƹ
+ƺ
+Æ¿,Ç·
+Æ»
+Ƨ,ƨ
+Ƽ,ƽ
+Æ„,Æ…
+ʼn
+Ç€
+Ç‚
+ǃ
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_latvian_ci;
+group_concat(c1 order by c1)
+÷
+×
+A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
+AA,Aa,aA,aa
+Æ,æ,Ǣ,ǣ,Ǽ,ǽ
+B,b
+Æ€
+Ƃ,ƃ
+C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ
+CH,Ch,cH,ch
+ÄŒ,Ä
+Ƈ,ƈ
+D,d,ÄŽ,Ä
+DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
+Ä,Ä‘
+Ɖ
+ÆŠ
+Ƌ,ƌ
+Ã,ð
+E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
+ÆŽ,Ç
+F,f
+Æ‘,Æ’
+G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ǧ,ǧ,Ç´,ǵ
+Ä¢,Ä£
+Ǥ,ǥ
+Æ“
+Æ”
+Æ¢,Æ£
+H,h,Ĥ,ĥ
+ƕ,Ƕ
+Ħ,ħ
+I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,Ä°,Ç,Ç
+IJ,Ij,iJ,ij,IJ,ij
+Y,y
+ı
+Æ—
+Æ–
+J,j,Ĵ,ĵ,ǰ
+K,k,Ǩ,ǩ
+Ķ,ķ
+Ƙ,ƙ
+L,l,Ĺ,ĺ,Ľ,ľ
+Ä¿,Å€
+LJ,Lj,lJ,lj,LJ,Lj,lj
+LL,Ll,lL,ll
+Ļ,ļ
+Å,Å‚
+Æš
+Æ›
+M,m
+N,n,Ñ,ñ,Ń,ń,Ň,ň,Ǹ,ǹ
+NJ,Nj,nJ,nj,NJ,Nj,nj
+Ņ,ņ
+Æž
+ÅŠ,Å‹
+O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
+OE,Oe,oE,oe,Å’,Å“
+Ø,ø,Ǿ,ǿ
+Ɔ
+ÆŸ
+P,p
+Ƥ,ƥ
+Q,q
+ĸ
+R,r,Ŕ,ŕ,Ř,ř
+RR,Rr,rR,rr
+Å–,Å—
+Ʀ
+S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿
+SS,Ss,sS,ss,ß
+Å ,Å¡
+Æ©
+ƪ
+T,t,Ţ,ţ,Ť,ť
+ƾ
+Ŧ,ŧ
+Æ«
+Ƭ,ƭ
+Æ®
+U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
+Ɯ
+Ʊ
+V,v
+Ʋ
+W,w,Ŵ,ŵ
+X,x
+Ã,ý,ÿ,Ŷ,Å·,Ÿ
+Ƴ,ƴ
+Z,z,Ź,ź,Ż,ż
+Ž,ž
+Ƶ,ƶ
+Ʒ,Ǯ,ǯ
+Ƹ,ƹ
+ƺ
+Þ,þ
+Æ¿,Ç·
+Æ»
+Ƨ,ƨ
+Ƽ,ƽ
+Æ„,Æ…
+ʼn
+Ç€
+Ç‚
+ǃ
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_romanian_ci;
+group_concat(c1 order by c1)
+÷
+×
+A,a,À,Ã,Ã,Ä,Ã…,à,á,ã,ä,Ã¥,Ä€,Ä,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
+AA,Aa,aA,aa
+Ă,ă
+Â,â
+Æ,æ,Ǣ,ǣ,Ǽ,ǽ
+B,b
+Æ€
+Ƃ,ƃ
+C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä
+CH,Ch,cH,ch
+Ƈ,ƈ
+D,d,ÄŽ,Ä
+DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
+Ä,Ä‘
+Ɖ
+ÆŠ
+Ƌ,ƌ
+Ã,ð
+E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
+ÆŽ,Ç
+F,f
+Æ‘,Æ’
+G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
+Ǥ,ǥ
+Æ“
+Æ”
+Æ¢,Æ£
+H,h,Ĥ,ĥ
+ƕ,Ƕ
+Ħ,ħ
+I,i,ÃŒ,Ã,Ã,ì,í,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,Ä°,Ç,Ç
+IJ,Ij,iJ,ij,IJ,ij
+Î,î
+ı
+Æ—
+Æ–
+J,j,Ĵ,ĵ,ǰ
+K,k,Ķ,ķ,Ǩ,ǩ
+Ƙ,ƙ
+L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
+Ä¿,Å€
+LJ,Lj,lJ,lj,LJ,Lj,lj
+LL,Ll,lL,ll
+Å,Å‚
+Æš
+Æ›
+M,m
+N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
+NJ,Nj,nJ,nj,NJ,Nj,nj
+Æž
+ÅŠ,Å‹
+O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
+OE,Oe,oE,oe,Å’,Å“
+Ø,ø,Ǿ,ǿ
+Ɔ
+ÆŸ
+P,p
+Ƥ,ƥ
+Q,q
+ĸ
+R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
+RR,Rr,rR,rr
+Ʀ
+S,s,Åš,Å›,Åœ,Å,Å ,Å¡,Å¿
+SS,Ss,sS,ss,ß
+Åž,ÅŸ
+Æ©
+ƪ
+T,t,Ť,ť
+ƾ
+Å¢,Å£
+Ŧ,ŧ
+Æ«
+Ƭ,ƭ
+Æ®
+U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
+Ɯ
+Ʊ
+V,v
+Ʋ
+W,w,Ŵ,ŵ
+X,x
+Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ
+Ƴ,ƴ
+Z,z,Ź,ź,Ż,ż,Ž,ž
+Ƶ,ƶ
+Ʒ,Ǯ,ǯ
+Ƹ,ƹ
+ƺ
+Þ,þ
+Æ¿,Ç·
+Æ»
+Ƨ,ƨ
+Ƽ,ƽ
+Æ„,Æ…
+ʼn
+Ç€
+Ç‚
+ǃ
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovenian_ci;
+group_concat(c1 order by c1)
+÷
+×
+A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
+AA,Aa,aA,aa
+Æ,æ,Ǣ,ǣ,Ǽ,ǽ
+B,b
+Æ€
+Ƃ,ƃ
+C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ
+CH,Ch,cH,ch
+ÄŒ,Ä
+Ƈ,ƈ
+D,d,ÄŽ,Ä
+DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
+Ä,Ä‘
+Ɖ
+ÆŠ
+Ƌ,ƌ
+Ã,ð
+E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
+ÆŽ,Ç
+F,f
+Æ‘,Æ’
+G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
+Ǥ,ǥ
+Æ“
+Æ”
+Æ¢,Æ£
+H,h,Ĥ,ĥ
+ƕ,Ƕ
+Ħ,ħ
+I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,Ä°,Ç,Ç
+IJ,Ij,iJ,ij,IJ,ij
+ı
+Æ—
+Æ–
+J,j,Ĵ,ĵ,ǰ
+K,k,Ķ,ķ,Ǩ,ǩ
+Ƙ,ƙ
+L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
+Ä¿,Å€
+LJ,Lj,lJ,lj,LJ,Lj,lj
+LL,Ll,lL,ll
+Å,Å‚
+Æš
+Æ›
+M,m
+N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
+NJ,Nj,nJ,nj,NJ,Nj,nj
+Æž
+ÅŠ,Å‹
+O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
+OE,Oe,oE,oe,Å’,Å“
+Ø,ø,Ǿ,ǿ
+Ɔ
+ÆŸ
+P,p
+Ƥ,ƥ
+Q,q
+ĸ
+R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
+RR,Rr,rR,rr
+Ʀ
+S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿
+SS,Ss,sS,ss,ß
+Å ,Å¡
+Æ©
+ƪ
+T,t,Ţ,ţ,Ť,ť
+ƾ
+Ŧ,ŧ
+Æ«
+Ƭ,ƭ
+Æ®
+U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
+Ɯ
+Ʊ
+V,v
+Ʋ
+W,w,Ŵ,ŵ
+X,x
+Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ
+Ƴ,ƴ
+Z,z,Ź,ź,Ż,ż
+Ž,ž
+Ƶ,ƶ
+Ʒ,Ǯ,ǯ
+Ƹ,ƹ
+ƺ
+Þ,þ
+Æ¿,Ç·
+Æ»
+Ƨ,ƨ
+Ƽ,ƽ
+Æ„,Æ…
+ʼn
+Ç€
+Ç‚
+ǃ
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_polish_ci;
+group_concat(c1 order by c1)
+÷
+×
+A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
+AA,Aa,aA,aa
+Ä„,Ä…
+Æ,æ,Ǣ,ǣ,Ǽ,ǽ
+B,b
+Æ€
+Ƃ,ƃ
+C,c,Ç,ç,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä
+CH,Ch,cH,ch
+Ć,ć
+Ƈ,ƈ
+D,d,ÄŽ,Ä
+DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
+Ä,Ä‘
+Ɖ
+ÆŠ
+Ƌ,ƌ
+Ã,ð
+E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ě,ě
+Ę,ę
+ÆŽ,Ç
+F,f
+Æ‘,Æ’
+G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
+Ǥ,ǥ
+Æ“
+Æ”
+Æ¢,Æ£
+H,h,Ĥ,ĥ
+ƕ,Ƕ
+Ħ,ħ
+I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,Ä°,Ç,Ç
+IJ,Ij,iJ,ij,IJ,ij
+ı
+Æ—
+Æ–
+J,j,Ĵ,ĵ,ǰ
+K,k,Ķ,ķ,Ǩ,ǩ
+Ƙ,ƙ
+L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
+Ä¿,Å€
+LJ,Lj,lJ,lj,LJ,Lj,lj
+LL,Ll,lL,ll
+Å,Å‚
+Æš
+Æ›
+M,m
+N,n,Ñ,ñ,Ņ,ņ,Ň,ň,Ǹ,ǹ
+NJ,Nj,nJ,nj,NJ,Nj,nj
+Ń,ń
+Æž
+ÅŠ,Å‹
+O,o,Ã’,Ô,Õ,Ö,ò,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
+OE,Oe,oE,oe,Å’,Å“
+Ó,ó
+Ø,ø,Ǿ,ǿ
+Ɔ
+ÆŸ
+P,p
+Ƥ,ƥ
+Q,q
+ĸ
+R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
+RR,Rr,rR,rr
+Ʀ
+S,s,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿
+SS,Ss,sS,ss,ß
+Åš,Å›
+Æ©
+ƪ
+T,t,Ţ,ţ,Ť,ť
+ƾ
+Ŧ,ŧ
+Æ«
+Ƭ,ƭ
+Æ®
+U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
+Ɯ
+Ʊ
+V,v
+Ʋ
+W,w,Ŵ,ŵ
+X,x
+Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ
+Ƴ,ƴ
+Z,z,Ž,ž
+Ź,ź
+Ż,ż
+Ƶ,ƶ
+Ʒ,Ǯ,ǯ
+Ƹ,ƹ
+ƺ
+Þ,þ
+Æ¿,Ç·
+Æ»
+Ƨ,ƨ
+Ƽ,ƽ
+Æ„,Æ…
+ʼn
+Ç€
+Ç‚
+ǃ
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_estonian_ci;
+group_concat(c1 order by c1)
+÷
+×
+A,a,À,Ã,Â,Ã,Ã…,à,á,â,ã,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
+AA,Aa,aA,aa
+Æ,æ,Ǣ,ǣ,Ǽ,ǽ
+B,b
+Æ€
+Ƃ,ƃ
+C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä
+CH,Ch,cH,ch
+Ƈ,ƈ
+D,d,ÄŽ,Ä
+DZ,Dz,dZ,dz
+DŽ,Dž,dž,DZ,Dz,dz
+Ä,Ä‘
+Ɖ
+ÆŠ
+Ƌ,ƌ
+Ã,ð
+E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
+ÆŽ,Ç
+F,f
+Æ‘,Æ’
+G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
+Ǥ,ǥ
+Æ“
+Æ”
+Æ¢,Æ£
+H,h,Ĥ,ĥ
+ƕ,Ƕ
+Ħ,ħ
+I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,Ä°,Ç,Ç
+IJ,Ij,iJ,ij,IJ,ij
+ı
+Æ—
+Æ–
+J,j,Ĵ,ĵ,ǰ
+K,k,Ķ,ķ,Ǩ,ǩ
+Ƙ,ƙ
+L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
+Ä¿,Å€
+LJ,Lj,lJ,lj,LJ,Lj,lj
+LL,Ll,lL,ll
+Å,Å‚
+Æš
+Æ›
+M,m
+N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
+NJ,Nj,nJ,nj,NJ,Nj,nj
+Æž
+ÅŠ,Å‹
+O,o,Ã’,Ó,Ô,ò,ó,ô,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
+OE,Oe,oE,oe,Å’,Å“
+Ø,ø,Ǿ,ǿ
+Ɔ
+ÆŸ
+P,p
+Ƥ,ƥ
+Q,q
+ĸ
+R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
+RR,Rr,rR,rr
+Ʀ
+S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿
+SS,Ss,sS,ss,ß
+Å ,Å¡
+Z,z
+Ž,ž
+Æ©
+ƪ
+T,t,Ţ,ţ,Ť,ť
+ƾ
+Ŧ,ŧ
+Æ«
+Ƭ,ƭ
+Æ®
+U,u,Ù,Ú,Û,ù,ú,û,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
+Ɯ
+Ʊ
+V,v
+Ʋ
+W,w,Ŵ,ŵ
+Õ,õ
+Ä,ä
+Ö,ö
+Ü,ü
+X,x
+Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ
+Ƴ,ƴ
+Ź,ź,Ż,ż
+Ƶ,ƶ
+Ʒ,Ǯ,ǯ
+Ƹ,ƹ
+ƺ
+Þ,þ
+Æ¿,Ç·
+Æ»
+Ƨ,ƨ
+Ƽ,ƽ
+Æ„,Æ…
+ʼn
+Ç€
+Ç‚
+ǃ
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish_ci;
+group_concat(c1 order by c1)
+÷
+×
+A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
+AA,Aa,aA,aa
+Æ,æ,Ǣ,ǣ,Ǽ,ǽ
+B,b
+Æ€
+Ƃ,ƃ
+C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä
+CH,Ch,cH,ch
+Ƈ,ƈ
+D,d,ÄŽ,Ä
+DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
+Ä,Ä‘
+Ɖ
+ÆŠ
+Ƌ,ƌ
+Ã,ð
+E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
+ÆŽ,Ç
+F,f
+Æ‘,Æ’
+G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
+Ǥ,ǥ
+Æ“
+Æ”
+Æ¢,Æ£
+H,h,Ĥ,ĥ
+ƕ,Ƕ
+Ħ,ħ
+I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,Ä°,Ç,Ç
+IJ,Ij,iJ,ij,IJ,ij
+ı
+Æ—
+Æ–
+J,j,Ĵ,ĵ,ǰ
+K,k,Ķ,ķ,Ǩ,ǩ
+Ƙ,ƙ
+L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
+Ä¿,Å€
+LJ,Lj,lJ,lj,LJ,Lj,lj
+LL,Ll,lL,ll
+Å,Å‚
+Æš
+Æ›
+M,m
+N,n,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
+NJ,Nj,nJ,nj,NJ,Nj,nj
+Ñ,ñ
+Æž
+ÅŠ,Å‹
+O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
+OE,Oe,oE,oe,Å’,Å“
+Ø,ø,Ǿ,ǿ
+Ɔ
+ÆŸ
+P,p
+Ƥ,ƥ
+Q,q
+ĸ
+R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
+RR,Rr,rR,rr
+Ʀ
+S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿
+SS,Ss,sS,ss,ß
+Æ©
+ƪ
+T,t,Ţ,ţ,Ť,ť
+ƾ
+Ŧ,ŧ
+Æ«
+Ƭ,ƭ
+Æ®
+U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
+Ɯ
+Ʊ
+V,v
+Ʋ
+W,w,Ŵ,ŵ
+X,x
+Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ
+Ƴ,ƴ
+Z,z,Ź,ź,Ż,ż,Ž,ž
+Ƶ,ƶ
+Ʒ,Ǯ,ǯ
+Ƹ,ƹ
+ƺ
+Þ,þ
+Æ¿,Ç·
+Æ»
+Ƨ,ƨ
+Ƽ,ƽ
+Æ„,Æ…
+ʼn
+Ç€
+Ç‚
+ǃ
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_swedish_ci;
+group_concat(c1 order by c1)
+÷
+×
+A,a,À,Ã,Â,Ã,à,á,â,ã,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
+AA,Aa,aA,aa
+Ǣ,ǣ,Ǽ,ǽ
+B,b
+Æ€
+Ƃ,ƃ
+C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä
+CH,Ch,cH,ch
+Ƈ,ƈ
+D,d,ÄŽ,Ä
+DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
+Ä,Ä‘
+Ɖ
+ÆŠ
+Ƌ,ƌ
+Ã,ð
+E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
+ÆŽ,Ç
+F,f
+Æ‘,Æ’
+G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
+Ǥ,ǥ
+Æ“
+Æ”
+Æ¢,Æ£
+H,h,Ĥ,ĥ
+ƕ,Ƕ
+Ħ,ħ
+I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,Ä°,Ç,Ç
+IJ,Ij,iJ,ij,IJ,ij
+ı
+Æ—
+Æ–
+J,j,Ĵ,ĵ,ǰ
+K,k,Ķ,ķ,Ǩ,ǩ
+Ƙ,ƙ
+L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
+Ä¿,Å€
+LJ,Lj,lJ,lj,LJ,Lj,lj
+LL,Ll,lL,ll
+Å,Å‚
+Æš
+Æ›
+M,m
+N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
+NJ,Nj,nJ,nj,NJ,Nj,nj
+Æž
+ÅŠ,Å‹
+O,o,Ã’,Ó,Ô,Õ,ò,ó,ô,õ,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
+OE,Oe,oE,oe,Å’,Å“
+Ǿ,ǿ
+Ɔ
+ÆŸ
+P,p
+Ƥ,ƥ
+Q,q
+ĸ
+R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
+RR,Rr,rR,rr
+Ʀ
+S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿
+SS,Ss,sS,ss,ß
+Æ©
+ƪ
+T,t,Ţ,ţ,Ť,ť
+ƾ
+Ŧ,ŧ
+Æ«
+Ƭ,ƭ
+Æ®
+U,u,Ù,Ú,Û,ù,ú,û,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
+Ɯ
+Ʊ
+V,v
+Ʋ
+W,w,Ŵ,ŵ
+X,x
+Y,y,Ãœ,Ã,ü,ý,ÿ,Ŷ,Å·,Ÿ
+Ƴ,ƴ
+Z,z,Ź,ź,Ż,ż,Ž,ž
+Ã…,Ã¥
+Ä,Æ,ä,æ
+Ö,Ø,ö,ø
+Ƶ,ƶ
+Ʒ,Ǯ,ǯ
+Ƹ,ƹ
+ƺ
+Þ,þ
+Æ¿,Ç·
+Æ»
+Ƨ,ƨ
+Ƽ,ƽ
+Æ„,Æ…
+ʼn
+Ç€
+Ç‚
+ǃ
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_turkish_ci;
+group_concat(c1 order by c1)
+÷
+×
+A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
+AA,Aa,aA,aa
+Æ,æ,Ǣ,ǣ,Ǽ,ǽ
+B,b
+Æ€
+Ƃ,ƃ
+C,c,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä
+CH,Ch,cH,ch
+Ç,ç
+Ƈ,ƈ
+D,d,ÄŽ,Ä
+DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
+Ä,Ä‘
+Ɖ
+ÆŠ
+Ƌ,ƌ
+Ã,ð
+E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
+ÆŽ,Ç
+F,f
+Æ‘,Æ’
+G,g,Äœ,Ä,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
+Äž,ÄŸ
+Ǥ,ǥ
+Æ“
+Æ”
+Æ¢,Æ£
+H,h,Ĥ,ĥ
+I,ı
+IJ,Ij
+ƕ,Ƕ
+Ħ,ħ
+i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,Ä°,Ç,Ç
+iJ,ij,IJ,ij
+Æ—
+Æ–
+J,j,Ĵ,ĵ,ǰ
+K,k,Ķ,ķ,Ǩ,ǩ
+Ƙ,ƙ
+L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
+Ä¿,Å€
+LJ,Lj,lJ,lj,LJ,Lj,lj
+LL,Ll,lL,ll
+Å,Å‚
+Æš
+Æ›
+M,m
+N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
+NJ,Nj,nJ,nj,NJ,Nj,nj
+Æž
+ÅŠ,Å‹
+O,o,Ã’,Ó,Ô,Õ,ò,ó,ô,õ,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
+OE,Oe,oE,oe,Å’,Å“
+Ö,ö
+Ø,ø,Ǿ,ǿ
+Ɔ
+ÆŸ
+P,p
+Ƥ,ƥ
+Q,q
+ĸ
+R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
+RR,Rr,rR,rr
+Ʀ
+S,s,Åš,Å›,Åœ,Å,Å ,Å¡,Å¿
+SS,Ss,sS,ss,ß
+Åž,ÅŸ
+Æ©
+ƪ
+T,t,Ţ,ţ,Ť,ť
+ƾ
+Ŧ,ŧ
+Æ«
+Ƭ,ƭ
+Æ®
+U,u,Ù,Ú,Û,ù,ú,û,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
+Ü,ü
+Ɯ
+Ʊ
+V,v
+Ʋ
+W,w,Ŵ,ŵ
+X,x
+Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ
+Ƴ,ƴ
+Z,z,Ź,ź,Ż,ż,Ž,ž
+Ƶ,ƶ
+Ʒ,Ǯ,ǯ
+Ƹ,ƹ
+ƺ
+Þ,þ
+Æ¿,Ç·
+Æ»
+Ƨ,ƨ
+Ƽ,ƽ
+Æ„,Æ…
+ʼn
+Ç€
+Ç‚
+ǃ
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_czech_ci;
+group_concat(c1 order by c1)
+÷
+×
+A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
+AA,Aa,aA,aa
+Æ,æ,Ǣ,ǣ,Ǽ,ǽ
+B,b
+Æ€
+Ƃ,ƃ
+C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ
+cH
+ÄŒ,Ä
+Ƈ,ƈ
+D,d,ÄŽ,Ä
+DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
+Ä,Ä‘
+Ɖ
+ÆŠ
+Ƌ,ƌ
+Ã,ð
+E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
+ÆŽ,Ç
+F,f
+Æ‘,Æ’
+G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
+Ǥ,ǥ
+Æ“
+Æ”
+Æ¢,Æ£
+H,h,Ĥ,ĥ
+CH,Ch,ch
+ƕ,Ƕ
+Ħ,ħ
+I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,Ä°,Ç,Ç
+IJ,Ij,iJ,ij,IJ,ij
+ı
+Æ—
+Æ–
+J,j,Ĵ,ĵ,ǰ
+K,k,Ķ,ķ,Ǩ,ǩ
+Ƙ,ƙ
+L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
+Ä¿,Å€
+LJ,Lj,lJ,lj,LJ,Lj,lj
+LL,Ll,lL,ll
+Å,Å‚
+Æš
+Æ›
+M,m
+N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
+NJ,Nj,nJ,nj,NJ,Nj,nj
+Æž
+ÅŠ,Å‹
+O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
+OE,Oe,oE,oe,Å’,Å“
+Ø,ø,Ǿ,ǿ
+Ɔ
+ÆŸ
+P,p
+Ƥ,ƥ
+Q,q
+ĸ
+R,r,Å”,Å•,Å–,Å—
+RR,Rr,rR,rr
+Ř,ř
+Ʀ
+S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿
+SS,Ss,sS,ss,ß
+Å ,Å¡
+Æ©
+ƪ
+T,t,Ţ,ţ,Ť,ť
+ƾ
+Ŧ,ŧ
+Æ«
+Ƭ,ƭ
+Æ®
+U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
+Ɯ
+Ʊ
+V,v
+Ʋ
+W,w,Ŵ,ŵ
+X,x
+Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ
+Ƴ,ƴ
+Z,z,Ź,ź,Ż,ż
+Ž,ž
+Ƶ,ƶ
+Ʒ,Ǯ,ǯ
+Ƹ,ƹ
+ƺ
+Þ,þ
+Æ¿,Ç·
+Æ»
+Ƨ,ƨ
+Ƽ,ƽ
+Æ„,Æ…
+ʼn
+Ç€
+Ç‚
+ǃ
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_danish_ci;
+group_concat(c1 order by c1)
+÷
+×
+A,a,À,Ã,Â,Ã,à,á,â,ã,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
+aA
+Ǣ,ǣ,Ǽ,ǽ
+B,b
+Æ€
+Ƃ,ƃ
+C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä
+CH,Ch,cH,ch
+Ƈ,ƈ
+D,d,ÄŽ,Ä
+DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
+Ä,Ä‘
+Ɖ
+ÆŠ
+Ƌ,ƌ
+Ã,ð
+E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
+ÆŽ,Ç
+F,f
+Æ‘,Æ’
+G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
+Ǥ,ǥ
+Æ“
+Æ”
+Æ¢,Æ£
+H,h,Ĥ,ĥ
+ƕ,Ƕ
+Ħ,ħ
+I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,Ä°,Ç,Ç
+IJ,Ij,iJ,ij,IJ,ij
+ı
+Æ—
+Æ–
+J,j,Ĵ,ĵ,ǰ
+K,k,Ķ,ķ,Ǩ,ǩ
+Ƙ,ƙ
+L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
+Ä¿,Å€
+LJ,Lj,lJ,lj,LJ,Lj,lj
+LL,Ll,lL,ll
+Å,Å‚
+Æš
+Æ›
+M,m
+N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
+NJ,Nj,nJ,nj,NJ,Nj,nj
+Æž
+ÅŠ,Å‹
+O,o,Ã’,Ó,Ô,Õ,ò,ó,ô,õ,ÅŒ,Å,ÅŽ,Å,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
+OE,Oe,oE,oe,Å’,Å“
+Ǿ,ǿ
+Ɔ
+ÆŸ
+P,p
+Ƥ,ƥ
+Q,q
+ĸ
+R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
+RR,Rr,rR,rr
+Ʀ
+S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿
+SS,Ss,sS,ss,ß
+Æ©
+ƪ
+T,t,Ţ,ţ,Ť,ť
+ƾ
+Ŧ,ŧ
+Æ«
+Ƭ,ƭ
+Æ®
+U,u,Ù,Ú,Û,ù,ú,û,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
+Ɯ
+Ʊ
+V,v
+Ʋ
+W,w,Ŵ,ŵ
+X,x
+Y,y,Ãœ,Ã,ü,ý,ÿ,Å°,ű,Ŷ,Å·,Ÿ
+Ƴ,ƴ
+Z,z,Ź,ź,Ż,ż,Ž,ž
+Ä,Æ,ä,æ
+Ö,Ø,ö,ø,Å,Å‘
+AA,Aa,aa,Ã…,Ã¥
+Ƶ,ƶ
+Ʒ,Ǯ,ǯ
+Ƹ,ƹ
+ƺ
+Þ,þ
+Æ¿,Ç·
+Æ»
+Ƨ,ƨ
+Ƽ,ƽ
+Æ„,Æ…
+ʼn
+Ç€
+Ç‚
+ǃ
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_lithuanian_ci;
+group_concat(c1 order by c1)
+÷
+×
+A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
+AA,Aa,aA,aa
+Æ,æ,Ǣ,ǣ,Ǽ,ǽ
+B,b
+Æ€
+Ƃ,ƃ
+C,CH,Ch,c,ch,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ
+cH
+ÄŒ,Ä
+Ƈ,ƈ
+D,d,ÄŽ,Ä
+DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
+Ä,Ä‘
+Ɖ
+ÆŠ
+Ƌ,ƌ
+Ã,ð
+E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
+ÆŽ,Ç
+F,f
+Æ‘,Æ’
+G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
+Ǥ,ǥ
+Æ“
+Æ”
+Æ¢,Æ£
+H,h,Ĥ,ĥ
+ƕ,Ƕ
+Ħ,ħ
+I,Y,i,y,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,Ä°,Ç,Ç
+IJ,Ij,iJ,ij,IJ,ij
+ı
+Æ—
+Æ–
+J,j,Ĵ,ĵ,ǰ
+K,k,Ķ,ķ,Ǩ,ǩ
+Ƙ,ƙ
+L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
+Ä¿,Å€
+LJ,Lj,lJ,lj,LJ,Lj,lj
+LL,Ll,lL,ll
+Å,Å‚
+Æš
+Æ›
+M,m
+N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
+NJ,Nj,nJ,nj,NJ,Nj,nj
+Æž
+ÅŠ,Å‹
+O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
+OE,Oe,oE,oe,Å’,Å“
+Ø,ø,Ǿ,ǿ
+Ɔ
+ÆŸ
+P,p
+Ƥ,ƥ
+Q,q
+ĸ
+R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
+RR,Rr,rR,rr
+Ʀ
+S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿
+SS,Ss,sS,ss,ß
+Å ,Å¡
+Æ©
+ƪ
+T,t,Ţ,ţ,Ť,ť
+ƾ
+Ŧ,ŧ
+Æ«
+Ƭ,ƭ
+Æ®
+U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
+Ɯ
+Ʊ
+V,v
+Ʋ
+W,w,Ŵ,ŵ
+X,x
+Ã,ý,ÿ,Ŷ,Å·,Ÿ
+Ƴ,ƴ
+Z,z,Ź,ź,Ż,ż
+Ž,ž
+Ƶ,ƶ
+Ʒ,Ǯ,ǯ
+Ƹ,ƹ
+ƺ
+Þ,þ
+Æ¿,Ç·
+Æ»
+Ƨ,ƨ
+Ƽ,ƽ
+Æ„,Æ…
+ʼn
+Ç€
+Ç‚
+ǃ
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci;
+group_concat(c1 order by c1)
+÷
+×
+A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
+AA,Aa,aA,aa
+Æ,æ,Ǣ,ǣ,Ǽ,ǽ
+B,b
+Æ€
+Ƃ,ƃ
+C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä
+cH
+CH,Ch,ch
+Ƈ,ƈ
+D,d,ÄŽ,Ä
+DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
+Ä,Ä‘
+Ɖ
+ÆŠ
+Ƌ,ƌ
+Ã,ð
+E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
+ÆŽ,Ç
+F,f
+Æ‘,Æ’
+G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
+Ǥ,ǥ
+Æ“
+Æ”
+Æ¢,Æ£
+H,h,Ĥ,ĥ
+ƕ,Ƕ
+Ħ,ħ
+I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,Ä°,Ç,Ç
+IJ,Ij,iJ,ij,IJ,ij
+ı
+Æ—
+Æ–
+J,j,Ĵ,ĵ,ǰ
+K,k,Ķ,ķ,Ǩ,ǩ
+Ƙ,ƙ
+L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
+Ä¿,Å€
+LJ,Lj,lJ,lj,LJ,Lj,lj
+lL
+LL,Ll,ll
+Å,Å‚
+Æš
+Æ›
+M,m
+N,n,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
+NJ,Nj,nJ,nj,NJ,Nj,nj
+Ñ,ñ
+Æž
+ÅŠ,Å‹
+O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
+OE,Oe,oE,oe,Å’,Å“
+Ø,ø,Ǿ,ǿ
+Ɔ
+ÆŸ
+P,p
+Ƥ,ƥ
+Q,q
+ĸ
+R,RR,Rr,r,rr,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
+rR
+Ʀ
+S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿
+SS,Ss,sS,ss,ß
+Æ©
+ƪ
+T,t,Ţ,ţ,Ť,ť
+ƾ
+Ŧ,ŧ
+Æ«
+Ƭ,ƭ
+Æ®
+U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
+Ɯ
+Ʊ
+V,v
+Ʋ
+W,w,Ŵ,ŵ
+X,x
+Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ
+Ƴ,ƴ
+Z,z,Ź,ź,Ż,ż,Ž,ž
+Ƶ,ƶ
+Ʒ,Ǯ,ǯ
+Ƹ,ƹ
+ƺ
+Þ,þ
+Æ¿,Ç·
+Æ»
+Ƨ,ƨ
+Ƽ,ƽ
+Æ„,Æ…
+ʼn
+Ç€
+Ç‚
+ǃ
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_roman_ci;
+group_concat(c1 order by c1)
+÷
+×
+A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç»
+AA,Aa,aA,aa
+Æ,æ,Ǣ,ǣ,Ǽ,ǽ
+B,b
+Æ€
+Ƃ,ƃ
+C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä
+CH,Ch,cH,ch
+Ƈ,ƈ
+D,d,ÄŽ,Ä
+DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
+Ä,Ä‘
+Ɖ
+ÆŠ
+Ƌ,ƌ
+Ã,ð
+E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
+ÆŽ,Ç
+F,f
+Æ‘,Æ’
+G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ
+Ǥ,ǥ
+Æ“
+Æ”
+Æ¢,Æ£
+H,h,Ĥ,ĥ
+ƕ,Ƕ
+Ħ,ħ
+I,J,i,j,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,Ä°,Ç,Ç
+IJ,Ij,iJ,ij
+IJ,ij
+ı
+Æ—
+Æ–
+Ĵ,ĵ,ǰ
+K,k,Ķ,ķ,Ǩ,ǩ
+Ƙ,ƙ
+L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
+Ä¿,Å€
+LJ,Lj,lJ,lj
+LJ,Lj,lj
+LL,Ll,lL,ll
+Å,Å‚
+Æš
+Æ›
+M,m
+N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
+NJ,Nj,nJ,nj
+NJ,Nj,nj
+Æž
+ÅŠ,Å‹
+O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­
+OE,Oe,oE,oe,Å’,Å“
+Ø,ø,Ǿ,ǿ
+Ɔ
+ÆŸ
+P,p
+Ƥ,ƥ
+Q,q
+ĸ
+R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
+RR,Rr,rR,rr
+Ʀ
+S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿
+SS,Ss,sS,ss,ß
+Æ©
+ƪ
+T,t,Ţ,ţ,Ť,ť
+ƾ
+Ŧ,ŧ
+Æ«
+Ƭ,ƭ
+Æ®
+Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
+Ɯ
+Ʊ
+U,V,u,v
+Ʋ
+W,w,Ŵ,ŵ
+X,x
+Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ
+Ƴ,ƴ
+Z,z,Ź,ź,Ż,ż,Ž,ž
+Ƶ,ƶ
+Ʒ,Ǯ,ǯ
+Ƹ,ƹ
+ƺ
+Þ,þ
+Æ¿,Ç·
+Æ»
+Ƨ,ƨ
+Ƽ,ƽ
+Æ„,Æ…
+ʼn
+Ç€
+Ç‚
+ǃ
diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result
index 9b955667e69..4ab8cc83d0c 100644
--- a/mysql-test/r/ctype_ucs.result
+++ b/mysql-test/r/ctype_ucs.result
@@ -47,6 +47,15 @@ t1 CREATE TABLE `t1` (
`r` char(10) character set ucs2 NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
+create table t2(f1 Char(30));
+insert into t2 values ("103000"), ("22720000"), ("3401200"), ("78000");
+select lpad(f1, 12, "-o-/") from t2;
+lpad(f1, 12, "-o-/")
+-o-/-o103000
+-o-/22720000
+-o-/-3401200
+-o-/-o-78000
+drop table t2;
SET NAMES koi8r;
SET character_set_connection=ucs2;
create table t1 (a varchar(10) character set ucs2, key(a));
diff --git a/mysql-test/r/ctype_ujis.result b/mysql-test/r/ctype_ujis.result
index cc062094535..7c3ae52cbc9 100644
--- a/mysql-test/r/ctype_ujis.result
+++ b/mysql-test/r/ctype_ujis.result
@@ -111,3 +111,18 @@ no index
¤¢
¤¢
drop table t1;
+CREATE TABLE t1 (
+a char(1) NOT NULL default '',
+b enum('¤¢','¤¤') default NULL
+) CHARACTER SET ujis;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(1) NOT NULL default '',
+ `b` enum('¤¢','¤¤') default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=ujis
+SHOW COLUMNS FROM t1;
+Field Type Null Key Default Extra
+a char(1)
+b enum('¤¢','¤¤') YES NULL
+DROP TABLE t1;
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 28af71b7681..6c11dd210aa 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -218,3 +218,25 @@ b
select * from t1 where a = 'b' and a != 'b';
a
drop table t1;
+set names utf8;
+select 'ваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]';
+'ваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]'
+1
+select 'ваÑÑ ' rlike '[[:<:]]ваÑÑ[[:>:]]';
+'ваÑÑ ' rlike '[[:<:]]ваÑÑ[[:>:]]'
+1
+select ' ваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]';
+' ваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]'
+1
+select ' ваÑÑ ' rlike '[[:<:]]ваÑÑ[[:>:]]';
+' ваÑÑ ' rlike '[[:<:]]ваÑÑ[[:>:]]'
+1
+select 'ваÑÑz' rlike '[[:<:]]ваÑÑ[[:>:]]';
+'ваÑÑz' rlike '[[:<:]]ваÑÑ[[:>:]]'
+0
+select 'zваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]';
+'zваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]'
+0
+select 'zваÑÑz' rlike '[[:<:]]ваÑÑ[[:>:]]';
+'zваÑÑz' rlike '[[:<:]]ваÑÑ[[:>:]]'
+0
diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result
index b73953823ca..6a4935ef3f8 100644
--- a/mysql-test/r/date_formats.result
+++ b/mysql-test/r/date_formats.result
@@ -303,14 +303,14 @@ date format str_to_date
2003-01-02 10:11:12 %Y-%m-%d %h:%i:%S 2003-01-02 10:11:12
03-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 0003-01-02 22:11:12
Warnings:
-Note 1292 Truncated wrong string value: '10:20:10AM'
+Warning 1292 Truncated incorrect datetime value: '10:20:10AM'
select date,format,concat(str_to_date(date, format),'') as con from t1;
date format con
10:20:10AM %h:%i:%s 0000-00-00 10:20:10
2003-01-02 10:11:12 %Y-%m-%d %h:%i:%S 2003-01-02 10:11:12
03-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 0003-01-02 22:11:12
Warnings:
-Note 1292 Truncated wrong string value: '10:20:10AM'
+Warning 1292 Truncated incorrect datetime value: '10:20:10AM'
drop table t1;
select get_format(DATE, 'USA') as a;
a
@@ -374,7 +374,7 @@ str_to_date("02 10", "%d %f") as f6;
f1 f2 f3 f4 f5 f6
2003-01-02 10:11:12.001200 2003-01-02 10:11:12 2003-01-02 58:11:12 58:11:12 48:00:00.100000
Warnings:
-Note 1292 Truncated wrong datetime value: '2003-01-02 10:11:12.0012'
+Warning 1292 Truncated incorrect datetime value: '2003-01-02 10:11:12.0012'
drop table t1, t2;
select str_to_date("2003-01-02 10:11:12.0012ABCD", "%Y-%m-%d %H:%i:%S.%f") as f1,
addtime("-01:01:01.01 GGG", "-23:59:59.1") as f2,
@@ -382,13 +382,13 @@ microsecond("1997-12-31 23:59:59.01XXXX") as f3;
f1 f2 f3
2003-01-02 10:11:12.001200 -25:01:00.110000 10000
Warnings:
-Note 1292 Truncated wrong datetime value: '2003-01-02 10:11:12.0012ABCD'
-Note 1292 Truncated wrong time value: '-01:01:01.01 GG'
-Note 1292 Truncated wrong datetime value: '1997-12-31 23:59:59.01XXXX'
+Warning 1292 Truncated incorrect datetime value: '2003-01-02 10:11:12.0012ABCD'
+Warning 1292 Truncated incorrect time value: '-01:01:01.01 GGG'
+Warning 1292 Truncated incorrect time value: '1997-12-31 23:59:59.01XXXX'
select str_to_date("2003-04-05 g", "%Y-%m-%d") as f1,
str_to_date("2003-04-05 10:11:12.101010234567", "%Y-%m-%d %H:%i:%S.%f") as f2;
f1 f2
2003-04-05 2003-04-05 10:11:12.101010
Warnings:
-Note 1292 Truncated wrong date value: '2003-04-05 g'
-Note 1292 Truncated wrong datetime value: '2003-04-05 10:11:12.101010234567'
+Warning 1292 Truncated incorrect date value: '2003-04-05 g'
+Warning 1292 Truncated incorrect datetime value: '2003-04-05 10:11:12.101010234567'
diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result
index f1acc5d2dfa..c6b7a40214d 100644
--- a/mysql-test/r/delete.result
+++ b/mysql-test/r/delete.result
@@ -120,3 +120,13 @@ a b
0 10
1 11
drop table t11, t12, t2;
+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;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+select * from t1;
+a b
+7 7
+drop table t1;
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index c374a334d3d..ddd8f82de2c 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -27,7 +27,7 @@ a y
SELECT a FROM (SELECT 1 FROM (SELECT 1) a HAVING a=1) b;
ERROR 42S22: Unknown column 'a' in 'having clause'
SELECT a,b as a FROM (SELECT '1' as a,'2' as b) b HAVING a=1;
-ERROR 23000: Column: 'a' in having clause is ambiguous
+ERROR 23000: Column 'a' in having clause is ambiguous
SELECT a,2 as a FROM (SELECT '1' as a) b HAVING a=2;
a a
1 2
@@ -204,22 +204,22 @@ x
1
create table t1 select 1 as a;
select 2 as a from (select * from t1) b;
-ERROR 3D000: No Database Selected
+ERROR 3D000: No database selected
use test;
select 2 as a from (select * from t1) b;
a
2
drop table t1;
select mail_id, if(folder.f_description!='', folder.f_description, folder.f_name) as folder_name, date, address_id, phrase, address, subject from folder, (select mail.mail_id as mail_id, date_format(mail.h_date, '%b %e, %Y %h:%i') as date, mail.folder_id, sender.address_id as address_id, sender.phrase as phrase, sender.address as address, mail.h_subject as subject from mail left join mxa as mxa_sender on mail.mail_id=mxa_sender.mail_id and mxa_sender.type='from' left join address as sender on mxa_sender.address_id=sender.address_id mxa as mxa_recipient, address as recipient, where 1 and mail.mail_id=mxa_recipient.mail_id and mxa_recipient.address_id=recipient.address_id and mxa_recipient.type='to' and match(sender.phrase, sender.address, sender.comment) against ('jeremy' in boolean mode) and match(recipient.phrase, recipient.address, recipient.comment) against ('monty' in boolean mode) order by mail.h_date desc limit 0, 25 ) as query where query.folder_id=folder.folder_id;
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'mxa as mxa_recipient, address as recipient, where 1 and mail.mail_id=mxa_r' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mxa as mxa_recipient, address as recipient, where 1 and mail.mail_id=mxa_r' at line 1
create table t1 (a int);
insert into t1 values (1),(2),(3);
update (select * from t1) as t1 set a = 5;
ERROR HY000: The target table t1 of the UPDATE is not updatable
delete from (select * from t1);
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(select * from t1)' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(select * from t1)' at line 1
insert into (select * from t1) values (5);
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(select * from t1) values (5)' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(select * from t1) values (5)' at line 1
drop table t1;
create table t1 (E1 INTEGER UNSIGNED NOT NULL, E2 INTEGER UNSIGNED NOT NULL, E3 INTEGER UNSIGNED NOT NULL, PRIMARY KEY(E1)
);
diff --git a/mysql-test/r/flush_table.result b/mysql-test/r/flush_table.result
new file mode 100644
index 00000000000..257f69fa6d9
--- /dev/null
+++ b/mysql-test/r/flush_table.result
@@ -0,0 +1,66 @@
+drop table if exists t1,t2;
+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;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
+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;
+table_id
+test.t1
+
+handler a2 read first limit 9;
+table_id
+test.t1
+
+handler t2 read first limit 9;
+table_id
+test.t2
+
+flush tables;
+handler a1 read first limit 9;
+ERROR 42S02: Unknown table 'a1' in HANDLER
+handler a2 read first limit 9;
+ERROR 42S02: Unknown table 'a2' in HANDLER
+handler t2 read first limit 9;
+ERROR 42S02: Unknown table 't2' in HANDLER
+handler t1 open as a1;
+handler t1 open as a2;
+handler t2 open;
+handler a1 read first limit 9;
+table_id
+test.t1
+
+handler a2 read first limit 9;
+table_id
+test.t1
+
+handler t2 read first limit 9;
+table_id
+test.t2
+
+flush table t1;
+handler a1 read first limit 9;
+ERROR 42S02: Unknown table 'a1' in HANDLER
+handler a2 read first limit 9;
+ERROR 42S02: Unknown table 'a2' in HANDLER
+handler t2 read first limit 9;
+table_id
+test.t2
+
+flush table t2;
+handler t2 close;
+ERROR 42S02: Unknown table 't2' in HANDLER
+drop table t1;
+drop table t2;
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index 3106602e718..30c4c75f3d1 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -7,8 +7,8 @@ INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'),
('Full-text search in MySQL', 'implements vector space model');
SHOW INDEX FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 a 1 a A NULL NULL NULL YES FULLTEXT
-t1 1 a 2 b A NULL NULL NULL YES FULLTEXT
+t1 1 a 1 a NULL NULL NULL NULL YES FULLTEXT
+t1 1 a 2 b NULL NULL NULL NULL YES FULLTEXT
select * from t1 where MATCH(a,b) AGAINST ("collections");
a b
Only MyISAM tables support collections
@@ -223,7 +223,7 @@ id
show keys from t2;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t2 1 tig 1 ticket A NULL NULL NULL YES BTREE
-t2 1 tix 1 inhalt A NULL NULL NULL YES FULLTEXT
+t2 1 tix 1 inhalt NULL NULL NULL NULL YES FULLTEXT
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -253,11 +253,11 @@ KEY tig (ticket),
fulltext index tix (inhalt)
);
select * from t2 where MATCH inhalt AGAINST (t2.inhalt);
-ERROR HY000: Wrong arguments to AGAINST
+ERROR HY000: Incorrect arguments to AGAINST
select * from t2 where MATCH ticket AGAINST ('foobar');
ERROR HY000: Can't find FULLTEXT index matching the column list
select * from t2,t3 where MATCH (t2.inhalt,t3.inhalt) AGAINST ('foobar');
-ERROR HY000: Wrong arguments to MATCH
+ERROR HY000: Incorrect arguments to MATCH
drop table t1,t2,t3;
CREATE TABLE t1 (
id int(11) auto_increment,
@@ -363,3 +363,14 @@ SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck');
t collation(t)
aus Osnabrück latin1_german2_ci
DROP TABLE t1;
+CREATE TABLE t1 (s varchar(255), FULLTEXT (s)) DEFAULT CHARSET=utf8;
+insert into t1 (s) values ('pära para para'),('para para para');
+select * from t1 where match(s) against('para' in boolean mode);
+s
+pära para para
+para para para
+select * from t1 where match(s) against('par*' in boolean mode);
+s
+pära para para
+para para para
+DROP TABLE t1;
diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result
index ef03ec71c69..a3d28471993 100644
--- a/mysql-test/r/func_compress.result
+++ b/mysql-test/r/func_compress.result
@@ -66,5 +66,5 @@ NULL
NULL
Warnings:
Error 1259 ZLIB: Input data corrupted
-Error 1256 Too big size of uncompressed data. The maximum size is 1048576. (probably, length of uncompressed data was corrupted)
+Error 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted)
drop table t1;
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 60a28e5018f..0c8054c1f03 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -149,19 +149,19 @@ grp group_concat(c order by c)
3 D,D,E
4
5 NULL
-set group_concat_max_len = 5;
+set group_concat_max_len = 4;
select grp,group_concat(c) from t1 group by grp;
grp group_concat(c)
1 NULL
2 b
-3 D,D,E
+3 D,D,
4
5 NULL
Warnings:
-Warning 1260 1 line(s) was(were) cut by group_concat()
+Warning 1260 1 line(s) were cut by GROUP_CONCAT()
show warnings;
Level Code Message
-Warning 1260 1 line(s) was(were) cut by group_concat()
+Warning 1260 1 line(s) were cut by GROUP_CONCAT()
set group_concat_max_len = 1024;
select group_concat(sum(a)) from t1 group by grp;
ERROR HY000: Invalid use of group function
@@ -172,7 +172,7 @@ create table t1 ( URL_ID int(11), URL varchar(80));
create table t2 ( REQ_ID int(11), URL_ID int(11));
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);
-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;
REQ_ID URL
1 X
@@ -310,3 +310,14 @@ GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a)
1,2
2,4
DROP TABLE t1, t2;
+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%';
+names
+John||Anna||Bill
+SELECT GROUP_CONCAT(a SEPARATOR '###') AS names FROM t1
+HAVING LEFT(names, 1) ='J';
+names
+John###Anna###Bill
+DROP TABLE t1;
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index 453110dc305..fd7d0bdae39 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -321,6 +321,7 @@ insert into t2 values('DEN','Denver','CO','BDL');
insert into t2 values('SDC','San Diego','CA','TWU');
insert into t2 values('NOL','New Orleans','LA','GTM');
insert into t2 values('LAK','Los Angeles','CA','TWU');
+insert into t2 values('AAA','AAA','AA','AME');
select * from t1;
a1 a2 a3 a4 a5
AME 0 SEA 0.1 1942-02-19
@@ -345,6 +346,7 @@ DEN Denver CO BDL
SDC San Diego CA TWU
NOL New Orleans LA GTM
LAK Los Angeles CA TWU
+AAA AAA AA AME
explain
select min(a1) from t1;
id select_type table type possible_keys key key_len ref rows Extra
@@ -656,3 +658,31 @@ select stddev(2) from t1;
stddev(2)
NULL
drop table t1;
+create table t1 (a int);
+insert into t1 values (1),(2);
+prepare stmt1 from 'SELECT COUNT(*) FROM t1';
+execute stmt1;
+COUNT(*)
+2
+execute stmt1;
+COUNT(*)
+2
+execute stmt1;
+COUNT(*)
+2
+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;
+max(a)
+2
+execute stmt1;
+max(a)
+2
+execute stmt1;
+max(a)
+2
+deallocate prepare stmt1;
+drop table t1;
diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result
index ce26a0bf30a..4c8a0561b0a 100644
--- a/mysql-test/r/func_if.result
+++ b/mysql-test/r/func_if.result
@@ -77,3 +77,9 @@ select min(if(y -x > 5,y,NULL)), max(if(y - x > 5,y,NULL)) from t1;
min(if(y -x > 5,y,NULL)) max(if(y - x > 5,y,NULL))
6 56
drop table t1;
+create table t1 (a int);
+insert t1 values (1),(2);
+select if(1>2,a,avg(a)) from t1;
+if(1>2,a,avg(a))
+1.5000
+drop table t1;
diff --git a/mysql-test/r/func_like.result b/mysql-test/r/func_like.result
index d4819cbe949..e32a4dcd85a 100644
--- a/mysql-test/r/func_like.result
+++ b/mysql-test/r/func_like.result
@@ -45,6 +45,12 @@ a\b
select * from t1 where a like 'a\\%' escape '#' and a like 'a\\\\b';
a
a\b
+prepare stmt1 from 'select * from t1 where a like \'a\\%\' escape ?';
+set @esc='#';
+execute stmt1 using @esc;
+a
+a\b
+deallocate prepare stmt1;
drop table t1;
create table t1 (a datetime);
insert into t1 values ('2004-03-11 12:00:21');
diff --git a/mysql-test/r/func_regexp.result b/mysql-test/r/func_regexp.result
index 7f977e2782b..8228d6982d3 100644
--- a/mysql-test/r/func_regexp.result
+++ b/mysql-test/r/func_regexp.result
@@ -81,3 +81,20 @@ _latin1'a' regexp _latin1'A' collate latin1_general_ci
select _latin1'a' regexp _latin1'A' collate latin1_bin;
_latin1'a' regexp _latin1'A' collate latin1_bin
0
+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;
+a
+C1
+C2
+C3
+set @a="^R.*";
+execute stmt1 using @a;
+a
+R1
+R2
+R3
+deallocate prepare stmt1;
+drop table t1;
diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result
index 3ea4e7f678d..26fd688c312 100644
--- a/mysql-test/r/func_sapdb.result
+++ b/mysql-test/r/func_sapdb.result
@@ -119,6 +119,8 @@ timestamp("2001-12-01", "01:01:01.999999")
select timestamp("2001-13-01", "01:01:01.000001");
timestamp("2001-13-01", "01:01:01.000001")
NULL
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '2001-13-01'
select timestamp("2001-12-01", "25:01:01");
timestamp("2001-12-01", "25:01:01")
2001-12-02 01:01:01
@@ -137,12 +139,16 @@ date("1997-12-31 23:59:59.000001")
select date("1997-13-31 23:59:59.000001");
date("1997-13-31 23:59:59.000001")
NULL
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '1997-13-31 23:59:59.000001'
select time("1997-12-31 23:59:59.000001");
time("1997-12-31 23:59:59.000001")
23:59:59.000001
select time("1997-12-31 25:59:59.000001");
time("1997-12-31 25:59:59.000001")
NULL
+Warnings:
+Warning 1292 Truncated incorrect time value: '1997-12-31 25:59:59.000001'
select microsecond("1997-12-31 23:59:59.000001");
microsecond("1997-12-31 23:59:59.000001")
1
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 569b4da0f85..1baf9d8e01c 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -192,9 +192,9 @@ length(quote(concat(char(0),"test")))
select hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235))));
hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235))))
27E0E3E6E7E8EAEB27
-select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678");
-unhex(hex("foobar")) hex(unhex("1234567890ABCDEF")) unhex("345678")
-foobar 1234567890ABCDEF 4Vx
+select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678"), unhex(NULL);
+unhex(hex("foobar")) hex(unhex("1234567890ABCDEF")) unhex("345678") unhex(NULL)
+foobar 1234567890ABCDEF 4Vx NULL
select hex(unhex("1")), hex(unhex("12")), hex(unhex("123")), hex(unhex("1234")), hex(unhex("12345")), hex(unhex("123456"));
hex(unhex("1")) hex(unhex("12")) hex(unhex("123")) hex(unhex("1234")) hex(unhex("12345")) hex(unhex("123456"))
01 12 0123 1234 012345 123456
@@ -528,6 +528,9 @@ latin2_general_ci 3
select collation(replace(_latin2'abcd',_latin2'b',_latin2'B')), coercibility(replace(_latin2'abcd',_latin2'b',_latin2'B'));
collation(replace(_latin2'abcd',_latin2'b',_latin2'B')) coercibility(replace(_latin2'abcd',_latin2'b',_latin2'B'))
latin2_general_ci 3
+select collation(encode('abcd','ab')), coercibility(encode('abcd','ab'));
+collation(encode('abcd','ab')) coercibility(encode('abcd','ab'))
+binary 3
create table t1
select
bin(130),
@@ -559,7 +562,8 @@ quote(_latin2'ab'),
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')
;
Warnings:
Warning 1265 Data truncated for column 'format(130,10)' at row 1
@@ -595,7 +599,8 @@ t1 CREATE TABLE `t1` (
`soundex(_latin2'ab')` char(4) character set latin2 NOT NULL default '',
`substring(_latin2'ab',1)` char(2) character set latin2 NOT NULL default '',
`insert(_latin2'abcd',2,3,_latin2'ef')` char(6) character set latin2 NOT NULL default '',
- `replace(_latin2'abcd',_latin2'b',_latin2'B')` char(4) character set latin2 NOT NULL default ''
+ `replace(_latin2'abcd',_latin2'b',_latin2'B')` char(4) character set latin2 NOT NULL default '',
+ `encode('abcd','ab')` binary(4) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select SUBSTR('abcdefg',3,2);
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index c0c2a29772b..64ace522fe6 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -411,9 +411,13 @@ INSERT INTO t1 VALUES ('');
SELECT month(updated) from t1;
month(updated)
NULL
+Warnings:
+Warning 1292 Truncated incorrect datetime value: ''
SELECT year(updated) from t1;
year(updated)
NULL
+Warnings:
+Warning 1292 Truncated incorrect datetime value: ''
drop table t1;
create table t1 (d date, dt datetime, t timestamp, c char(10));
insert into t1 values ("0000-00-00", "0000-00-00", "0000-00-00", "0000-00-00");
@@ -585,7 +589,9 @@ a1 a2 a3 a4
28 28 29 29
select date_add(time,INTERVAL 1 SECOND) from t1;
date_add(time,INTERVAL 1 SECOND)
-2006-07-08 00:00:01
+NULL
+Warnings:
+Warning 1264 Data truncated; out of range for column 'time' at row 1
drop table t1;
select last_day('2000-02-05') as f1, last_day('2002-12-31') as f2,
last_day('2003-03-32') as f3, last_day('2003-04-01') as f4,
@@ -593,6 +599,8 @@ last_day('2001-01-01 01:01:01') as f5, last_day(NULL),
last_day('2001-02-12');
f1 f2 f3 f4 f5 last_day(NULL) last_day('2001-02-12')
2000-02-29 2002-12-31 NULL 2003-04-30 2001-01-31 NULL 2001-02-28
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '2003-03-32'
create table t1 select last_day('2000-02-05') as a,
from_days(to_days("960101")) as b;
describe t1;
diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result
index b66ef6d6a31..3fb1a5dd31c 100644
--- a/mysql-test/r/gis-rtree.result
+++ b/mysql-test/r/gis-rtree.result
@@ -167,12 +167,10 @@ count(*)
150
EXPLAIN SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))'));
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range g g 32 NULL 4 Using where
+1 SIMPLE t1 range g g 32 NULL 7 Using where
SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))'));
fid AsText(g)
1 LINESTRING(150 150,150 150)
-11 LINESTRING(140 140,160 160)
-2 LINESTRING(149 149,151 151)
3 LINESTRING(148 148,152 152)
4 LINESTRING(147 147,153 153)
5 LINESTRING(146 146,154 154)
@@ -181,6 +179,8 @@ fid AsText(g)
8 LINESTRING(143 143,157 157)
9 LINESTRING(142 142,158 158)
10 LINESTRING(141 141,159 159)
+11 LINESTRING(140 140,160 160)
+2 LINESTRING(149 149,151 151)
DROP TABLE t1;
CREATE TABLE t2 (
fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
@@ -305,10 +305,10 @@ id select_type table type possible_keys key key_len ref rows Extra
SELECT fid, AsText(g) FROM t2 WHERE Within(g,
GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))'));
fid AsText(g)
+46 LINESTRING(51 41,60 50)
+56 LINESTRING(41 41,50 50)
45 LINESTRING(51 51,60 60)
55 LINESTRING(41 51,50 60)
-56 LINESTRING(41 41,50 50)
-46 LINESTRING(51 41,60 50)
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10)))));
SELECT count(*) FROM t2;
count(*)
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index c47530cdc46..aa6c0c3f505 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -1,4 +1,5 @@
drop table if exists t1;
+SET NAMES binary;
delete from mysql.user where user='mysqltest_1';
delete from mysql.db where user='mysqltest_1';
flush privileges;
@@ -129,7 +130,7 @@ delete from mysql.columns_priv where user='mysqltest_1' or user="mysqltest_2" or
flush privileges;
drop table t1;
GRANT FILE on mysqltest.* to mysqltest_1@localhost;
-ERROR HY000: Wrong usage of DB GRANT and GLOBAL PRIVILEGES
+ERROR HY000: Incorrect usage of DB GRANT and GLOBAL PRIVILEGES
select 1;
1
1
diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result
index d0765e2721f..31e506d2679 100644
--- a/mysql-test/r/grant2.result
+++ b/mysql-test/r/grant2.result
@@ -1,3 +1,4 @@
+SET NAMES binary;
delete from mysql.user where user like 'mysqltest\_%';
delete from mysql.db where user like 'mysqltest\_%';
flush privileges;
@@ -10,7 +11,7 @@ current_user
mysqltest_1@localhost
grant all privileges on `my\_1`.* to mysqltest_2@localhost with grant option;
grant all privileges on `my_%`.* to mysqltest_3@localhost with grant option;
-ERROR 42000: Access denied for user: 'mysqltest_1'@'localhost' to database 'my_%'
+ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'my_%'
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
diff --git a/mysql-test/r/grant_cache.result b/mysql-test/r/grant_cache.result
index 48068c0f68d..892f1d940a6 100644
--- a/mysql-test/r/grant_cache.result
+++ b/mysql-test/r/grant_cache.result
@@ -134,7 +134,7 @@ a b c a
1 1 1 test.t1
2 2 2 test.t1
select * from t2;
-ERROR 42000: select command denied to user: 'mysqltest_2'@'localhost' for table 't2'
+ERROR 42000: select command denied to user 'mysqltest_2'@'localhost' for table 't2'
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 6
@@ -148,17 +148,17 @@ select "user3";
user3
user3
select * from t1;
-ERROR 42000: select command denied to user: 'mysqltest_3'@'localhost' for column 'b' in table 't1'
+ERROR 42000: select command denied to user 'mysqltest_3'@'localhost' for column 'b' in table 't1'
select a from t1;
a
1
2
select c from t1;
-ERROR 42000: SELECT command denied to user: 'mysqltest_3'@'localhost' for column 'c' in table 't1'
+ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1'
select * from t2;
-ERROR 42000: select command denied to user: 'mysqltest_3'@'localhost' for table 't2'
+ERROR 42000: select command denied to user 'mysqltest_3'@'localhost' for table 't2'
select mysqltest.t1.c from test.t1,mysqltest.t1;
-ERROR 42000: SELECT command denied to user: 'mysqltest_3'@'localhost' for column 'c' in table 't1'
+ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1'
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 6
@@ -176,7 +176,7 @@ Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
select a from t1;
-ERROR 3D000: No Database Selected
+ERROR 3D000: No database selected
select * from mysqltest.t1,test.t1;
a b c a
1 1 1 test.t1
@@ -198,6 +198,7 @@ Qcache_hits 8
show status like "Qcache_not_cached";
Variable_name Value
Qcache_not_cached 8
+set names binary;
delete from mysql.user where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
delete from mysql.db where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
delete from mysql.tables_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
diff --git a/mysql-test/r/handler.result b/mysql-test/r/handler.result
index fddad8dba51..f66e9f1759d 100644
--- a/mysql-test/r/handler.result
+++ b/mysql-test/r/handler.result
@@ -6,7 +6,7 @@ insert into t1 values
(20,"ggg"),(21,"hhh"),(22,"iii");
handler t1 open as t2;
handler t2 read a=(SELECT 1);
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1)' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1)' at line 1
handler t2 read a first;
a b
14 aaa
@@ -51,7 +51,7 @@ handler t2 read a=(16);
a b
16 ccc
handler t2 read a=(19,"fff");
-ERROR 42000: Too many key parts specified. Max 1 parts allowed
+ERROR 42000: Too many key parts specified; max 1 parts allowed
handler t2 read b=(19,"fff");
a b
19 fff
@@ -135,7 +135,7 @@ handler t2 read next;
a b
19 fff
handler t2 read last;
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
handler t2 close;
handler t1 open as t2;
drop table t1;
@@ -173,7 +173,7 @@ handler t1 open;
handler t1 read a=(W);
ERROR 42S22: Unknown column 'W' in 'field list'
handler t1 read a=(a);
-ERROR HY000: Wrong arguments to HANDLER ... READ
+ERROR HY000: Incorrect arguments to HANDLER ... READ
drop table t1;
create table t1 (a char(5));
insert into t1 values ("Ok");
diff --git a/mysql-test/r/have_archive.require b/mysql-test/r/have_archive.require
new file mode 100644
index 00000000000..c4b4ba24fcd
--- /dev/null
+++ b/mysql-test/r/have_archive.require
@@ -0,0 +1,2 @@
+Variable_name Value
+have_archive YES
diff --git a/mysql-test/r/have_debug.require b/mysql-test/r/have_debug.require
new file mode 100644
index 00000000000..714922cee63
--- /dev/null
+++ b/mysql-test/r/have_debug.require
@@ -0,0 +1,2 @@
+debug
+1
diff --git a/mysql-test/r/have_geometry.require b/mysql-test/r/have_geometry.require
new file mode 100644
index 00000000000..ba515a4bbb6
--- /dev/null
+++ b/mysql-test/r/have_geometry.require
@@ -0,0 +1,2 @@
+Variable_name Value
+have_geometry YES
diff --git a/mysql-test/r/innodb_cache.result b/mysql-test/r/innodb_cache.result
index 5c5e0bb6dfe..ec43cbe10b2 100644
--- a/mysql-test/r/innodb_cache.result
+++ b/mysql-test/r/innodb_cache.result
@@ -98,7 +98,7 @@ commit;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
-drop table if exists t1;
+drop table t3,t2,t1;
CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=InnoDB;
select count(*) from t1;
count(*)
@@ -108,3 +108,22 @@ select count(*) from t1;
count(*)
1
drop table t1;
+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;
+id a
+begin;
+insert into t3 VALUES ( NULL, 1, 1, 2 );
+insert into t3 VALUES ( NULL, 1, 1, 2 );
+ERROR 23000: Duplicate entry '1-1' for key 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;
+id a
+1 me
+drop table t3,t2,t1;
diff --git a/mysql-test/r/innodb_handler.result b/mysql-test/r/innodb_handler.result
index a608e5c71ab..7f4960ffa35 100644
--- a/mysql-test/r/innodb_handler.result
+++ b/mysql-test/r/innodb_handler.result
@@ -49,7 +49,7 @@ handler t2 read a=(16);
a b
16 ccc
handler t2 read a=(19,"fff");
-ERROR 42000: Too many key parts specified. Max 1 parts allowed
+ERROR 42000: Too many key parts specified; max 1 parts allowed
handler t2 read b=(19,"fff");
a b
19 fff
@@ -130,7 +130,7 @@ handler t2 read next;
a b
18 eee
handler t2 read last;
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
handler t2 close;
handler t1 open as t2;
handler t2 read first;
diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result
index 0aaf77cd623..a666e016348 100644
--- a/mysql-test/r/insert.result
+++ b/mysql-test/r/insert.result
@@ -63,7 +63,7 @@ insert into t1 values(NULL);
ERROR 23000: Column 'id' cannot be null
insert into t1 values (1), (NULL), (2);
Warnings:
-Warning 1263 Data truncated, NULL supplied to NOT NULL column 'id' at row 2
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'id' at row 2
select * from t1;
id
1
@@ -159,18 +159,18 @@ insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@val
Warnings:
Warning 1265 Data truncated for column 'f_double' at row 1
Warning 1265 Data truncated for column 'f_float' at row 1
-Warning 1264 Data truncated, out of range for column 'f_float' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float' at row 1
Warning 1265 Data truncated for column 'f_double_7_2' at row 1
-Warning 1264 Data truncated, out of range for column 'f_double_7_2' at row 1
+Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1
Warning 1265 Data truncated for column 'f_float_4_3' at row 1
-Warning 1264 Data truncated, out of range for column 'f_float_4_3' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1
Warning 1265 Data truncated for column 'f_double_u' at row 1
Warning 1265 Data truncated for column 'f_float_u' at row 1
-Warning 1264 Data truncated, out of range for column 'f_float_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1
Warning 1265 Data truncated for column 'f_double_15_1_u' at row 1
-Warning 1264 Data truncated, out of range for column 'f_double_15_1_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1
Warning 1265 Data truncated for column 'f_float_3_1_u' at row 1
-Warning 1264 Data truncated, out of range for column 'f_float_3_1_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1
select * from t1 where number =last_insert_id();
number 4
original_value 1e+1111111111a
@@ -187,19 +187,19 @@ insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@val
Warnings:
Warning 1265 Data truncated for column 'f_double' at row 1
Warning 1265 Data truncated for column 'f_float' at row 1
-Warning 1264 Data truncated, out of range for column 'f_float' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float' at row 1
Warning 1265 Data truncated for column 'f_double_7_2' at row 1
-Warning 1264 Data truncated, out of range for column 'f_double_7_2' at row 1
+Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1
Warning 1265 Data truncated for column 'f_float_4_3' at row 1
-Warning 1264 Data truncated, out of range for column 'f_float_4_3' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1
Warning 1265 Data truncated for column 'f_double_u' at row 1
-Warning 1264 Data truncated, out of range for column 'f_double_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_double_u' at row 1
Warning 1265 Data truncated for column 'f_float_u' at row 1
-Warning 1264 Data truncated, out of range for column 'f_float_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1
Warning 1265 Data truncated for column 'f_double_15_1_u' at row 1
-Warning 1264 Data truncated, out of range for column 'f_double_15_1_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1
Warning 1265 Data truncated for column 'f_float_3_1_u' at row 1
-Warning 1264 Data truncated, out of range for column 'f_float_3_1_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1
select * from t1 where number =last_insert_id();
number 5
original_value -1e+1111111111a
@@ -214,12 +214,12 @@ f_float_3_1_u 0.0
set @value= 1e+1111111111;
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
Warnings:
-Warning 1264 Data truncated, out of range for column 'f_float' at row 1
-Warning 1264 Data truncated, out of range for column 'f_double_7_2' at row 1
-Warning 1264 Data truncated, out of range for column 'f_float_4_3' at row 1
-Warning 1264 Data truncated, out of range for column 'f_float_u' at row 1
-Warning 1264 Data truncated, out of range for column 'f_double_15_1_u' at row 1
-Warning 1264 Data truncated, out of range for column 'f_float_3_1_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float' at row 1
+Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1
select * from t1 where number =last_insert_id();
number 6
original_value 1.7976931348623e+308
@@ -234,13 +234,13 @@ f_float_3_1_u 99.9
set @value= -1e+1111111111;
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
Warnings:
-Warning 1264 Data truncated, out of range for column 'f_float' at row 1
-Warning 1264 Data truncated, out of range for column 'f_double_7_2' at row 1
-Warning 1264 Data truncated, out of range for column 'f_float_4_3' at row 1
-Warning 1264 Data truncated, out of range for column 'f_double_u' at row 1
-Warning 1264 Data truncated, out of range for column 'f_float_u' at row 1
-Warning 1264 Data truncated, out of range for column 'f_double_15_1_u' at row 1
-Warning 1264 Data truncated, out of range for column 'f_float_3_1_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float' at row 1
+Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1
+Warning 1264 Data truncated; out of range for column 'f_double_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1
select * from t1 where number =last_insert_id();
number 7
original_value -1.7976931348623e+308
@@ -255,12 +255,12 @@ f_float_3_1_u 0.0
set @value= 1e+111;
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
Warnings:
-Warning 1264 Data truncated, out of range for column 'f_float' at row 1
-Warning 1264 Data truncated, out of range for column 'f_double_7_2' at row 1
-Warning 1264 Data truncated, out of range for column 'f_float_4_3' at row 1
-Warning 1264 Data truncated, out of range for column 'f_float_u' at row 1
-Warning 1264 Data truncated, out of range for column 'f_double_15_1_u' at row 1
-Warning 1264 Data truncated, out of range for column 'f_float_3_1_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float' at row 1
+Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1
select * from t1 where number =last_insert_id();
number 8
original_value 1e+111
@@ -275,13 +275,13 @@ f_float_3_1_u 99.9
set @value= -1e+111;
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
Warnings:
-Warning 1264 Data truncated, out of range for column 'f_float' at row 1
-Warning 1264 Data truncated, out of range for column 'f_double_7_2' at row 1
-Warning 1264 Data truncated, out of range for column 'f_float_4_3' at row 1
-Warning 1264 Data truncated, out of range for column 'f_double_u' at row 1
-Warning 1264 Data truncated, out of range for column 'f_float_u' at row 1
-Warning 1264 Data truncated, out of range for column 'f_double_15_1_u' at row 1
-Warning 1264 Data truncated, out of range for column 'f_float_3_1_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float' at row 1
+Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1
+Warning 1264 Data truncated; out of range for column 'f_double_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1
select * from t1 where number =last_insert_id();
number 9
original_value -1e+111
@@ -309,10 +309,10 @@ f_float_3_1_u 1.0
set @value= -1;
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
Warnings:
-Warning 1264 Data truncated, out of range for column 'f_double_u' at row 1
-Warning 1264 Data truncated, out of range for column 'f_float_u' at row 1
-Warning 1264 Data truncated, out of range for column 'f_double_15_1_u' at row 1
-Warning 1264 Data truncated, out of range for column 'f_float_3_1_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_double_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1
+Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1
select * from t1 where number =last_insert_id();
number 11
original_value -1
diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result
index eb8c389e38f..83e47639fe3 100644
--- a/mysql-test/r/insert_select.result
+++ b/mysql-test/r/insert_select.result
@@ -622,8 +622,8 @@ NULL 2 100
create table t2(No int not null, Field int not null, Count int not null);
insert into t2 Select null, Field, Count From t1 Where Month=20030901 and Type=2;
Warnings:
-Warning 1263 Data truncated, NULL supplied to NOT NULL column 'No' at row 1
-Warning 1263 Data truncated, NULL supplied to NOT NULL column 'No' at row 2
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'No' at row 1
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'No' at row 2
select * from t2;
No Field Count
0 1 100
diff --git a/mysql-test/r/isam.result b/mysql-test/r/isam.result
index 2c7b3a4a568..52eb2d73ed5 100644
--- a/mysql-test/r/isam.result
+++ b/mysql-test/r/isam.result
@@ -34,7 +34,7 @@ ERROR 42000: Column 'a' is used with UNIQUE or INDEX but is not defined as NOT N
create table t1 (a int,b text, index(b)) engine=isam;
ERROR 42000: BLOB column 'b' can't be used in key specification with the used table type
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=isam;
-ERROR 42000: Incorrect table definition; There can only be one auto column and it must be defined as a key
+ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key
create table t1 (ordid int(8), unique (ordid)) engine=isam;
ERROR 42000: Column 'ordid' is used with UNIQUE or INDEX but is not defined as NOT NULL
drop table if exists t1;
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result
index f9e49c40dc1..db9b051a58f 100644
--- a/mysql-test/r/join.result
+++ b/mysql-test/r/join.result
@@ -126,7 +126,7 @@ a
1
2
select t1.a from t1 as t1 left join t1 as t2 using (a) left join t1 as t3 using (a) left join t1 as t4 using (a) left join t1 as t5 using (a) left join t1 as t6 using (a) left join t1 as t7 using (a) left join t1 as t8 using (a) left join t1 as t9 using (a) left join t1 as t10 using (a) left join t1 as t11 using (a) left join t1 as t12 using (a) left join t1 as t13 using (a) left join t1 as t14 using (a) left join t1 as t15 using (a) left join t1 as t16 using (a) left join t1 as t17 using (a) left join t1 as t18 using (a) left join t1 as t19 using (a) left join t1 as t20 using (a) left join t1 as t21 using (a) left join t1 as t22 using (a) left join t1 as t23 using (a) left join t1 as t24 using (a) left join t1 as t25 using (a) left join t1 as t26 using (a) left join t1 as t27 using (a) left join t1 as t28 using (a) left join t1 as t29 using (a) left join t1 as t30 using (a) left join t1 as t31 using (a) left join t1 as t32 using (a) left join t1 as t33 using (a) left join t1 as t34 using (a) left join t1 as t35 using (a) left join t1 as t36 using (a) left join t1 as t37 using (a) left join t1 as t38 using (a) left join t1 as t39 using (a) left join t1 as t40 using (a) left join t1 as t41 using (a) left join t1 as t42 using (a) left join t1 as t43 using (a) left join t1 as t44 using (a) left join t1 as t45 using (a) left join t1 as t46 using (a) left join t1 as t47 using (a) left join t1 as t48 using (a) left join t1 as t49 using (a) left join t1 as t50 using (a) left join t1 as t51 using (a) left join t1 as t52 using (a) left join t1 as t53 using (a) left join t1 as t54 using (a) left join t1 as t55 using (a) left join t1 as t56 using (a) left join t1 as t57 using (a) left join t1 as t58 using (a) left join t1 as t59 using (a) left join t1 as t60 using (a) left join t1 as t61 using (a) left join t1 as t62 using (a) left join t1 as t63 using (a) left join t1 as t64 using (a) left join t1 as t65 using (a);
-ERROR HY000: Too many tables. MySQL can only use XX tables in a join
+ERROR HY000: Too many tables; MySQL can only use XX tables in a join
drop table t1;
CREATE TABLE t1 (
a int(11) NOT NULL,
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result
index f8083c9cf70..7915521a9b7 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -106,11 +106,11 @@ grp a c id a c d a
3 6 D 3 6 C 6 6
NULL NULL NULL NULL NULL NULL NULL
explain select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a);
-ERROR 42000: Cross dependency found in OUTER JOIN. Examine your ON conditions
+ERROR 42000: Cross dependency found in OUTER JOIN; examine your ON conditions
select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a);
-ERROR 42000: Cross dependency found in OUTER JOIN. Examine your ON conditions
+ERROR 42000: Cross dependency found in OUTER JOIN; examine your ON conditions
select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t2.a=t3.a);
-ERROR 42000: Cross dependency found in OUTER JOIN. Examine your ON conditions
+ERROR 42000: Cross dependency found in OUTER JOIN; examine your ON conditions
select t1.*,t2.* from t1 inner join t2 using (a);
grp a c id a c d
1 1 a 1 1 a 1
@@ -400,7 +400,7 @@ insert into t3 values (1);
insert into t4 values (1,1);
insert into t5 values (1,1);
explain select * from t3 left join t4 on t4.seq_1_id = t2.t2_id left join t1 on t1.t1_id = t4.seq_0_id left join t5 on t5.seq_0_id = t1.t1_id left join t2 on t2.t2_id = t5.seq_1_id where t3.t3_id = 23;
-ERROR 42000: Cross dependency found in OUTER JOIN. Examine your ON conditions
+ERROR 42000: Cross dependency found in OUTER JOIN; examine your ON conditions
drop table t1,t2,t3,t4,t5;
create table t1 (n int, m int, o int, key(n));
create table t2 (n int not null, m int, o int, primary key(n));
diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result
index 2ea60114066..dd03ef73883 100644
--- a/mysql-test/r/key.result
+++ b/mysql-test/r/key.result
@@ -156,8 +156,8 @@ CREATE TABLE t1 (c CHAR(10) NOT NULL,i INT NOT NULL AUTO_INCREMENT,
UNIQUE (c,i));
INSERT INTO t1 (c) VALUES (NULL),(NULL);
Warnings:
-Warning 1263 Data truncated, NULL supplied to NOT NULL column 'c' at row 1
-Warning 1263 Data truncated, NULL supplied to NOT NULL column 'c' at row 2
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'c' at row 1
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'c' at row 2
SELECT * FROM t1;
c i
1
diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result
index 1580f51975e..fe8708f882d 100644
--- a/mysql-test/r/key_cache.result
+++ b/mysql-test/r/key_cache.result
@@ -39,9 +39,9 @@ SELECT @@medium.key_buffer_size;
0
SET @@global.key_buffer_size=@save_key_buffer;
SELECT @@default.key_buffer_size;
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'default.key_buffer_size' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default.key_buffer_size' at line 1
SELECT @@skr.storage_engine="test";
-ERROR HY000: Variable 'storage_engine' is not a variable component (Can't be used as XXXX.variable_name)
+ERROR HY000: Variable 'storage_engine' is not a variable component (can't be used as XXXX.variable_name)
select @@keycache1.key_cache_block_size;
@@keycache1.key_cache_block_size
0
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index 5718397e1ec..c0baabcc507 100644
--- a/mysql-test/r/loaddata.result
+++ b/mysql-test/r/loaddata.result
@@ -44,9 +44,9 @@ create table t1 (a int, b char(10));
load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
Warnings:
Warning 1265 Data truncated for column 'a' at row 3
-Warning 1262 Row 3 was truncated; It contained more data than there were input columns
+Warning 1262 Row 3 was truncated; it contained more data than there were input columns
Warning 1265 Data truncated for column 'a' at row 5
-Warning 1262 Row 5 was truncated; It contained more data than there were input columns
+Warning 1262 Row 5 was truncated; it contained more data than there were input columns
select * from t1;
a b
1 row 1
diff --git a/mysql-test/r/lowercase_table2.result b/mysql-test/r/lowercase_table2.result
index d43a18c6a96..3be73f6cc6a 100644
--- a/mysql-test/r/lowercase_table2.result
+++ b/mysql-test/r/lowercase_table2.result
@@ -32,7 +32,7 @@ T1
ALTER TABLE T1 add b int;
SHOW TABLES LIKE "T1";
Tables_in_test (T1)
-t1
+T1
ALTER TABLE T1 RENAME T2;
SHOW TABLES LIKE "T2";
Tables_in_test (T2)
@@ -41,7 +41,7 @@ LOCK TABLE T2 WRITE;
ALTER TABLE T2 drop b;
SHOW TABLES LIKE "T2";
Tables_in_test (T2)
-t2
+T2
UNLOCK TABLES;
RENAME TABLE T2 TO T1;
SHOW TABLES LIKE "T1";
@@ -121,3 +121,13 @@ LOCATION
Mic-5
Mic-6
drop table T1;
+create table T1 (A int);
+alter table T1 add index (A);
+show tables like 'T1%';
+Tables_in_test (T1%)
+T1
+alter table t1 add index (A);
+show tables like 't1%';
+Tables_in_test (t1%)
+t1
+drop table t1;
diff --git a/mysql-test/r/lowercase_table3.result b/mysql-test/r/lowercase_table3.result
index 362d17e0461..a645e46be9e 100644
--- a/mysql-test/r/lowercase_table3.result
+++ b/mysql-test/r/lowercase_table3.result
@@ -4,7 +4,7 @@ SELECT * from T1;
a
drop table t1;
flush tables;
-CREATE TABLE t1 (a int) type=INNODB;
+CREATE TABLE t1 (a int) ENGINE=INNODB;
SELECT * from T1;
-Can't open file: 'T1.InnoDB'. (errno: 1)
+ERROR HY000: Can't open file: 'T1.InnoDB' (errno: 1)
drop table t1;
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index 63e0a228aa5..83f8230f11c 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -544,6 +544,24 @@ insert into t1 values (99,NULL);
select * from t4 where a+0 > 90;
a b
99 1
+insert t5 values (1,1);
+ERROR 23000: Duplicate entry '1-1' for key 1
+insert t6 values (2,1);
+ERROR 23000: Duplicate entry '2-1' for key 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;
+a b
+1 2
+1 3
+1 4
+1 5
+1 11
+2 2
+2 3
+2 4
+2 5
+2 21
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;
INSERT INTO t1 VALUES (1,1), (2,1);
diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result
index 4668f1262f9..d809c9112b7 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -191,7 +191,7 @@ n d unix_timestamp(t)
1 10 1038401397
2 20 1038401397
UPDATE t1,t2 SET 1=2 WHERE t1.n=t2.n;
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '1=2 WHERE t1.n=t2.n' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1=2 WHERE t1.n=t2.n' at line 1
drop table t1,t2;
set timestamp=0;
set sql_safe_updates=0;
@@ -446,7 +446,8 @@ grant update on mysqltest.t1 to mysqltest_1@localhost;
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;
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
-delete from mysql.user where user='mysqltest_1';
+revoke all privileges on mysqltest.* from mysqltest_1@localhost;
+delete from mysql.user where user=_binary'mysqltest_1';
drop database mysqltest;
create table t1 (a int, primary key (a));
create table t2 (a int, primary key (a));
diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result
index f54f233d929..c18588d90a7 100644
--- a/mysql-test/r/mysqlbinlog.result
+++ b/mysql-test/r/mysqlbinlog.result
@@ -1,5 +1,5 @@
-drop table if exists t1,t2;
set timestamp=1000000000;
+drop table if exists t1,t2;
create table t1 (word varchar(20));
create table t2 (id int auto_increment not null primary key);
insert into t1 values ("abirvalg");
@@ -19,6 +19,8 @@ use test;
SET TIMESTAMP=1000000000;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
SET @@session.sql_mode=0;
+drop table if exists t1,t2;
+SET TIMESTAMP=1000000000;
create table t1 (word varchar(20));
SET TIMESTAMP=1000000000;
create table t2 (id int auto_increment not null primary key);
@@ -59,6 +61,8 @@ use test;
SET TIMESTAMP=1000000000;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
SET @@session.sql_mode=0;
+drop table if exists t1,t2;
+SET TIMESTAMP=1000000000;
create table t1 (word varchar(20));
SET TIMESTAMP=1000000000;
create table t2 (id int auto_increment not null primary key);
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 01114104088..7e69620394b 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -54,7 +54,10 @@ CREATE TABLE `t1` (
);
INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456);
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=utf8 */;
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;
@@ -75,6 +78,8 @@ UNLOCK TABLES;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
@@ -136,9 +141,12 @@ INSERT INTO t1 VALUES ("1\""), ("\"2");
</mysqldump>
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET koi8r;
-INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5');
+INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL);
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=utf8 */;
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;
@@ -151,6 +159,7 @@ CREATE TABLE `t1` (
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
LOCK TABLES `t1` WRITE;
INSERT INTO `t1` VALUES ('абцде');
+INSERT INTO `t1` VALUES (NULL);
UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
@@ -158,6 +167,8 @@ UNLOCK TABLES;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
DROP TABLE t1;
CREATE TABLE t1 (a int) ENGINE=MYISAM;
@@ -208,7 +219,10 @@ CREATE TABLE ```a` (
drop table ```a`;
create table t1(a int);
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=utf8 */;
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;
@@ -227,6 +241,8 @@ UNLOCK TABLES;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
@@ -248,7 +264,10 @@ UNLOCK TABLES;
set global sql_mode='ANSI_QUOTES';
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=utf8 */;
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;
@@ -267,6 +286,8 @@ UNLOCK TABLES;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
@@ -291,7 +312,10 @@ drop table t1;
create table t1(a int);
insert into t1 values (1),(2),(3);
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=utf8 */;
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="" */;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
@@ -301,6 +325,8 @@ CREATE TABLE `t1` (
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
1
2
diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result
new file mode 100644
index 00000000000..6cc6a89d5ad
--- /dev/null
+++ b/mysql-test/r/ndb_alter_table.result
@@ -0,0 +1,29 @@
+DROP TABLE IF EXISTS t1;
+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;
+a b c
+9410 9412 0
+DROP TABLE t1;
+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;
+col6 col1 col3 fourth col4 col4_5 col5 col7 col8
+1 2 3 4 5 PENDING 0000-00-00 00:00:00
+drop table t1;
diff --git a/mysql-test/r/ndb_autodiscover.result b/mysql-test/r/ndb_autodiscover.result
new file mode 100644
index 00000000000..b0e2aa04f3e
--- /dev/null
+++ b/mysql-test/r/ndb_autodiscover.result
@@ -0,0 +1,183 @@
+drop table if exists t1,t2,t3,t4,t5,t6,t9;
+flush status;
+create table t1(
+id int not null primary key,
+name char(20)
+) engine=ndb;
+insert into t1 values(1, "Autodiscover");
+flush tables;
+select * from t1;
+id name
+1 Autodiscover
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 1
+flush tables;
+insert into t1 values (2, "Auto 2");
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 2
+insert into t1 values (3, "Discover 3");
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 2
+flush tables;
+select * from t1 order by id;
+id name
+1 Autodiscover
+2 Auto 2
+3 Discover 3
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 3
+flush tables;
+update t1 set name="Autodiscover" where id = 2;
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 4
+select * from t1 order by name;
+id name
+2 Autodiscover
+1 Autodiscover
+3 Discover 3
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 4
+flush tables;
+delete from t1 where id = 3;
+select * from t1 order by id;
+id name
+1 Autodiscover
+2 Autodiscover
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 5
+drop table t1;
+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;
+id name
+1 Discoverer
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 0
+flush tables;
+select * from t2;
+id name
+1 Discoverer
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 1
+drop table t2;
+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;
+id name
+1 Explorer
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 0
+flush tables;
+create table t3(
+id int not null primary key,
+name char(20), a int, b float, c char(24)
+) engine=ndb;
+ERROR 42S01: Table 't3' already exists
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 1
+SHOW TABLES FROM test;
+Tables_in_test
+create table IF NOT EXISTS t3(
+id int not null primary key,
+id2 int not null,
+name char(20)
+) engine=ndb;
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 2
+SHOW CREATE TABLE t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `id` int(11) NOT NULL default '0',
+ `name` char(255) default NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+select * from t3;
+id name
+1 Explorer
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 2
+drop table t3;
+flush status;
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 0
+create table t5(
+id int not null primary key,
+name char(200)
+) engine=ndb;
+insert into t5 values (1, "Magnus");
+select * from t5;
+id name
+1 Magnus
+ALTER TABLE t5 ADD COLUMN adress char(255) FIRST;
+select * from t5;
+adress id name
+NULL 1 Magnus
+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;
+adress id name
+NULL 1 Magnus
+Adress for record 2 2 Bertil
+Adress for record 3 3 Karl-Emil
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 0
+drop table t5;
+flush status;
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 0
+create table t6(
+id int not null primary key,
+name char(20)
+) engine=ndb;
+insert into t6 values (1, "Magnus");
+select * from t6;
+id name
+1 Magnus
+ALTER TABLE t6 ADD COLUMN adress char(255) FIRST;
+select * from t6;
+adress id name
+NULL 1 Magnus
+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;
+adress id name
+NULL 1 Magnus
+Adress for record 2 2 Bertil
+Adress for record 3 3 Karl-Emil
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 0
+drop table t6;
+CREATE TABLE t9 (
+a int NOT NULL PRIMARY KEY,
+b int
+) engine=ndb;
+insert t9 values(1, 2), (2,3), (3, 4), (4, 5);
diff --git a/mysql-test/r/ndb_autodiscover2.result b/mysql-test/r/ndb_autodiscover2.result
new file mode 100644
index 00000000000..08803d997a5
--- /dev/null
+++ b/mysql-test/r/ndb_autodiscover2.result
@@ -0,0 +1,10 @@
+select * from t9 order by a;
+a b
+1 2
+2 3
+3 4
+4 5
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 1
+drop table t9;
diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result
index ac550937146..0e7b039a5f9 100644
--- a/mysql-test/r/ndb_basic.result
+++ b/mysql-test/r/ndb_basic.result
@@ -1,4 +1,4 @@
-DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
CREATE TABLE t1 (
pk1 INT NOT NULL PRIMARY KEY,
attr1 INT NOT NULL
@@ -25,11 +25,59 @@ pk1 attr1
DELETE FROM t1;
SELECT * FROM t1;
pk1 attr1
-INSERT INTO t1 VALUES (9410,9412);
+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;
+pk1 attr1
+7 9999
+8 9999
+9 9999
+10 9999
+11 9999
+12 9999
+13 9999
+9408 9999
+9410 9999
+9411 9999
+UPDATE t1 SET attr1 = 9998 WHERE pk1 < 1000;
+SELECT * FROM t1 ORDER BY pk1;
+pk1 attr1
+7 9998
+8 9998
+9 9998
+10 9998
+11 9998
+12 9998
+13 9998
+9408 9999
+9410 9999
+9411 9999
+UPDATE t1 SET attr1 = 9997 WHERE attr1 = 9999;
+SELECT * FROM t1 ORDER BY pk1;
+pk1 attr1
+7 9998
+8 9998
+9 9998
+10 9998
+11 9998
+12 9998
+13 9998
+9408 9997
+9410 9997
+9411 9997
DELETE FROM t1 WHERE pk1 = 9410;
-SELECT * FROM t1;
+SELECT * FROM t1 ORDER BY pk1;
pk1 attr1
-INSERT INTO t1 VALUES (9410,9412), (9411, 9413), (9408, 8765);
+7 9998
+8 9998
+9 9998
+10 9998
+11 9998
+12 9998
+13 9998
+9408 9997
+9411 9997
DELETE FROM t1;
SELECT * FROM t1;
pk1 attr1
@@ -80,3 +128,213 @@ attr1 INT NOT NULL
) ENGINE=NDB;
INSERT INTO t1 values(1, 9999);
DROP TABLE t1;
+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;
+select * from t2 where a = 7 order by b;
+a b c
+7 16 5
+select * from t2 where a = 7 order by a;
+a b c
+7 16 5
+select * from t2 where a = 7 order by 2;
+a b c
+7 16 5
+select * from t2 where a = 7 order by c;
+a b c
+7 16 5
+select * from t2 where a = 7 and b = 16 order by b;
+a b c
+7 16 5
+select * from t2 where a = 7 and b = 16 order by a;
+a b c
+7 16 5
+select * from t2 where a = 7 and b = 17 order by a;
+a b c
+select * from t2 where a = 7 and b != 16 order by b;
+a b c
+select * from t2 where a = 7 and b = 16 and c = 5 order by b;
+a b c
+7 16 5
+select * from t2 where a = 7 and b = 16 and c = 5 order by a;
+a b c
+7 16 5
+select * from t2 where a = 7 and b = 16 and c = 6 order by a;
+a b c
+select * from t2 where a = 7 and b != 16 and c = 5 order by b;
+a b c
+select * from t3 where a = 7 order by b;
+a b c
+7 16 5
+select * from t3 where a = 7 order by a;
+a b c
+7 16 5
+select * from t3 where a = 7 order by 2;
+a b c
+7 16 5
+select * from t3 where a = 7 order by c;
+a b c
+7 16 5
+select * from t3 where a = 7 and b = 16 order by b;
+a b c
+7 16 5
+select * from t3 where a = 7 and b = 16 order by a;
+a b c
+7 16 5
+select * from t3 where a = 7 and b = 17 order by a;
+a b c
+select * from t3 where a = 7 and b != 16 order by b;
+a b c
+select * from t4 where a = 7 order by b;
+a b c d
+7 16 5 26007
+select * from t4 where a = 7 order by a;
+a b c d
+7 16 5 26007
+select * from t4 where a = 7 order by 2;
+a b c d
+7 16 5 26007
+select * from t4 where a = 7 order by c;
+a b c d
+7 16 5 26007
+select * from t4 where a = 7 and b = 16 order by b;
+a b c d
+7 16 5 26007
+select * from t4 where a = 7 and b = 16 order by a;
+a b c d
+7 16 5 26007
+select * from t4 where a = 7 and b = 17 order by a;
+a b c d
+select * from t4 where a = 7 and b != 16 order by b;
+a b c d
+delete from t2;
+delete from t3;
+delete from t4;
+drop table t2;
+drop table t3;
+drop table t4;
+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;
+a b c d
+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;
+a b c d
+10 19 5 21997
+delete from t5;
+drop table t5;
+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;
+adress a b
+Nice road 3456 1 23
+Street Road 78 3 92
+Road street 89C 5 71
+NULL 7 NULL
+select a, b from t6 order by a;
+a b
+1 23
+3 92
+5 71
+7 NULL
+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;
+adress a b
+Nice road 3456 1 23
+End of road 09 3 92
+Road street 89C 5 71
+Street 76 7 181
+select * from t6 where a=1;
+adress a b
+Nice road 3456 1 23
+delete from t6 where a=1;
+select * from t6 order by a;
+adress a b
+End of road 09 3 92
+Road street 89C 5 71
+Street 76 7 181
+delete from t6 where b=71;
+select * from t6 order by a;
+adress a b
+End of road 09 3 92
+Street 76 7 181
+drop table t6;
+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;
+adress a b c
+Highway 3456 1 23 2
+Street Road 78 3 92 3
+Main street 89C 5 71 4
+NULL 8 NULL 12
+select a, b from t7 order by a;
+a b
+1 23
+3 92
+5 71
+8 NULL
+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;
+adress a b c
+Highway 3456 1 23 2
+End of road 09 3 92 3
+Gatuvägen 90C 5 71 4
+No adress 8 NULL 12
+select * from t7 where a=1 and c=2;
+adress a b c
+Highway 3456 1 23 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;
+adress a b c
+No adress 8 NULL 12
+delete from t7 where b=23;
+select * from t7;
+adress a b c
+No adress 8 NULL 12
+drop table t7;
diff --git a/mysql-test/r/ndb_index.result b/mysql-test/r/ndb_index.result
new file mode 100644
index 00000000000..dd92c237ace
--- /dev/null
+++ b/mysql-test/r/ndb_index.result
@@ -0,0 +1,154 @@
+drop table if exists t1;
+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);
+select port, accessnode, pop, accesstype from t1 where port='port67' order by accesstype;
+port accessnode pop accesstype
+port67 node78 pop98 1
+port67 node78 pop99 2
+select port, accessnode, pop, accesstype from t1 where port='foo';
+port accessnode pop accesstype
+select port, accessnode, pop, accesstype from t1 where accessnode='node78' order by accesstype;
+port accessnode pop accesstype
+port67 node78 pop98 1
+port67 node78 pop99 2
+select port, accessnode, pop, accesstype from t1 where accessnode='foo';
+port accessnode pop accesstype
+select port, accessnode, pop, accesstype from t1 where pop='pop98';
+port accessnode pop accesstype
+port67 node78 pop98 1
+select port, accessnode, pop, accesstype from t1 where pop='pop98';
+port accessnode pop accesstype
+port67 node78 pop98 1
+select port, accessnode, pop, accesstype from t1 where pop='pop98';
+port accessnode pop accesstype
+port67 node78 pop98 1
+select port, accessnode, pop, accesstype from t1 where pop='pop98' order by accesstype;
+port accessnode pop accesstype
+port67 node78 pop98 1
+select port, accessnode, pop, accesstype from t1 where pop='foo';
+port accessnode pop accesstype
+select port, accessnode, pop, accesstype from t1 where accesstype=1;
+port accessnode pop accesstype
+port67 node78 pop98 1
+select port, accessnode, pop, accesstype from t1 where accesstype=2 order by port;
+port accessnode pop accesstype
+port67 node78 pop99 2
+port79 node79 pop79 2
+select port, accessnode, pop, accesstype from t1 where accesstype=98 order by port;
+port accessnode pop accesstype
+select port, accessnode, pop, accesstype from t1 where customer_id='kllopmn';
+port accessnode pop accesstype
+port67 node78 pop98 1
+select port, accessnode, pop, accesstype from t1 where customer_id='KLLOPMN';
+port accessnode pop accesstype
+select port, accessnode, pop, accesstype from t1 where customer_id='kLLoPMn';
+port accessnode pop accesstype
+select port, accessnode, pop, accesstype from t1 where customer_id='foo';
+port accessnode pop accesstype
+select port, accessnode, pop, accesstype from t1 where provider='pr_43';
+port accessnode pop accesstype
+port67 node78 pop98 1
+select port, accessnode, pop, accesstype from t1 where provider='foo';
+port accessnode pop accesstype
+select port, accessnode from t1 where texpire=121212;
+port accessnode
+port67 node78
+select port, accessnode from t1 where texpire=2323;
+port accessnode
+select port, accessnode, pop, accesstype from t1 where num_ip=1;
+port accessnode pop accesstype
+port67 node78 pop98 1
+select port, accessnode, pop, accesstype from t1 where num_ip=89;
+port accessnode pop accesstype
+select port, accessnode, pop, accesstype from t1 where leased_num_ip=2;
+port accessnode pop accesstype
+port67 node78 pop98 1
+select port, accessnode, pop, accesstype from t1 where leased_num_ip=89;
+port accessnode pop accesstype
+select port, accessnode, pop, accesstype from t1 where locked_ip=3;
+port accessnode pop accesstype
+port67 node78 pop98 1
+select port, accessnode, pop, accesstype from t1 where locked_ip=89;
+port accessnode pop accesstype
+select port, accessnode, pop, accesstype from t1 where static_dns=8;
+port accessnode pop accesstype
+port67 node78 pop98 1
+select port, accessnode, pop, accesstype from t1 where static_dns=89;
+port accessnode pop accesstype
+select port, accessnode, pop, accesstype from t1 where suspended_service=8;
+port accessnode pop accesstype
+select port, accessnode, pop, accesstype from t1 where suspended_service=89;
+port accessnode pop accesstype
+select port, accessnode, pop, accesstype from t1 where suspended_reason=NULL;
+port accessnode pop accesstype
+select port, accessnode, pop, accesstype from t1 where suspended_reason=89;
+port accessnode pop accesstype
+select port, accessnode, pop, accesstype from t1 where suspended_reason=0;
+port accessnode pop accesstype
+select port, accessnode, pop, accesstype from t1 where bgp_community=NULL;
+port accessnode pop accesstype
+select port, accessnode, pop, accesstype from t1 where bgp_community=89;
+port accessnode pop accesstype
+select port, accessnode, pop, accesstype from t1 where bgp_community=0;
+port accessnode pop accesstype
+select port, accessnode, pop, accesstype from t1 where port='port67' and accessnode='node78' and pop='pop98' and accesstype=1;
+port accessnode pop accesstype
+port67 node78 pop98 1
+select port, accessnode, pop, accesstype from t1 where port='port67' and accesstype=1 and accessnode='node78' and pop='pop98';
+port accessnode pop accesstype
+port67 node78 pop98 1
+select port, accessnode, pop, accesstype from t1 where pop='pop98' and port='port67' and accesstype=1 and accessnode='node78';
+port accessnode pop accesstype
+port67 node78 pop98 1
+select port, accessnode from t1 where port='foo' and accessnode='foo' and pop='foo' and accesstype=99;
+port accessnode
+select port, accessnode, pop, accesstype from t1 where port='port67' and pop='pop98' and accesstype=1;
+port accessnode pop accesstype
+port67 node78 pop98 1
+select port, accessnode, pop, accesstype from t1 where accesstype=1 and accessnode='node78' and pop='pop98';
+port accessnode pop accesstype
+port67 node78 pop98 1
+select port, accessnode, pop, accesstype from t1 where port='port67' and accesstype=1 and accessnode='node78';
+port accessnode pop accesstype
+port67 node78 pop98 1
+select port, accessnode from t1 where port='foo' and accessnode='foo' and pop='foo';
+port accessnode
+select port, accessnode, pop, accesstype from t1 where customer_id='kllopmn';
+port accessnode pop accesstype
+port67 node78 pop98 1
+select port, accessnode, pop, accesstype from t1 where customer_id='kllopmn' and accesstype=1;
+port accessnode pop accesstype
+port67 node78 pop98 1
+select port, accessnode, pop, accesstype from t1 where customer_id='kllopmn' and accesstype=2;
+port accessnode pop accesstype
+select port, accessnode, pop, accesstype from t1 where accesstype=2 and customer_id='kllopmn';
+port accessnode pop accesstype
+select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessnode='node78' and port='port67';
+port accessnode pop accesstype
+port67 node78 pop98 1
+select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessnode='node78' and port='port67' and customer_id='kllopmn';
+port accessnode pop accesstype
+port67 node78 pop98 1
+select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessnode='node78' and port='port67' and customer_id='foo';
+port accessnode pop accesstype
+drop table t1;
diff --git a/mysql-test/r/ndb_index_ordered.result b/mysql-test/r/ndb_index_ordered.result
new file mode 100644
index 00000000000..0e3bd555b0a
--- /dev/null
+++ b/mysql-test/r/ndb_index_ordered.result
@@ -0,0 +1,190 @@
+drop table if exists 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, 3), (2,3, 5), (3, 4, 6), (4, 5, 8), (5,6, 2), (6,7, 2);
+select * from t1 order by b;
+a b c
+1 2 3
+2 3 5
+3 4 6
+4 5 8
+5 6 2
+6 7 2
+select * from t1 where b >= 4 order by b;
+a b c
+3 4 6
+4 5 8
+5 6 2
+6 7 2
+select * from t1 where b = 4 order by b;
+a b c
+3 4 6
+select * from t1 where b > 4 order by b;
+a b c
+4 5 8
+5 6 2
+6 7 2
+select * from t1 where b < 4 order by b;
+a b c
+1 2 3
+2 3 5
+select * from t1 where b <= 4 order by b;
+a b c
+1 2 3
+2 3 5
+3 4 6
+update t1 set c = 3 where b = 3;
+select * from t1 order by a;
+a b c
+1 2 3
+2 3 3
+3 4 6
+4 5 8
+5 6 2
+6 7 2
+update t1 set c = 10 where b >= 6;
+select * from t1 order by a;
+a b c
+1 2 3
+2 3 3
+3 4 6
+4 5 8
+5 6 10
+6 7 10
+update t1 set c = 11 where b < 5;
+select * from t1 order by a;
+a b c
+1 2 11
+2 3 11
+3 4 11
+4 5 8
+5 6 10
+6 7 10
+update t1 set c = 12 where b > 0;
+select * from t1 order by a;
+a b c
+1 2 12
+2 3 12
+3 4 12
+4 5 12
+5 6 12
+6 7 12
+update t1 set c = 13 where b <= 3;
+select * from t1 order by a;
+a b c
+1 2 13
+2 3 13
+3 4 12
+4 5 12
+5 6 12
+6 7 12
+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;
+a b c
+1 2 13
+3 4 12
+4 5 12
+5 6 12
+6 7 12
+delete from t1 where b >= 6;
+select * from t1 order by a;
+a b c
+1 2 13
+3 4 12
+4 5 12
+delete from t1 where b < 4;
+select * from t1 order by a;
+a b c
+3 4 12
+4 5 12
+delete from t1 where b > 5;
+select * from t1 order by a;
+a b c
+3 4 12
+4 5 12
+delete from t1 where b <= 4;
+select * from t1 order by a;
+a b c
+4 5 12
+drop table t1;
+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;
+a b c
+1 2 13
+2 3 13
+3 4 12
+4 5 12
+5 6 12
+6 7 12
+7 2 1
+8 3 6
+9 4 12
+14 5 4
+15 5 5
+16 5 6
+17 4 4
+18 1 7
+select * from t1 where b<=5 order by a;
+a b c
+1 2 13
+2 3 13
+3 4 12
+4 5 12
+7 2 1
+8 3 6
+9 4 12
+14 5 4
+15 5 5
+16 5 6
+17 4 4
+18 1 7
+select * from t1 where b<=5 and c=0;
+a b c
+insert into t1 values (19,4, 0);
+select * from t1 where b<=5 and c=0;
+a b c
+19 4 0
+select * from t1 where b=4 and c<=5 order by a;
+a b c
+17 4 4
+19 4 0
+select * from t1 where b<=4 and c<=5 order by a;
+a b c
+7 2 1
+17 4 4
+19 4 0
+select * from t1 where b<=5 and c=0 or b<=5 and c=2;
+a b c
+19 4 0
+drop table t1;
diff --git a/mysql-test/r/ndb_index_unique.result b/mysql-test/r/ndb_index_unique.result
new file mode 100644
index 00000000000..ed97e0b110a
--- /dev/null
+++ b/mysql-test/r/ndb_index_unique.result
@@ -0,0 +1,413 @@
+drop table if exists t1, t2, t3, t4, t5, t6, t7;
+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;
+a b c
+1 2 3
+2 3 5
+3 4 6
+4 5 8
+5 6 2
+6 7 2
+select * from t1 where b = 4 order by b;
+a b c
+3 4 6
+insert into t1 values(7,8,3);
+select * from t1 where b = 4 order by a;
+a b c
+3 4 6
+drop table t1;
+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;
+a b c
+3 4 6
+select * from t2 where b = 4;
+a b c
+3 4 6
+select * from t2 where c = 6;
+a b c
+3 4 6
+insert into t2 values(7,8,3);
+select * from t2 where b = 4 order by a;
+a b c
+3 4 6
+drop table t2;
+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;
+a b c
+3 4 6
+select * from t3 where b = 4;
+a b c
+3 4 6
+select * from t3 where c = 6;
+a b c
+3 4 6
+insert into t3 values(7,8,3);
+select * from t3 where b = 4 order by a;
+a b c
+3 4 6
+drop table t3;
+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';
+cid cv
+8 dummy
+select * from t1 where cv = 'test';
+cid cv
+select * from t4 where uid = 1 and gid=1 and rid=2 and cid=4;
+uid gid rid cid
+1 1 2 4
+select * from t4 where uid = 1 and gid=1 and rid=1 and cid=4;
+uid gid rid cid
+select * from t4 where uid = 1 order by cid;
+uid gid rid cid
+1 1 2 3
+1 1 2 4
+1 1 5 7
+1 1 10 8
+select * from t4 where rid = 2 order by cid;
+uid gid rid cid
+1 1 2 3
+1 1 2 4
+select * from t6 where un='test' and uc=8;
+uid un uc
+1 test 8
+select * from t6 where un='test' and uc=7;
+uid un uc
+select * from t6 where un='test';
+uid un uc
+1 test 8
+select * from t7 where mid = 8;
+mid uid gid rid cid
+8 3 1 1 8
+select * from t7 where uid = 8;
+mid uid gid rid cid
+select * from t7 where uid = 1 order by mid;
+mid uid gid rid cid
+1 1 1 1 1
+6 1 1 1 6
+select * from t7 where uid = 4 order by mid;
+mid uid gid rid cid
+4 4 1 1 1
+9 4 1 1 9
+select * from t7 where gid = 4;
+mid uid gid rid cid
+select * from t7 where gid = 1 order by mid;
+mid uid gid rid cid
+1 1 1 1 1
+2 2 1 1 1
+3 3 1 1 1
+4 4 1 1 1
+5 5 1 1 1
+6 1 1 1 6
+7 2 1 1 7
+8 3 1 1 8
+9 4 1 1 9
+10 5 1 1 10
+select * from t7 where cid = 4;
+mid uid gid rid cid
+select * from t7 where cid = 8;
+mid uid gid rid cid
+8 3 1 1 8
+select * from t4 where uid = 1 and gid=1 and rid=2 and cid=4;
+uid gid rid cid
+1 1 2 4
+select * from t4 where uid = 1 and gid=1 and rid=1 and cid=4;
+uid gid rid cid
+select * from t4 where uid = 1 order by gid,cid;
+uid gid rid cid
+1 1 2 3
+1 1 2 4
+1 1 5 7
+1 1 10 8
+1 1 5 12
+1 2 5 12
+1 3 9 11
+1 3 5 12
+1 4 5 12
+1 5 5 12
+1 6 5 12
+1 7 5 12
+1 8 5 12
+1 9 5 12
+1 10 5 12
+1 11 5 12
+1 12 5 12
+1 13 5 12
+1 14 5 12
+1 15 5 12
+1 16 5 12
+1 17 5 12
+1 18 5 12
+1 19 5 12
+1 20 5 12
+1 21 5 12
+1 22 5 12
+1 23 5 12
+1 24 5 12
+1 25 5 12
+1 26 5 12
+1 27 5 12
+1 28 5 12
+1 29 5 12
+1 30 5 12
+1 31 5 12
+1 32 5 12
+1 33 5 12
+1 34 5 12
+1 35 5 12
+1 36 5 12
+1 37 5 12
+1 38 5 12
+1 39 5 12
+1 40 5 12
+1 41 5 12
+1 42 5 12
+1 43 5 12
+1 44 5 12
+1 45 5 12
+1 46 5 12
+1 47 5 12
+1 48 5 12
+1 49 5 12
+1 50 5 12
+1 51 5 12
+1 52 5 12
+1 53 5 12
+1 54 5 12
+1 55 5 12
+1 56 5 12
+1 57 5 12
+1 58 5 12
+1 59 5 12
+1 60 5 12
+1 61 5 12
+1 62 5 12
+1 63 5 12
+1 64 5 12
+1 65 5 12
+1 66 5 12
+1 67 5 12
+1 68 5 12
+1 69 5 12
+1 70 5 12
+1 71 5 12
+1 72 5 12
+1 73 5 12
+1 74 5 12
+1 75 5 12
+1 76 5 12
+1 77 5 12
+1 78 5 12
+1 79 5 12
+1 80 5 12
+1 81 5 12
+1 82 5 12
+1 83 5 12
+1 84 5 12
+1 85 5 12
+1 86 5 12
+1 87 5 12
+1 88 5 12
+1 89 5 12
+1 90 5 12
+1 91 5 12
+1 92 5 12
+1 93 5 12
+1 94 5 12
+1 95 5 12
+1 96 5 12
+1 97 5 12
+1 98 5 12
+1 99 5 12
+1 100 5 12
+select * from t4 where uid = 1 order by gid,cid;
+uid gid rid cid
+1 1 2 3
+1 1 2 4
+1 1 5 7
+1 1 10 8
+1 1 5 12
+1 2 5 12
+1 3 9 11
+1 3 5 12
+1 4 5 12
+1 5 5 12
+1 6 5 12
+1 7 5 12
+1 8 5 12
+1 9 5 12
+1 10 5 12
+1 11 5 12
+1 12 5 12
+1 13 5 12
+1 14 5 12
+1 15 5 12
+1 16 5 12
+1 17 5 12
+1 18 5 12
+1 19 5 12
+1 20 5 12
+1 21 5 12
+1 22 5 12
+1 23 5 12
+1 24 5 12
+1 25 5 12
+1 26 5 12
+1 27 5 12
+1 28 5 12
+1 29 5 12
+1 30 5 12
+1 31 5 12
+1 32 5 12
+1 33 5 12
+1 34 5 12
+1 35 5 12
+1 36 5 12
+1 37 5 12
+1 38 5 12
+1 39 5 12
+1 40 5 12
+1 41 5 12
+1 42 5 12
+1 43 5 12
+1 44 5 12
+1 45 5 12
+1 46 5 12
+1 47 5 12
+1 48 5 12
+1 49 5 12
+1 50 5 12
+1 51 5 12
+1 52 5 12
+1 53 5 12
+1 54 5 12
+1 55 5 12
+1 56 5 12
+1 57 5 12
+1 58 5 12
+1 59 5 12
+1 60 5 12
+1 61 5 12
+1 62 5 12
+1 63 5 12
+1 64 5 12
+1 65 5 12
+1 66 5 12
+1 67 5 12
+1 68 5 12
+1 69 5 12
+1 70 5 12
+1 71 5 12
+1 72 5 12
+1 73 5 12
+1 74 5 12
+1 75 5 12
+1 76 5 12
+1 77 5 12
+1 78 5 12
+1 79 5 12
+1 80 5 12
+1 81 5 12
+1 82 5 12
+1 83 5 12
+1 84 5 12
+1 85 5 12
+1 86 5 12
+1 87 5 12
+1 88 5 12
+1 89 5 12
+1 90 5 12
+1 91 5 12
+1 92 5 12
+1 93 5 12
+1 94 5 12
+1 95 5 12
+1 96 5 12
+1 97 5 12
+1 98 5 12
+1 99 5 12
+1 100 5 12
+select * from t4 where rid = 2 order by cid;
+uid gid rid cid
+1 1 2 3
+1 1 2 4
+drop table t1,t2,t3,t4,t5,t6,t7;
diff --git a/mysql-test/r/ndb_insert.result b/mysql-test/r/ndb_insert.result
new file mode 100644
index 00000000000..93f46c85499
--- /dev/null
+++ b/mysql-test/r/ndb_insert.result
@@ -0,0 +1,419 @@
+DROP TABLE IF EXISTS t1;
+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;
+pk1 b c
+0 0 0
+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;
+COUNT(*)
+501
+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;
+COUNT(*)
+2000
+DROP TABLE t1;
diff --git a/mysql-test/r/ndb_minmax.result b/mysql-test/r/ndb_minmax.result
new file mode 100644
index 00000000000..cc0c238ac6e
--- /dev/null
+++ b/mysql-test/r/ndb_minmax.result
@@ -0,0 +1,120 @@
+drop table if exists t1, t2;
+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;
+MAX(a)
+6
+select MAX(a) from t1;
+MAX(a)
+6
+select MAX(a) from t1;
+MAX(a)
+6
+select MAX(a) from t1;
+MAX(a)
+6
+select MIN(a) from t1;
+MIN(a)
+1
+select MIN(a) from t1;
+MIN(a)
+1
+select MIN(a) from t1;
+MIN(a)
+1
+select * from t1 order by a;
+a
+1
+2
+3
+4
+5
+6
+select MIN(a) from t1;
+MIN(a)
+1
+select MAX(a) from t1;
+MAX(a)
+6
+select MAX(a) from t1;
+MAX(a)
+6
+select * from t1 order by a;
+a
+1
+2
+3
+4
+5
+6
+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;
+MAX(a)
+8
+select MAX(b) from t2;
+MAX(b)
+10
+select MAX(c) from t2;
+MAX(c)
+10
+select MIN(a) from t2;
+MIN(a)
+1
+select MIN(b) from t2;
+MIN(b)
+2
+select MIN(c) from t2;
+MIN(c)
+1
+select * from t2 order by a;
+a b c
+1 5 1
+2 2 7
+3 3 3
+4 4 4
+5 5 5
+6 6 6
+7 2 10
+8 10 2
+select MIN(b) from t2;
+MIN(b)
+2
+select MAX(a) from t2;
+MAX(a)
+8
+select MAX(c) from t2;
+MAX(c)
+10
+select * from t2 order by a;
+a b c
+1 5 1
+2 2 7
+3 3 3
+4 4 4
+5 5 5
+6 6 6
+7 2 10
+8 10 2
+drop table t2;
diff --git a/mysql-test/r/ndb_replace.result b/mysql-test/r/ndb_replace.result
new file mode 100644
index 00000000000..45af0f7fcb5
--- /dev/null
+++ b/mysql-test/r/ndb_replace.result
@@ -0,0 +1,21 @@
+drop table if exists t1;
+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);
+insert into t1 (gesuchnr,benutzer_id) values (1,1);
+ERROR 23000: Can't write; duplicate key in table 't1'
+replace into t1 (gesuchnr,benutzer_id) values (1,1);
+select * from t1 order by gesuchnr;
+gesuchnr benutzer_id
+1 1
+2 1
+3 2
+drop table t1;
diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result
index 7391f4192bf..1d76fbf2fb3 100644
--- a/mysql-test/r/null.result
+++ b/mysql-test/r/null.result
@@ -97,39 +97,39 @@ Warnings:
Warning 1265 Data truncated for column 'd' at row 1
UPDATE t1 SET d=NULL;
Warnings:
-Warning 1263 Data truncated, NULL supplied to NOT NULL column 'd' at row 1
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'd' at row 1
INSERT INTO t1 (a) values (null);
ERROR 23000: Column 'a' cannot be null
INSERT INTO t1 (a) values (1/null);
ERROR 23000: Column 'a' cannot be null
INSERT INTO t1 (a) values (null),(null);
Warnings:
-Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 1
-Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 2
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 2
INSERT INTO t1 (b) values (null);
ERROR 23000: Column 'b' cannot be null
INSERT INTO t1 (b) values (1/null);
ERROR 23000: Column 'b' cannot be null
INSERT INTO t1 (b) values (null),(null);
Warnings:
-Warning 1263 Data truncated, NULL supplied to NOT NULL column 'b' at row 1
-Warning 1263 Data truncated, NULL supplied to NOT NULL column 'b' at row 2
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'b' at row 1
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'b' at row 2
INSERT INTO t1 (c) values (null);
ERROR 23000: Column 'c' cannot be null
INSERT INTO t1 (c) values (1/null);
ERROR 23000: Column 'c' cannot be null
INSERT INTO t1 (c) values (null),(null);
Warnings:
-Warning 1263 Data truncated, NULL supplied to NOT NULL column 'c' at row 1
-Warning 1263 Data truncated, NULL supplied to NOT NULL column 'c' at row 2
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'c' at row 1
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'c' at row 2
INSERT INTO t1 (d) values (null);
ERROR 23000: Column 'd' cannot be null
INSERT INTO t1 (d) values (1/null);
ERROR 23000: Column 'd' cannot be null
INSERT INTO t1 (d) values (null),(null);
Warnings:
-Warning 1263 Data truncated, NULL supplied to NOT NULL column 'd' at row 1
-Warning 1263 Data truncated, NULL supplied to NOT NULL column 'd' at row 2
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'd' at row 1
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'd' at row 2
select * from t1;
a b c d
0 0000-00-00 00:00:00 0
diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result
index 11413204950..3044b188d06 100644
--- a/mysql-test/r/null_key.result
+++ b/mysql-test/r/null_key.result
@@ -337,7 +337,7 @@ index (id2)
);
insert into t1 values(null,null),(1,1);
Warnings:
-Warning 1263 Data truncated, NULL supplied to NOT NULL column 'id2' at row 1
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'id2' at row 1
select * from t1;
id id2
NULL 0
diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result
index 4cf6bee6123..a87d0c33559 100644
--- a/mysql-test/r/openssl_1.result
+++ b/mysql-test/r/openssl_1.result
@@ -10,22 +10,22 @@ select * from t1;
f1
5
delete from t1;
-ERROR 42000: Access denied for user: 'ssl_user1'@'localhost' to database 'test'
+ERROR 42000: Access denied for user 'ssl_user1'@'localhost' to database 'test'
select * from t1;
f1
5
delete from t1;
-ERROR 42000: Access denied for user: 'ssl_user2'@'localhost' to database 'test'
+ERROR 42000: Access denied for user 'ssl_user2'@'localhost' to database 'test'
select * from t1;
f1
5
delete from t1;
-ERROR 42000: Access denied for user: 'ssl_user3'@'localhost' to database 'test'
+ERROR 42000: Access denied for user 'ssl_user3'@'localhost' to database 'test'
select * from t1;
f1
5
delete from t1;
-ERROR 42000: Access denied for user: 'ssl_user4'@'localhost' to database 'test'
+ERROR 42000: Access denied for user 'ssl_user4'@'localhost' to database 'test'
delete from mysql.user where user='ssl_user%';
delete from mysql.db where user='ssl_user%';
flush privileges;
diff --git a/mysql-test/r/packet.result b/mysql-test/r/packet.result
index 5729d7af166..29bbcf4466f 100644
--- a/mysql-test/r/packet.result
+++ b/mysql-test/r/packet.result
@@ -12,7 +12,7 @@ select @@net_buffer_length, @@max_allowed_packet;
@@net_buffer_length @@max_allowed_packet
1024 1024
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
-ERROR 08S01: Got a packet bigger than 'max_allowed_packet'
+ERROR 08S01: Got a packet bigger than 'max_allowed_packet' bytes
set global max_allowed_packet=default;
set max_allowed_packet=default;
set global net_buffer_length=default;
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
new file mode 100644
index 00000000000..27f4ce7f815
--- /dev/null
+++ b/mysql-test/r/ps.result
@@ -0,0 +1,221 @@
+drop table if exists t1,t2;
+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');
+set @a=2;
+prepare stmt1 from 'select * from t1 where a <= ?';
+execute stmt1 using @a;
+a b
+1 one
+2 two
+set @a=3;
+execute stmt1 using @a;
+a b
+1 one
+2 two
+3 three
+deallocate prepare no_such_statement;
+ERROR HY000: Unknown prepared statement handler (no_such_statement) given to DEALLOCATE PREPARE
+execute stmt1;
+ERROR HY000: Incorrect arguments to EXECUTE
+prepare stmt2 from 'prepare nested_stmt from "select 1"';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"select 1"' at line 1
+prepare stmt2 from 'execute stmt1';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'stmt1' at line 1
+prepare stmt2 from 'deallocate prepare z';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'z' at line 1
+prepare stmt3 from 'insert into t1 values (?,?)';
+set @arg1=5, @arg2='five';
+execute stmt3 using @arg1, @arg2;
+select * from t1 where a>3;
+a b
+4 four
+5 five
+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;
+a b
+4 four
+55 five
+prepare stmt4 from 'create table t2 (a int)';
+execute stmt4;
+prepare stmt4 from 'drop table t2';
+execute stmt4;
+execute stmt4;
+ERROR 42S02: Unknown table 't2'
+prepare stmt5 from 'select ? + a from t1';
+set @a=1;
+execute stmt5 using @a;
+? + a
+2
+3
+4
+5
+56
+execute stmt5 using @no_such_var;
+? + a
+NULL
+NULL
+NULL
+NULL
+NULL
+set @nullvar=1;
+set @nullvar=NULL;
+execute stmt5 using @nullvar;
+? + a
+NULL
+NULL
+NULL
+NULL
+NULL
+set @nullvar2=NULL;
+execute stmt5 using @nullvar2;
+? + a
+NULL
+NULL
+NULL
+NULL
+NULL
+prepare stmt6 from 'select 1; select2';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; select2' at line 1
+prepare stmt6 from 'insert into t1 values (5,"five"); select2';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; select2' at line 1
+explain prepare stmt6 from 'insert into t1 values (5,"five"); select2';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from 'insert into t1 values (5,"five"); select2'' at line 1
+create table t2
+(
+a int
+);
+insert into t2 values (0);
+set @arg00=NULL ;
+prepare stmt1 from 'select 1 FROM t2 where a=?' ;
+execute stmt1 using @arg00 ;
+1
+prepare stmt1 from @nosuchvar;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NULL' at line 1
+set @ivar= 1234;
+prepare stmt1 from @ivar;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1234' at line 1
+set @fvar= 123.4567;
+prepare stmt1 from @fvar;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '123.4567' at line 1
+set @str1 = 'select ?';
+set @str2 = convert(@str1 using ucs2);
+prepare stmt1 from @str2;
+execute stmt1 using @ivar;
+?
+1234
+drop table t1,t2;
+PREPARE stmt1 FROM "select _utf8 'A' collate utf8_bin = ?";
+set @var='A';
+EXECUTE stmt1 USING @var;
+_utf8 'A' collate utf8_bin = ?
+1
+DEALLOCATE PREPARE stmt1;
+create table t1 (id int);
+prepare stmt1 from "select FOUND_ROWS()";
+select SQL_CALC_FOUND_ROWS * from t1;
+id
+execute stmt1;
+FOUND_ROWS()
+0
+insert into t1 values (1);
+select SQL_CALC_FOUND_ROWS * from t1;
+id
+1
+execute stmt1;
+FOUND_ROWS()
+1
+execute stmt1;
+FOUND_ROWS()
+0
+deallocate prepare stmt1;
+drop table t1;
+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 ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+5 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
+4 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
+3 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
+2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
+execute stmt1 ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+5 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
+4 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
+3 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
+2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
+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;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+5 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
+4 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
+3 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
+2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
+deallocate prepare stmt1;
+drop tables t1,t2;
+set @arg00=1;
+prepare stmt1 from ' create table t1 (m int) as select 1 as m ' ;
+execute stmt1 ;
+select m from t1;
+m
+1
+drop table t1;
+prepare stmt1 from ' create table t1 (m int) as select ? as m ' ;
+execute stmt1 using @arg00;
+select m from t1;
+m
+1
+deallocate prepare stmt1;
+drop table t1;
+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;
+name
+1
+6
+select name from t1 where id=1 or id=6;
+name
+1
+6
+deallocate prepare stmt1;
+drop table t1;
+create table t1 ( a int primary key, b varchar(30)) engine = MYISAM ;
+prepare stmt1 from ' show table status from test like ''t1%'' ';
+execute stmt1;
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 MyISAM 9 Dynamic 0 0 0 4294967295 1024 0 NULL # # # latin1_swedish_ci NULL
+show table status from test like 't1%' ;
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 MyISAM 9 Dynamic 0 0 0 4294967295 1024 0 NULL # # # latin1_swedish_ci NULL
+deallocate prepare stmt1 ;
+drop table t1;
diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result
new file mode 100644
index 00000000000..52b887e2795
--- /dev/null
+++ b/mysql-test/r/ps_1general.result
@@ -0,0 +1,745 @@
+use test;
+test_sequence
+------ basic tests ------
+drop table if exists t1, t_many_col_types ;
+create table t1
+(
+a int, b varchar(30),
+primary key(a)
+) engine = 'MYISAM' ;
+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 = 'MYISAM' ;
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+PREPARE stmt FROM ' select * from t1 where a = ? ' ;
+SET @var= 2 ;
+EXECUTE stmt USING @var ;
+a b
+2 two
+select * from t1 where a = @var ;
+a b
+2 two
+DEALLOCATE PREPARE stmt ;
+prepare stmt1 from ' select 1 as my_col ' ;
+prepare stmt1 from ' select ? as my_col ' ;
+prepare ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
+prepare stmt1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
+prepare stmt1 from ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
+prepare_garbage stmt1 from ' select 1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'prepare_garbage stmt1 from ' select 1 '' at line 1
+prepare stmt1 from_garbage ' select 1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from_garbage ' select 1 '' at line 1
+prepare stmt1 from ' select_garbage 1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select_garbage 1' at line 1
+prepare from ' select 1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from ' select 1 '' at line 1
+prepare stmt1 ' select 1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' select 1 '' at line 1
+prepare ? from ' select ? as my_col ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? from ' select ? as my_col '' at line 1
+set @arg00='select 1 as my_col';
+prepare stmt1 from @arg00;
+set @arg00='';
+prepare stmt1 from @arg00;
+ERROR 42000: Query was empty
+set @arg00=NULL;
+prepare stmt1 from @arg01;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NULL' at line 1
+prepare stmt1 from ' select * from t1 where a <= 2 ' ;
+prepare stmt1 from ' select * from t1 where x <= 2 ' ;
+ERROR 42S22: Unknown column 'x' in 'where clause'
+drop table if exists not_exist ;
+prepare stmt1 from ' select * from not_exist where a <= 2 ' ;
+ERROR 42S02: Table 'test.not_exist' doesn't exist
+prepare stmt1 from ' insert into t1 values(? ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
+prepare stmt1 from ' select a, b from t1
+ where a=? and where ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where' at line 2
+execute never_prepared ;
+ERROR HY000: Unknown prepared statement handler (never_prepared) given to EXECUTE
+prepare stmt1 from ' select * from t1 where a <= 2 ' ;
+prepare stmt1 from ' select * from not_exist where a <= 2 ' ;
+ERROR 42S02: Table 'test.not_exist' doesn't exist
+execute stmt1 ;
+ERROR HY000: Unknown prepared statement handler (stmt1) given to 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 ;
+a b c
+1 original table 1
+drop table to_be_dropped ;
+execute stmt2 ;
+ERROR 42S02: Table 'test.to_be_dropped' doesn't exist
+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 ;
+a b c
+9 recreated table 9
+drop table to_be_dropped ;
+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 ;
+a b c
+9 recreated table 9
+drop table to_be_dropped ;
+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 ;
+a b c
+9 recreated table 9
+drop table to_be_dropped ;
+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 ;
+a b c
+9 recreated table 9
+drop table to_be_dropped ;
+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 ;
+a b c
+2004-02-29 18:01:59 recreated table 9
+drop table to_be_dropped ;
+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);
+execute stmt2 ;
+ERROR 42S22: Unknown column 'to_be_dropped.a' in 'field list'
+drop table to_be_dropped ;
+prepare stmt1 from ' select * from t1 where a <= 2 ' ;
+execute stmt1 ;
+a b
+1 one
+2 two
+set @arg00=1 ;
+set @arg01='two' ;
+prepare stmt1 from ' select * from t1 where a <= ? ' ;
+execute stmt1 using @arg00;
+a b
+1 one
+execute stmt1 ;
+ERROR HY000: Incorrect arguments to EXECUTE
+execute stmt1 using @arg00, @arg01;
+ERROR HY000: Incorrect arguments to EXECUTE
+execute stmt1 using @not_set;
+a b
+deallocate prepare never_prepared ;
+ERROR HY000: Unknown prepared statement handler (never_prepared) given to DEALLOCATE PREPARE
+prepare stmt1 from ' select * from t1 where a <= 2 ' ;
+prepare stmt1 from ' select * from not_exist where a <= 2 ' ;
+ERROR 42S02: Table 'test.not_exist' doesn't exist
+deallocate prepare stmt1;
+ERROR HY000: Unknown prepared statement handler (stmt1) given to DEALLOCATE PREPARE
+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 prepare stmt2;
+prepare stmt1 from ' select a from t1 where a <= 2 ' ;
+prepare stmt2 from ' select b from t1 where a <= 2 ' ;
+execute stmt2 ;
+b
+one
+two
+execute stmt1 ;
+a
+1
+2
+prepare stmt1 from ' select a from t1 where a <= 2 ' ;
+prepare stmt2 from ' select a from t1 where a <= 2 ' ;
+execute stmt2 ;
+a
+1
+2
+execute stmt1 ;
+a
+1
+2
+deallocate prepare stmt1 ;
+execute stmt2 ;
+a
+1
+2
+test_sequence
+------ show and misc tests ------
+drop table if exists t2;
+create table t2
+(
+a int primary key, b char(10)
+);
+prepare stmt4 from ' show databases ';
+execute stmt4;
+Database
+mysql
+test
+prepare stmt4 from ' show tables from test like ''t2%'' ';
+execute stmt4;
+Tables_in_test (t2%)
+t2
+prepare stmt4 from ' show columns from t2 from test like ''a%'' ';
+execute stmt4;
+Field Type Null Key Default Extra
+a int(11) PRI 0
+create index t2_idx on t2(b);
+prepare stmt4 from ' show index from t2 from test ';
+execute stmt4;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t2 0 PRIMARY 1 a A 0 NULL NULL BTREE
+t2 1 t2_idx 1 b A NULL NULL NULL YES BTREE
+prepare stmt4 from ' show table status from test like ''t2%'' ';
+execute stmt4;
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t2 MyISAM 9 Fixed 0 0 0 64424509439 1024 0 NULL # # # latin1_swedish_ci NULL
+prepare stmt4 from ' show table status from test like ''t_many_col_types%'' ';
+execute stmt4;
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t_many_col_types MyISAM 9 Dynamic 2 220 440 4294967295 2048 0 NULL # # # latin1_swedish_ci NULL
+prepare stmt4 from ' show status like ''Threads_running'' ';
+execute stmt4;
+Variable_name Value
+Threads_running 1
+prepare stmt4 from ' show variables like ''sql_mode'' ';
+execute stmt4;
+Variable_name Value
+sql_mode
+prepare stmt4 from ' show engine bdb logs ';
+execute stmt4;
+prepare stmt4 from ' show full processlist ';
+execute stmt4;
+Id User Host db Command Time State Info
+number root localhost test Query 0 NULL show full processlist
+prepare stmt4 from ' show grants for user ';
+prepare stmt4 from ' show create table t2 ';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt4 from ' show master status ';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt4 from ' show master logs ';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt4 from ' show slave status ';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt4 from ' show warnings limit 20 ';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt4 from ' show errors limit 20 ';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt4 from ' show storage engines ';
+execute stmt4;
+Engine Support Comment
+MyISAM YES/NO Default type from 3.23 with great performance
+HEAP YES/NO Hash based, stored in memory, useful for temporary tables
+MEMORY YES/NO Alias for HEAP
+MERGE YES/NO Collection of identical MyISAM tables
+MRG_MYISAM YES/NO Alias for MERGE
+ISAM YES/NO Obsolete table type; Is replaced by MyISAM
+MRG_ISAM YES/NO Obsolete table type; Is replaced by MRG_MYISAM
+InnoDB YES/NO Supports transactions, row-level locking and foreign keys
+INNOBASE YES/NO Alias for INNODB
+BDB YES/NO Supports transactions and page-level locking
+BERKELEYDB YES/NO Alias for BDB
+NDBCLUSTER YES/NO Clustered, fault tolerant memory based tables
+NDB YES/NO Alias for NDBCLUSTER
+EXAMPLE YES/NO Example storage engine
+ARCHIVE YES/NO Archive storage engine
+drop table if exists tx;
+prepare stmt1 from ' drop table if exists tx ' ;
+execute stmt1 ;
+Warnings:
+Note 1051 Unknown table 'tx'
+prepare stmt1 from ' drop table tx ' ;
+execute stmt1 ;
+ERROR 42S02: Unknown table 'tx'
+prepare stmt1 from ' prepare stmt2 from '' select 1 '' ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' select 1 '' at line 1
+prepare stmt1 from ' execute stmt2 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'stmt2' at line 1
+prepare stmt1 from ' deallocate prepare never_prepared ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'never_prepared' at line 1
+prepare stmt4 from ' use test ' ;
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt3 from ' create database drop_me ';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+create database drop_me ;
+prepare stmt3 from ' drop database drop_me ';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+drop database drop_me ;
+prepare stmt3 from ' grant all on test.t1 to drop_user@localhost
+identified by ''looser'' ';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+grant all on test.t1 to drop_user@localhost
+identified by 'looser' ;
+prepare stmt3 from ' revoke all privileges on test.t1 from
+drop_user@localhost ';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+revoke all privileges on test.t1 from drop_user@localhost ;
+prepare stmt3 from ' drop user drop_user@localhost ';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+drop user drop_user@localhost;
+prepare stmt3 from ' describe t2 ';
+execute stmt3;
+Field Type Null Key Default Extra
+a int(11) PRI 0
+b char(10) YES MUL NULL
+drop table t2 ;
+execute stmt3;
+ERROR 42S02: Table 'test.t2' doesn't exist
+prepare stmt3 from ' lock tables t1 read ' ;
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt3 from ' unlock tables ' ;
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt1 from ' load data infile ''data.txt''
+into table t1 fields terminated by ''\t'' ';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt1 from ' select * into outfile ''data.txt'' from t1 ';
+execute stmt1 ;
+prepare stmt1 from ' optimize table t1 ' ;
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt1 from ' analyze table t1 ' ;
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt1 from ' checksum table t1 ' ;
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt1 from ' repair table t1 ' ;
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt1 from ' restore table t1 from ''data.txt'' ' ;
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt1 from ' handler t1 open ';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt3 from ' commit ' ;
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt3 from ' rollback ' ;
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt4 from ' SET sql_mode=ansi ';
+execute stmt4;
+select 'a' || 'b' ;
+'a' || 'b'
+ab
+prepare stmt4 from ' SET sql_mode="" ';
+execute stmt4;
+select 'a' || 'b' ;
+'a' || 'b'
+0
+prepare stmt5 from ' select ''a'' || ''b'' ' ;
+execute stmt5;
+'a' || 'b'
+0
+SET sql_mode=ansi;
+execute stmt5;
+'a' || 'b'
+0
+SET sql_mode="";
+prepare stmt1 from ' flush local privileges ' ;
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt1 from ' reset query cache ' ;
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt1 from ' KILL 0 ';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt1 from ' explain select a from t1 order by b ';
+execute stmt1;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def id 8 3 1 N 32801 0 8
+def select_type 253 19 6 N 1 31 63
+def table 253 64 2 N 1 31 63
+def type 253 10 3 N 1 31 63
+def possible_keys 253 4096 0 Y 0 31 63
+def key 253 64 0 Y 0 31 63
+def key_len 253 4096 0 Y 0 31 63
+def ref 253 1024 0 Y 0 31 63
+def rows 8 10 1 N 32801 0 8
+def Extra 253 255 14 N 1 31 63
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using filesort
+SET @arg00=1 ;
+prepare stmt1 from ' explain select a from t1 where a > ? order by b ';
+execute stmt1 using @arg00;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def id 8 3 1 N 32801 0 8
+def select_type 253 19 6 N 1 31 63
+def table 253 64 2 N 1 31 63
+def type 253 10 5 N 1 31 63
+def possible_keys 253 4096 7 Y 0 31 63
+def key 253 64 7 Y 0 31 63
+def key_len 253 4096 1 Y 0 31 63
+def ref 253 1024 0 Y 0 31 63
+def rows 8 10 1 N 32801 0 8
+def Extra 253 255 27 N 1 31 63
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 Using where; Using filesort
+test_sequence
+------ create/drop/alter/rename tests ------
+drop table if exists t2, t3;
+prepare stmt_drop from ' drop table if exists t2 ' ;
+execute stmt_drop;
+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 ' ;
+execute stmt3 using @arg00;
+select m from t3;
+m
+1
+drop table t3;
+prepare stmt3 from ' create index t2_idx on t2(b) ';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt3 from ' drop index t2_idx on t2 ' ;
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt3 from ' alter table t2 drop primary key ';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+drop table if exists new_t2;
+prepare stmt3 from ' rename table t2 to new_t2 ';
+execute stmt3;
+execute stmt3;
+ERROR 42S01: Table 'new_t2' already exists
+rename table new_t2 to t2;
+drop table t2;
+test_sequence
+------ big statement tests ------
+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 ;
+my_const_col
+ABC
+ABC
+ABC
+ABC
+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 ;
+my_const_col
+ABC
+ABC
+ABC
+ABC
+execute stmt1 ;
+my_const_col
+ABC
+ABC
+ABC
+ABC
+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' ;
+my_const_col
+ABC
+ABC
+ABC
+ABC
+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 ;
+my_const_col
+ABC
+ABC
+ABC
+ABC
+execute stmt1 ;
+my_const_col
+ABC
+ABC
+ABC
+ABC
+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 ;
+my_const_col
+ABC
+ABC
+ABC
+ABC
+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;
+my_const_col
+ABC
+ABC
+ABC
+ABC
+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 ;
+my_const_col
+ABC
+ABC
+ABC
+ABC
+drop table t1 ;
diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result
new file mode 100644
index 00000000000..caac78e09d0
--- /dev/null
+++ b/mysql-test/r/ps_2myisam.result
@@ -0,0 +1,1269 @@
+use test;
+drop table if exists t1, t_many_col_types ;
+create table t1
+(
+a int, b varchar(30),
+primary key(a)
+) engine = 'MYISAM' ;
+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 = 'MYISAM' ;
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+test_sequence
+------ simple select tests ------
+set @arg00='SELECT' ;
+prepare stmt1 from ' ? a from t1 where a=1 ';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1
+set @arg00=1 ;
+select @arg00, b from t1 where a=1 ;
+@arg00 b
+1 one
+prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+? b
+1 one
+set @arg00='lion' ;
+select @arg00, b from t1 where a=1 ;
+@arg00 b
+lion one
+prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+? b
+lion one
+set @arg00=NULL ;
+select @arg00, b from t1 where a=1 ;
+@arg00 b
+NULL one
+prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+? b
+NULL one
+set @arg00=1 ;
+select b, a - @arg00 from t1 where a=1 ;
+b a - @arg00
+one 0
+prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+b a - ?
+one 0
+set @arg00='MySQL' ;
+select substr(@arg00,1,2) from t1 where a=1 ;
+substr(@arg00,1,2)
+My
+prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+substr(?,1,2)
+My
+set @arg00=3 ;
+select substr('MySQL',@arg00,5) from t1 where a=1 ;
+substr('MySQL',@arg00,5)
+SQL
+prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+substr('MySQL',?,5)
+SQL
+select substr('MySQL',1,@arg00) from t1 where a=1 ;
+substr('MySQL',1,@arg00)
+MyS
+prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+substr('MySQL',1,?)
+MyS
+set @arg00='MySQL' ;
+select a , concat(@arg00,b) from t1 ;
+a concat(@arg00,b)
+1 MySQLone
+2 MySQLtwo
+3 MySQLthree
+4 MySQLfour
+prepare stmt1 from ' select a , concat(?,b) from t1 ' ;
+execute stmt1 using @arg00;
+a concat(?,b)
+1 MySQLone
+2 MySQLtwo
+3 MySQLthree
+4 MySQLfour
+select a , concat(b,@arg00) from t1 ;
+a concat(b,@arg00)
+1 oneMySQL
+2 twoMySQL
+3 threeMySQL
+4 fourMySQL
+prepare stmt1 from ' select a , concat(b,?) from t1 ' ;
+execute stmt1 using @arg00;
+a concat(b,?)
+1 oneMySQL
+2 twoMySQL
+3 threeMySQL
+4 fourMySQL
+set @arg00='MySQL' ;
+select group_concat(@arg00,b) from t1
+group by 'a' ;
+group_concat(@arg00,b)
+MySQLone,MySQLtwo,MySQLthree,MySQLfour
+prepare stmt1 from ' select group_concat(?,b) from t1
+group by ''a'' ' ;
+execute stmt1 using @arg00;
+group_concat(?,b)
+MySQLone,MySQLtwo,MySQLthree,MySQLfour
+select group_concat(b,@arg00) from t1
+group by 'a' ;
+group_concat(b,@arg00)
+oneMySQL,twoMySQL,threeMySQL,fourMySQL
+prepare stmt1 from ' select group_concat(b,?) from t1
+group by ''a'' ' ;
+execute stmt1 using @arg00;
+group_concat(b,?)
+oneMySQL,twoMySQL,threeMySQL,fourMySQL
+set @arg00='first' ;
+set @arg01='second' ;
+set @arg02=NULL;
+select @arg00, @arg01 from t1 where a=1 ;
+@arg00 @arg01
+first second
+prepare stmt1 from ' select ?, ? from t1 where a=1 ' ;
+execute stmt1 using @arg00, @arg01 ;
+? ?
+first second
+execute stmt1 using @arg02, @arg01 ;
+? ?
+NULL second
+execute stmt1 using @arg00, @arg02 ;
+? ?
+first NULL
+execute stmt1 using @arg02, @arg02 ;
+? ?
+NULL NULL
+drop table if exists new_tab ;
+create table new_tab (id1 int(11) not null default '0',
+value2 varchar(100), value1 varchar(100)) ;
+insert into new_tab values (1,'hh','hh'),(2,'hh','hh'),
+(1,'ii','ii'),(2,'ii','ii') ;
+prepare stmt1 from ' select id1,value1 from new_tab where id1=? or value1=? ' ;
+set @arg00=1 ;
+set @arg01='hh' ;
+execute stmt1 using @arg00, @arg01 ;
+id1 value1
+1 hh
+2 hh
+1 ii
+drop table new_tab ;
+drop table if exists new_tab ;
+create table new_tab(session_id char(9) not null) ;
+insert into new_tab values ('abc') ;
+prepare stmt1 from ' select * from new_tab
+where ?=''1111'' and session_id = ''abc'' ' ;
+set @arg00='abc' ;
+execute stmt1 using @arg00 ;
+session_id
+set @arg00='1111' ;
+execute stmt1 using @arg00 ;
+session_id
+abc
+set @arg00='abc' ;
+execute stmt1 using @arg00 ;
+session_id
+drop table new_tab ;
+set @arg00='FROM' ;
+select a @arg00 t1 where a=1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1
+prepare stmt1 from ' select a ? t1 where a=1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1
+set @arg00='t1' ;
+select a from @arg00 where a=1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1
+prepare stmt1 from ' select a from ? where a=1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1
+set @arg00='WHERE' ;
+select a from t1 @arg00 a=1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1
+prepare stmt1 from ' select a from t1 ? a=1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1
+set @arg00=1 ;
+select a FROM t1 where a=@arg00 ;
+a
+1
+prepare stmt1 from ' select a FROM t1 where a=? ' ;
+execute stmt1 using @arg00 ;
+a
+1
+set @arg00=1000 ;
+execute stmt1 using @arg00 ;
+a
+set @arg00=NULL ;
+select a FROM t1 where a=@arg00 ;
+a
+prepare stmt1 from ' select a FROM t1 where a=? ' ;
+execute stmt1 using @arg00 ;
+a
+set @arg00=4 ;
+select a FROM t1 where a=sqrt(@arg00) ;
+a
+2
+prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
+execute stmt1 using @arg00 ;
+a
+2
+set @arg00=NULL ;
+select a FROM t1 where a=sqrt(@arg00) ;
+a
+prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
+execute stmt1 using @arg00 ;
+a
+set @arg00=2 ;
+set @arg01=3 ;
+select a FROM t1 where a in (@arg00,@arg01);
+a
+2
+3
+prepare stmt1 from ' select a FROM t1 where a in (?,?) ';
+execute stmt1 using @arg00, @arg01;
+a
+2
+3
+prepare stmt1 from ' select b FROM t1 where b like ? ';
+set @arg00='two' ;
+execute stmt1 using @arg00 ;
+b
+two
+set @arg00='tw%' ;
+execute stmt1 using @arg00 ;
+b
+two
+set @arg00='%wo' ;
+execute stmt1 using @arg00 ;
+b
+two
+set @arg00='>' ;
+select a FROM t1 where a @arg00 1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1
+prepare stmt1 from ' select a FROM t1 where a ? 1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1
+set @arg00=1 ;
+select a,b FROM t1 where a is not NULL
+AND b is not NULL group by a - @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+prepare stmt1 from ' select a,b FROM t1 where a is not NULL
+AND b is not NULL group by a - ? ' ;
+execute stmt1 using @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00='two' ;
+select a,b FROM t1 where a is not NULL
+AND b is not NULL having b <> @arg00 ;
+a b
+1 one
+3 three
+4 four
+prepare stmt1 from ' select a,b FROM t1 where a is not NULL
+AND b is not NULL having b <> ? ' ;
+execute stmt1 using @arg00 ;
+a b
+1 one
+3 three
+4 four
+set @arg00=1 ;
+select a,b FROM t1 where a is not NULL
+AND b is not NULL order by a - @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+prepare stmt1 from ' select a,b FROM t1 where a is not NULL
+AND b is not NULL order by a - ? ' ;
+execute stmt1 using @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00=2 ;
+select a,b from t1 order by 2 ;
+a b
+4 four
+1 one
+3 three
+2 two
+prepare stmt1 from ' select a,b from t1
+order by ? ';
+execute stmt1 using @arg00;
+a b
+4 four
+1 one
+3 three
+2 two
+set @arg00=1;
+prepare stmt1 from ' select a,b from t1
+limit 1 ';
+execute stmt1 ;
+a b
+1 one
+prepare stmt1 from ' select a,b from t1
+limit ? ';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2
+set @arg00='b' ;
+set @arg01=0 ;
+set @arg02=2 ;
+set @arg03=2 ;
+select sum(a), @arg00 from t1 where a > @arg01
+and b is not null group by substr(b,@arg02)
+having sum(a) <> @arg03 ;
+sum(a) @arg00
+3 b
+1 b
+4 b
+prepare stmt1 from ' select sum(a), ? from t1 where a > ?
+and b is not null group by substr(b,?)
+having sum(a) <> ? ';
+execute stmt1 using @arg00, @arg01, @arg02, @arg03;
+sum(a) ?
+3 b
+1 b
+4 b
+test_sequence
+------ join tests ------
+select first.a as a1, second.a as a2
+from t1 first, t1 second
+where first.a = second.a ;
+a1 a2
+1 1
+2 2
+3 3
+4 4
+prepare stmt1 from ' select first.a as a1, second.a as a2
+ from t1 first, t1 second
+ where first.a = second.a ';
+execute stmt1 ;
+a1 a2
+1 1
+2 2
+3 3
+4 4
+set @arg00='ABC';
+set @arg01='two';
+set @arg02='one';
+select first.a, @arg00, second.a FROM t1 first, t1 second
+where @arg01 = first.b or first.a = second.a or second.b = @arg02;
+a @arg00 a
+1 ABC 1
+2 ABC 1
+3 ABC 1
+4 ABC 1
+2 ABC 2
+2 ABC 3
+3 ABC 3
+2 ABC 4
+4 ABC 4
+prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
+ where ? = first.b or first.a = second.a or second.b = ? ';
+execute stmt1 using @arg00, @arg01, @arg02;
+a ? a
+1 ABC 1
+2 ABC 1
+3 ABC 1
+4 ABC 1
+2 ABC 2
+2 ABC 3
+3 ABC 3
+2 ABC 4
+4 ABC 4
+test_sequence
+------ subquery tests ------
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = ''two'') ';
+execute stmt1 ;
+a b
+2 two
+set @arg00='two' ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where b = 'two' ) and b=@arg00 ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = ''two'') and b=? ';
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00='two' ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where b = @arg00 ) and b='two' ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = ? ) and b=''two'' ' ;
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=3 ;
+set @arg01='three' ;
+select a,b FROM t1 where (a,b) in (select 3, 'three');
+a b
+3 three
+select a FROM t1 where (a,b) in (select @arg00,@arg01);
+a
+3
+prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) ';
+execute stmt1 using @arg00, @arg01;
+a
+3
+set @arg00=1 ;
+set @arg01='two' ;
+set @arg02=2 ;
+set @arg03='two' ;
+select a, @arg00, b FROM t1 outer_table where
+b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ;
+a @arg00 b
+2 1 two
+prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
+ b=? and a = (select ? from t1 where b = ? ) ' ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
+a ? b
+2 1 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = outer_table.b ) ';
+execute stmt1 ;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00='two' ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where b = outer_table.b ) and b=@arg00 ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = outer_table.b) and b=? ';
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=2 ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ;
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=2 ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ;
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=1 ;
+set @arg01='two' ;
+set @arg02=2 ;
+set @arg03='two' ;
+select a, @arg00, b FROM t1 outer_table where
+b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03
+and outer_table.a=a ) ;
+a @arg00 b
+2 1 two
+prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
+ b=? and a = (select ? from t1 where outer_table.b = ?
+ and outer_table.a=a ) ' ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
+a ? b
+2 1 two
+set @arg00=1 ;
+set @arg01=0 ;
+select a, @arg00
+from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2
+where a=@arg01;
+a @arg00
+0 1
+prepare stmt1 from ' select a, ?
+ from ( select a - ? as a from t1 where a=? ) as t2
+ where a=? ';
+execute stmt1 using @arg00, @arg00, @arg00, @arg01 ;
+a ?
+0 1
+drop table if exists t2 ;
+create table t2 as select * from t_many_col_types;
+set @stmt= ' SELECT
+ (SELECT SUM(c1 + c12 + 0.0) FROM t2
+ where (t_many_col_types.c2 - 0e-3) = t2.c2
+ GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s,
+ exists (select 1.0e+0 from t2
+ where t2.c3 * 9.0000000000 = t_many_col_types.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 t_many_col_types,
+(select c25 x, c32 y from t2) tt WHERE x = c25 ' ;
+prepare stmt1 from @stmt ;
+execute stmt1 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def scalar_s 5 21 7 Y 32768 4 8
+def exists_s 8 1 1 N 32769 0 8
+def in_s 8 21 1 Y 32768 0 8
+def in_row_s 8 21 1 Y 32768 0 8
+scalar_s exists_s in_s in_row_s
+2.0000 0 1 0
+18.0000 1 0 1
+2.0000 0 1 0
+18.0000 1 0 1
+execute stmt1 ;
+scalar_s exists_s in_s in_row_s
+2.0000 0 1 0
+18.0000 1 0 1
+2.0000 0 1 0
+18.0000 1 0 1
+set @stmt= concat('explain ',@stmt);
+prepare stmt1 from @stmt ;
+execute stmt1 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def id 8 3 1 N 32801 0 8
+def select_type 253 19 18 N 1 31 63
+def table 253 64 16 N 1 31 63
+def type 253 10 3 N 1 31 63
+def possible_keys 253 4096 0 Y 0 31 63
+def key 253 64 0 Y 0 31 63
+def key_len 253 4096 0 Y 0 31 63
+def ref 253 1024 0 Y 0 31 63
+def rows 8 10 1 N 32801 0 8
+def Extra 253 255 44 N 1 31 63
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+execute stmt1 ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+set @stmt= ' SELECT
+ (SELECT SUM(c1+c12+?) FROM t2 where (t_many_col_types.c2-?)=t2.c2
+ GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s,
+ exists (select ? from t2
+ where t2.c3*?=t_many_col_types.c4) as exists_s,
+ c5*? in (select c6+? from t2) as in_s,
+ (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s
+FROM t_many_col_types,
+(select c25 x, c32 y from t2) tt WHERE x =c25 ' ;
+set @arg00= 0.0 ;
+set @arg01= 0e-3 ;
+set @arg02= 1.0e+0 ;
+set @arg03= 9.0000000000 ;
+set @arg04= 4 ;
+set @arg05= 0.3e+1 ;
+set @arg06= 4 ;
+set @arg07= 4 ;
+set @arg08= 4.0 ;
+set @arg09= 40e-1 ;
+prepare stmt1 from @stmt ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def scalar_s 5 23 2 Y 32768 31 8
+def exists_s 8 1 1 N 32769 0 8
+def in_s 8 21 1 Y 32768 0 8
+def in_row_s 8 21 1 Y 32768 0 8
+scalar_s exists_s in_s in_row_s
+2 0 1 0
+18 1 0 1
+2 0 1 0
+18 1 0 1
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+scalar_s exists_s in_s in_row_s
+2 0 1 0
+18 1 0 1
+2 0 1 0
+18 1 0 1
+set @stmt= concat('explain ',@stmt);
+prepare stmt1 from @stmt ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def id 8 3 1 N 32801 0 8
+def select_type 253 19 18 N 1 31 63
+def table 253 64 16 N 1 31 63
+def type 253 10 3 N 1 31 63
+def possible_keys 253 4096 0 Y 0 31 63
+def key 253 64 0 Y 0 31 63
+def key_len 253 4096 0 Y 0 31 63
+def ref 253 1024 0 Y 0 31 63
+def rows 8 10 1 N 32801 0 8
+def Extra 253 255 44 N 1 31 63
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+drop table t2 ;
+test_sequence
+------ union tests ------
+prepare stmt1 from ' select a FROM t1 where a=1
+ union distinct
+ select a FROM t1 where a=1 ';
+execute stmt1 ;
+a
+1
+execute stmt1 ;
+a
+1
+prepare stmt1 from ' select a FROM t1 where a=1
+ union all
+ select a FROM t1 where a=1 ';
+execute stmt1 ;
+a
+1
+1
+set @arg00=1 ;
+select @arg00 FROM t1 where a=1
+union distinct
+select 1 FROM t1 where a=1;
+@arg00
+1
+prepare stmt1 from ' select ? FROM t1 where a=1
+ union distinct
+ select 1 FROM t1 where a=1 ' ;
+execute stmt1 using @arg00;
+?
+1
+set @arg00=1 ;
+select 1 FROM t1 where a=1
+union distinct
+select @arg00 FROM t1 where a=1;
+1
+1
+prepare stmt1 from ' select 1 FROM t1 where a=1
+ union distinct
+ select ? FROM t1 where a=1 ' ;
+execute stmt1 using @arg00;
+1
+1
+set @arg00='a' ;
+select @arg00 FROM t1 where a=1
+union distinct
+select @arg00 FROM t1 where a=1;
+@arg00
+a
+prepare stmt1 from ' select ? FROM t1 where a=1
+ union distinct
+ select ? FROM t1 where a=1 ';
+execute stmt1 using @arg00, @arg00;
+?
+a
+prepare stmt1 from ' select ?
+ union distinct
+ select ? ';
+execute stmt1 using @arg00, @arg00;
+?
+a
+set @arg00='a' ;
+set @arg01=1 ;
+set @arg02='a' ;
+set @arg03=2 ;
+select @arg00 FROM t1 where a=@arg01
+union distinct
+select @arg02 FROM t1 where a=@arg03;
+@arg00
+a
+prepare stmt1 from ' select ? FROM t1 where a=?
+ union distinct
+ select ? FROM t1 where a=? ' ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03;
+?
+a
+set @arg00=1 ;
+prepare stmt1 from ' select sum(a) + 200, ? from t1
+union distinct
+select sum(a) + 200, 1 from t1
+group by b ' ;
+execute stmt1 using @arg00;
+sum(a) + 200 ?
+210 1
+204 1
+201 1
+203 1
+202 1
+set @Oporto='Oporto' ;
+set @Lisboa='Lisboa' ;
+set @0=0 ;
+set @1=1 ;
+set @2=2 ;
+set @3=3 ;
+set @4=4 ;
+select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ;
+@Oporto @Lisboa @0 @1 @2 @3 @4
+Oporto Lisboa 0 1 2 3 4
+select sum(a) + 200 as the_sum, @Oporto as the_town from t1
+group by b
+union distinct
+select sum(a) + 200, @Lisboa from t1
+group by b ;
+the_sum the_town
+204 Oporto
+201 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+201 Lisboa
+203 Lisboa
+202 Lisboa
+prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
+ group by b
+ union distinct
+ select sum(a) + 200, ? from t1
+ group by b ' ;
+execute stmt1 using @Oporto, @Lisboa;
+the_sum the_town
+204 Oporto
+201 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+201 Lisboa
+203 Lisboa
+202 Lisboa
+select sum(a) + 200 as the_sum, @Oporto as the_town from t1
+where a > @1
+group by b
+union distinct
+select sum(a) + 200, @Lisboa from t1
+where a > @2
+group by b ;
+the_sum the_town
+204 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+203 Lisboa
+prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
+ where a > ?
+ group by b
+ union distinct
+ select sum(a) + 200, ? from t1
+ where a > ?
+ group by b ' ;
+execute stmt1 using @Oporto, @1, @Lisboa, @2;
+the_sum the_town
+204 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+203 Lisboa
+select sum(a) + 200 as the_sum, @Oporto as the_town from t1
+where a > @1
+group by b
+having avg(a) > @2
+union distinct
+select sum(a) + 200, @Lisboa from t1
+where a > @2
+group by b
+having avg(a) > @3;
+the_sum the_town
+204 Oporto
+203 Oporto
+204 Lisboa
+prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
+ where a > ?
+ group by b
+ having avg(a) > ?
+ union distinct
+ select sum(a) + 200, ? from t1
+ where a > ?
+ group by b
+ having avg(a) > ? ';
+execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3;
+the_sum the_town
+204 Oporto
+203 Oporto
+204 Lisboa
+test_sequence
+------ explain select tests ------
+prepare stmt1 from ' select * from t_many_col_types ' ;
+execute stmt1;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def test t_many_col_types t_many_col_types c1 c1 1 4 1 N 49155 0 63
+def test t_many_col_types t_many_col_types c2 c2 2 6 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c3 c3 9 9 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c4 c4 3 11 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c5 c5 3 11 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c6 c6 8 20 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c7 c7 4 12 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c8 c8 5 22 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c9 c9 5 22 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c10 c10 5 22 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63
+def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63
+def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63
+def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63
+def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1217 0 63
+def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63
+def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63
+def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c19 c19 1 1 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c20 c20 254 1 1 Y 0 0 8
+def test t_many_col_types t_many_col_types c21 c21 253 10 10 Y 0 0 8
+def test t_many_col_types t_many_col_types c22 c22 253 30 30 Y 0 0 8
+def test t_many_col_types t_many_col_types c23 c23 252 255 8 Y 144 0 63
+def test t_many_col_types t_many_col_types c24 c24 252 255 8 Y 16 0 8
+def test t_many_col_types t_many_col_types c25 c25 252 65535 4 Y 144 0 63
+def test t_many_col_types t_many_col_types c26 c26 252 65535 4 Y 16 0 8
+def test t_many_col_types t_many_col_types c27 c27 252 16777215 10 Y 144 0 63
+def test t_many_col_types t_many_col_types c28 c28 252 16777215 10 Y 16 0 8
+def test t_many_col_types t_many_col_types c29 c29 252 16777215 8 Y 144 0 63
+def test t_many_col_types t_many_col_types c30 c30 252 16777215 8 Y 16 0 8
+def test t_many_col_types t_many_col_types c31 c31 254 5 3 Y 256 0 8
+def test t_many_col_types t_many_col_types c32 c32 254 24 7 Y 2048 0 8
+c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
+1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
+9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
+test_sequence
+------ delete tests ------
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+prepare stmt1 from 'delete from t1 where a=2' ;
+execute stmt1;
+select a,b from t1 where a=2;
+a b
+execute stmt1;
+insert into t1 values(0,NULL);
+set @arg00=NULL;
+prepare stmt1 from 'delete from t1 where b=?' ;
+execute stmt1 using @arg00;
+select a,b from t1 where b is NULL ;
+a b
+0 NULL
+set @arg00='one';
+execute stmt1 using @arg00;
+select a,b from t1 where b=@arg00;
+a b
+prepare stmt1 from 'truncate table t1' ;
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+test_sequence
+------ update tests ------
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ;
+execute stmt1;
+select a,b from t1 where a=2;
+a b
+2 a=two
+execute stmt1;
+select a,b from t1 where a=2;
+a b
+2 a=two
+set @arg00=NULL;
+prepare stmt1 from 'update t1 set b=? where a=2' ;
+execute stmt1 using @arg00;
+select a,b from t1 where a=2;
+a b
+2 NULL
+set @arg00='two';
+execute stmt1 using @arg00;
+select a,b from t1 where a=2;
+a b
+2 two
+set @arg00=2;
+prepare stmt1 from 'update t1 set b=NULL where a=?' ;
+execute stmt1 using @arg00;
+select a,b from t1 where a=@arg00;
+a b
+2 NULL
+update t1 set b='two' where a=@arg00;
+set @arg00=2000;
+execute stmt1 using @arg00;
+select a,b from t1 where a=@arg00;
+a b
+set @arg00=2;
+set @arg01=22;
+prepare stmt1 from 'update t1 set a=? where a=?' ;
+execute stmt1 using @arg00, @arg00;
+select a,b from t1 where a=@arg00;
+a b
+2 two
+execute stmt1 using @arg01, @arg00;
+select a,b from t1 where a=@arg01;
+a b
+22 two
+execute stmt1 using @arg00, @arg01;
+select a,b from t1 where a=@arg00;
+a b
+2 two
+set @arg00=NULL;
+set @arg01=2;
+execute stmt1 using @arg00, @arg01;
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+select a,b from t1;
+a b
+1 one
+0 two
+3 three
+4 four
+set @arg00=0;
+execute stmt1 using @arg01, @arg00;
+select a,b from t1;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00=23;
+set @arg01='two';
+set @arg02=2;
+set @arg03='two';
+set @arg04=2;
+drop table if exists t2;
+create table t2 as select a,b from t1 ;
+prepare stmt1 from 'update t1 set a=? where b=?
+ and a in (select ? from t2
+ where b = ? or a = ?)';
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ;
+select a,b from t1 where a = @arg00 ;
+a b
+23 two
+prepare stmt1 from 'update t1 set a=? where b=?
+ and a not in (select ? from t2
+ where b = ? or a = ?)';
+execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
+select a,b from t1 ;
+a b
+1 one
+2 two
+3 three
+4 four
+drop table t2 ;
+set @arg00=1;
+prepare stmt1 from 'update t1 set b=''bla''
+where a=2
+limit 1';
+execute stmt1 ;
+select a,b from t1 where b = 'bla' ;
+a b
+2 bla
+prepare stmt1 from 'update t1 set b=''bla''
+where a=2
+limit ?';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3
+test_sequence
+------ insert tests ------
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+prepare stmt1 from 'insert into t1 values(5, ''five'' )';
+execute stmt1;
+select a,b from t1 where a = 5;
+a b
+5 five
+set @arg00='six' ;
+prepare stmt1 from 'insert into t1 values(6, ? )';
+execute stmt1 using @arg00;
+select a,b from t1 where b = @arg00;
+a b
+6 six
+execute stmt1 using @arg00;
+ERROR 23000: Duplicate entry '6' for key 1
+set @arg00=NULL ;
+prepare stmt1 from 'insert into t1 values(0, ? )';
+execute stmt1 using @arg00;
+select a,b from t1 where b is NULL;
+a b
+0 NULL
+set @arg00=8 ;
+set @arg01='eight' ;
+prepare stmt1 from 'insert into t1 values(?, ? )';
+execute stmt1 using @arg00, @arg01 ;
+select a,b from t1 where b = @arg01;
+a b
+8 eight
+set @arg00=81 ;
+set @arg01='8-1' ;
+set @arg02=82 ;
+set @arg03='8-2' ;
+prepare stmt1 from 'insert into t1 values(?,?),(?,?)';
+execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
+select a,b from t1 where a in (@arg00,@arg02) ;
+a b
+81 8-1
+82 8-2
+set @arg00=9 ;
+set @arg01='nine' ;
+prepare stmt1 from 'insert into t1 set a=?, b=? ';
+execute stmt1 using @arg00, @arg01 ;
+select a,b from t1 where a = @arg00 ;
+a b
+9 nine
+set @arg00=6 ;
+set @arg01=1 ;
+prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
+ on duplicate key update a=a + ?, b=concat(b,''modified'') ';
+execute stmt1 using @arg00, @arg01;
+select * from t1;
+a b
+1 one
+2 two
+3 three
+4 four
+5 five
+7 sixmodified
+0 NULL
+8 eight
+81 8-1
+82 8-2
+9 nine
+set @arg00=81 ;
+set @arg01=1 ;
+execute stmt1 using @arg00, @arg01;
+ERROR 23000: Duplicate entry '82' for key 1
+set @1000=1000 ;
+set @x1000_2="x1000_2" ;
+set @x1000_3="x1000_3" ;
+set @x1000="x1000" ;
+set @1100=1100 ;
+set @x1100="x1100" ;
+set @100=100 ;
+set @updated="updated" ;
+insert into t1 values(1000,'x1000_1') ;
+insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
+on duplicate key update a = a + @100, b = concat(b,@updated) ;
+select a,b from t1 where a >= 1000 ;
+a b
+1000 x1000_3
+1100 x1000_1updated
+delete from t1 where a >= 1000 ;
+insert into t1 values(1000,'x1000_1') ;
+prepare stmt1 from ' insert into t1 values(?,?),(?,?)
+ on duplicate key update a = a + ?, b = concat(b,?) ';
+execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
+select a,b from t1 where a >= 1000 ;
+a b
+1000 x1000_3
+1100 x1000_1updated
+delete from t1 where a >= 1000 ;
+insert into t1 values(1000,'x1000_1') ;
+execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
+select a,b from t1 where a >= 1000 ;
+a b
+1200 x1000_1updatedupdated
+delete from t1 where a >= 1000 ;
+prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+set @duplicate='duplicate ' ;
+set @1000=1000 ;
+set @5=5 ;
+select a,b from t1 where a < 5 ;
+a b
+1 one
+2 two
+3 three
+4 four
+0 NULL
+insert into t1 select a + @1000, concat(@duplicate,b) from t1
+where a < @5 ;
+affected rows: 5
+info: Records: 5 Duplicates: 0 Warnings: 0
+select a,b from t1 where a >= 1000 ;
+a b
+1001 duplicate one
+1002 duplicate two
+1003 duplicate three
+1004 duplicate four
+1000 NULL
+delete from t1 where a >= 1000 ;
+prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1
+where a < ? ' ;
+execute stmt1 using @1000, @duplicate, @5;
+affected rows: 5
+info: Records: 5 Duplicates: 0 Warnings: 0
+select a,b from t1 where a >= 1000 ;
+a b
+1004 duplicate four
+1003 duplicate three
+1002 duplicate two
+1001 duplicate one
+1000 NULL
+delete from t1 where a >= 1000 ;
+set @float=1.00;
+set @five='five' ;
+drop table if exists t2;
+create table t2 like t1 ;
+insert into t2 (b,a)
+select @duplicate, sum(first.a) from t1 first, t1 second
+where first.a <> @5 and second.b = first.b
+and second.b <> @five
+group by second.b
+having sum(second.a) > @2
+union
+select b, a + @100 from t1
+where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b
+from t1);
+affected rows: 8
+info: Records: 8 Duplicates: 0 Warnings: 0
+select a,b from t2;
+a b
+81 duplicate
+82 duplicate
+8 duplicate
+4 duplicate
+9 duplicate
+7 duplicate
+3 duplicate
+103 three
+delete from t2 ;
+prepare stmt1 from ' insert into t2 (b,a)
+select ?, sum(first.a)
+ from t1 first, t1 second
+ where first.a <> ? and second.b = first.b and second.b <> ?
+ group by second.b
+ having sum(second.a) > ?
+union
+select b, a + ? from t1
+ where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b
+ from t1 ) ' ;
+execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ;
+affected rows: 8
+info: Records: 8 Duplicates: 0 Warnings: 0
+select a,b from t2;
+a b
+81 duplicate
+82 duplicate
+8 duplicate
+4 duplicate
+9 duplicate
+7 duplicate
+3 duplicate
+103 three
+drop table t2;
+drop table t1, t_many_col_types;
diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result
new file mode 100644
index 00000000000..cfd1f82eefd
--- /dev/null
+++ b/mysql-test/r/ps_3innodb.result
@@ -0,0 +1,1269 @@
+use test;
+drop table if exists t1, t_many_col_types ;
+create table t1
+(
+a int, b varchar(30),
+primary key(a)
+) engine = 'InnoDB' ;
+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 = 'InnoDB' ;
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+test_sequence
+------ simple select tests ------
+set @arg00='SELECT' ;
+prepare stmt1 from ' ? a from t1 where a=1 ';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1
+set @arg00=1 ;
+select @arg00, b from t1 where a=1 ;
+@arg00 b
+1 one
+prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+? b
+1 one
+set @arg00='lion' ;
+select @arg00, b from t1 where a=1 ;
+@arg00 b
+lion one
+prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+? b
+lion one
+set @arg00=NULL ;
+select @arg00, b from t1 where a=1 ;
+@arg00 b
+NULL one
+prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+? b
+NULL one
+set @arg00=1 ;
+select b, a - @arg00 from t1 where a=1 ;
+b a - @arg00
+one 0
+prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+b a - ?
+one 0
+set @arg00='MySQL' ;
+select substr(@arg00,1,2) from t1 where a=1 ;
+substr(@arg00,1,2)
+My
+prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+substr(?,1,2)
+My
+set @arg00=3 ;
+select substr('MySQL',@arg00,5) from t1 where a=1 ;
+substr('MySQL',@arg00,5)
+SQL
+prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+substr('MySQL',?,5)
+SQL
+select substr('MySQL',1,@arg00) from t1 where a=1 ;
+substr('MySQL',1,@arg00)
+MyS
+prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+substr('MySQL',1,?)
+MyS
+set @arg00='MySQL' ;
+select a , concat(@arg00,b) from t1 ;
+a concat(@arg00,b)
+1 MySQLone
+2 MySQLtwo
+3 MySQLthree
+4 MySQLfour
+prepare stmt1 from ' select a , concat(?,b) from t1 ' ;
+execute stmt1 using @arg00;
+a concat(?,b)
+1 MySQLone
+2 MySQLtwo
+3 MySQLthree
+4 MySQLfour
+select a , concat(b,@arg00) from t1 ;
+a concat(b,@arg00)
+1 oneMySQL
+2 twoMySQL
+3 threeMySQL
+4 fourMySQL
+prepare stmt1 from ' select a , concat(b,?) from t1 ' ;
+execute stmt1 using @arg00;
+a concat(b,?)
+1 oneMySQL
+2 twoMySQL
+3 threeMySQL
+4 fourMySQL
+set @arg00='MySQL' ;
+select group_concat(@arg00,b) from t1
+group by 'a' ;
+group_concat(@arg00,b)
+MySQLone,MySQLtwo,MySQLthree,MySQLfour
+prepare stmt1 from ' select group_concat(?,b) from t1
+group by ''a'' ' ;
+execute stmt1 using @arg00;
+group_concat(?,b)
+MySQLone,MySQLtwo,MySQLthree,MySQLfour
+select group_concat(b,@arg00) from t1
+group by 'a' ;
+group_concat(b,@arg00)
+oneMySQL,twoMySQL,threeMySQL,fourMySQL
+prepare stmt1 from ' select group_concat(b,?) from t1
+group by ''a'' ' ;
+execute stmt1 using @arg00;
+group_concat(b,?)
+oneMySQL,twoMySQL,threeMySQL,fourMySQL
+set @arg00='first' ;
+set @arg01='second' ;
+set @arg02=NULL;
+select @arg00, @arg01 from t1 where a=1 ;
+@arg00 @arg01
+first second
+prepare stmt1 from ' select ?, ? from t1 where a=1 ' ;
+execute stmt1 using @arg00, @arg01 ;
+? ?
+first second
+execute stmt1 using @arg02, @arg01 ;
+? ?
+NULL second
+execute stmt1 using @arg00, @arg02 ;
+? ?
+first NULL
+execute stmt1 using @arg02, @arg02 ;
+? ?
+NULL NULL
+drop table if exists new_tab ;
+create table new_tab (id1 int(11) not null default '0',
+value2 varchar(100), value1 varchar(100)) ;
+insert into new_tab values (1,'hh','hh'),(2,'hh','hh'),
+(1,'ii','ii'),(2,'ii','ii') ;
+prepare stmt1 from ' select id1,value1 from new_tab where id1=? or value1=? ' ;
+set @arg00=1 ;
+set @arg01='hh' ;
+execute stmt1 using @arg00, @arg01 ;
+id1 value1
+1 hh
+2 hh
+1 ii
+drop table new_tab ;
+drop table if exists new_tab ;
+create table new_tab(session_id char(9) not null) ;
+insert into new_tab values ('abc') ;
+prepare stmt1 from ' select * from new_tab
+where ?=''1111'' and session_id = ''abc'' ' ;
+set @arg00='abc' ;
+execute stmt1 using @arg00 ;
+session_id
+set @arg00='1111' ;
+execute stmt1 using @arg00 ;
+session_id
+abc
+set @arg00='abc' ;
+execute stmt1 using @arg00 ;
+session_id
+drop table new_tab ;
+set @arg00='FROM' ;
+select a @arg00 t1 where a=1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1
+prepare stmt1 from ' select a ? t1 where a=1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1
+set @arg00='t1' ;
+select a from @arg00 where a=1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1
+prepare stmt1 from ' select a from ? where a=1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1
+set @arg00='WHERE' ;
+select a from t1 @arg00 a=1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1
+prepare stmt1 from ' select a from t1 ? a=1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1
+set @arg00=1 ;
+select a FROM t1 where a=@arg00 ;
+a
+1
+prepare stmt1 from ' select a FROM t1 where a=? ' ;
+execute stmt1 using @arg00 ;
+a
+1
+set @arg00=1000 ;
+execute stmt1 using @arg00 ;
+a
+set @arg00=NULL ;
+select a FROM t1 where a=@arg00 ;
+a
+prepare stmt1 from ' select a FROM t1 where a=? ' ;
+execute stmt1 using @arg00 ;
+a
+set @arg00=4 ;
+select a FROM t1 where a=sqrt(@arg00) ;
+a
+2
+prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
+execute stmt1 using @arg00 ;
+a
+2
+set @arg00=NULL ;
+select a FROM t1 where a=sqrt(@arg00) ;
+a
+prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
+execute stmt1 using @arg00 ;
+a
+set @arg00=2 ;
+set @arg01=3 ;
+select a FROM t1 where a in (@arg00,@arg01);
+a
+2
+3
+prepare stmt1 from ' select a FROM t1 where a in (?,?) ';
+execute stmt1 using @arg00, @arg01;
+a
+2
+3
+prepare stmt1 from ' select b FROM t1 where b like ? ';
+set @arg00='two' ;
+execute stmt1 using @arg00 ;
+b
+two
+set @arg00='tw%' ;
+execute stmt1 using @arg00 ;
+b
+two
+set @arg00='%wo' ;
+execute stmt1 using @arg00 ;
+b
+two
+set @arg00='>' ;
+select a FROM t1 where a @arg00 1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1
+prepare stmt1 from ' select a FROM t1 where a ? 1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1
+set @arg00=1 ;
+select a,b FROM t1 where a is not NULL
+AND b is not NULL group by a - @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+prepare stmt1 from ' select a,b FROM t1 where a is not NULL
+AND b is not NULL group by a - ? ' ;
+execute stmt1 using @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00='two' ;
+select a,b FROM t1 where a is not NULL
+AND b is not NULL having b <> @arg00 ;
+a b
+1 one
+3 three
+4 four
+prepare stmt1 from ' select a,b FROM t1 where a is not NULL
+AND b is not NULL having b <> ? ' ;
+execute stmt1 using @arg00 ;
+a b
+1 one
+3 three
+4 four
+set @arg00=1 ;
+select a,b FROM t1 where a is not NULL
+AND b is not NULL order by a - @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+prepare stmt1 from ' select a,b FROM t1 where a is not NULL
+AND b is not NULL order by a - ? ' ;
+execute stmt1 using @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00=2 ;
+select a,b from t1 order by 2 ;
+a b
+4 four
+1 one
+3 three
+2 two
+prepare stmt1 from ' select a,b from t1
+order by ? ';
+execute stmt1 using @arg00;
+a b
+4 four
+1 one
+3 three
+2 two
+set @arg00=1;
+prepare stmt1 from ' select a,b from t1
+limit 1 ';
+execute stmt1 ;
+a b
+1 one
+prepare stmt1 from ' select a,b from t1
+limit ? ';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2
+set @arg00='b' ;
+set @arg01=0 ;
+set @arg02=2 ;
+set @arg03=2 ;
+select sum(a), @arg00 from t1 where a > @arg01
+and b is not null group by substr(b,@arg02)
+having sum(a) <> @arg03 ;
+sum(a) @arg00
+3 b
+1 b
+4 b
+prepare stmt1 from ' select sum(a), ? from t1 where a > ?
+and b is not null group by substr(b,?)
+having sum(a) <> ? ';
+execute stmt1 using @arg00, @arg01, @arg02, @arg03;
+sum(a) ?
+3 b
+1 b
+4 b
+test_sequence
+------ join tests ------
+select first.a as a1, second.a as a2
+from t1 first, t1 second
+where first.a = second.a ;
+a1 a2
+1 1
+2 2
+3 3
+4 4
+prepare stmt1 from ' select first.a as a1, second.a as a2
+ from t1 first, t1 second
+ where first.a = second.a ';
+execute stmt1 ;
+a1 a2
+1 1
+2 2
+3 3
+4 4
+set @arg00='ABC';
+set @arg01='two';
+set @arg02='one';
+select first.a, @arg00, second.a FROM t1 first, t1 second
+where @arg01 = first.b or first.a = second.a or second.b = @arg02;
+a @arg00 a
+1 ABC 1
+2 ABC 1
+3 ABC 1
+4 ABC 1
+2 ABC 2
+2 ABC 3
+3 ABC 3
+2 ABC 4
+4 ABC 4
+prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
+ where ? = first.b or first.a = second.a or second.b = ? ';
+execute stmt1 using @arg00, @arg01, @arg02;
+a ? a
+1 ABC 1
+2 ABC 1
+3 ABC 1
+4 ABC 1
+2 ABC 2
+2 ABC 3
+3 ABC 3
+2 ABC 4
+4 ABC 4
+test_sequence
+------ subquery tests ------
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = ''two'') ';
+execute stmt1 ;
+a b
+2 two
+set @arg00='two' ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where b = 'two' ) and b=@arg00 ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = ''two'') and b=? ';
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00='two' ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where b = @arg00 ) and b='two' ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = ? ) and b=''two'' ' ;
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=3 ;
+set @arg01='three' ;
+select a,b FROM t1 where (a,b) in (select 3, 'three');
+a b
+3 three
+select a FROM t1 where (a,b) in (select @arg00,@arg01);
+a
+3
+prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) ';
+execute stmt1 using @arg00, @arg01;
+a
+3
+set @arg00=1 ;
+set @arg01='two' ;
+set @arg02=2 ;
+set @arg03='two' ;
+select a, @arg00, b FROM t1 outer_table where
+b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ;
+a @arg00 b
+2 1 two
+prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
+ b=? and a = (select ? from t1 where b = ? ) ' ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
+a ? b
+2 1 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = outer_table.b ) ';
+execute stmt1 ;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00='two' ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where b = outer_table.b ) and b=@arg00 ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = outer_table.b) and b=? ';
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=2 ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ;
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=2 ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ;
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=1 ;
+set @arg01='two' ;
+set @arg02=2 ;
+set @arg03='two' ;
+select a, @arg00, b FROM t1 outer_table where
+b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03
+and outer_table.a=a ) ;
+a @arg00 b
+2 1 two
+prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
+ b=? and a = (select ? from t1 where outer_table.b = ?
+ and outer_table.a=a ) ' ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
+a ? b
+2 1 two
+set @arg00=1 ;
+set @arg01=0 ;
+select a, @arg00
+from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2
+where a=@arg01;
+a @arg00
+0 1
+prepare stmt1 from ' select a, ?
+ from ( select a - ? as a from t1 where a=? ) as t2
+ where a=? ';
+execute stmt1 using @arg00, @arg00, @arg00, @arg01 ;
+a ?
+0 1
+drop table if exists t2 ;
+create table t2 as select * from t_many_col_types;
+set @stmt= ' SELECT
+ (SELECT SUM(c1 + c12 + 0.0) FROM t2
+ where (t_many_col_types.c2 - 0e-3) = t2.c2
+ GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s,
+ exists (select 1.0e+0 from t2
+ where t2.c3 * 9.0000000000 = t_many_col_types.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 t_many_col_types,
+(select c25 x, c32 y from t2) tt WHERE x = c25 ' ;
+prepare stmt1 from @stmt ;
+execute stmt1 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def scalar_s 5 21 7 Y 32768 4 8
+def exists_s 8 1 1 N 32769 0 8
+def in_s 8 21 1 Y 32768 0 8
+def in_row_s 8 21 1 Y 32768 0 8
+scalar_s exists_s in_s in_row_s
+2.0000 0 1 0
+2.0000 0 1 0
+18.0000 1 0 1
+18.0000 1 0 1
+execute stmt1 ;
+scalar_s exists_s in_s in_row_s
+2.0000 0 1 0
+2.0000 0 1 0
+18.0000 1 0 1
+18.0000 1 0 1
+set @stmt= concat('explain ',@stmt);
+prepare stmt1 from @stmt ;
+execute stmt1 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def id 8 3 1 N 32801 0 8
+def select_type 253 19 18 N 1 31 63
+def table 253 64 16 N 1 31 63
+def type 253 10 3 N 1 31 63
+def possible_keys 253 4096 0 Y 0 31 63
+def key 253 64 0 Y 0 31 63
+def key_len 253 4096 0 Y 0 31 63
+def ref 253 1024 0 Y 0 31 63
+def rows 8 10 1 N 32801 0 8
+def Extra 253 255 44 N 1 31 63
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+execute stmt1 ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+set @stmt= ' SELECT
+ (SELECT SUM(c1+c12+?) FROM t2 where (t_many_col_types.c2-?)=t2.c2
+ GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s,
+ exists (select ? from t2
+ where t2.c3*?=t_many_col_types.c4) as exists_s,
+ c5*? in (select c6+? from t2) as in_s,
+ (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s
+FROM t_many_col_types,
+(select c25 x, c32 y from t2) tt WHERE x =c25 ' ;
+set @arg00= 0.0 ;
+set @arg01= 0e-3 ;
+set @arg02= 1.0e+0 ;
+set @arg03= 9.0000000000 ;
+set @arg04= 4 ;
+set @arg05= 0.3e+1 ;
+set @arg06= 4 ;
+set @arg07= 4 ;
+set @arg08= 4.0 ;
+set @arg09= 40e-1 ;
+prepare stmt1 from @stmt ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def scalar_s 5 23 2 Y 32768 31 8
+def exists_s 8 1 1 N 32769 0 8
+def in_s 8 21 1 Y 32768 0 8
+def in_row_s 8 21 1 Y 32768 0 8
+scalar_s exists_s in_s in_row_s
+2 0 1 0
+2 0 1 0
+18 1 0 1
+18 1 0 1
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+scalar_s exists_s in_s in_row_s
+2 0 1 0
+2 0 1 0
+18 1 0 1
+18 1 0 1
+set @stmt= concat('explain ',@stmt);
+prepare stmt1 from @stmt ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def id 8 3 1 N 32801 0 8
+def select_type 253 19 18 N 1 31 63
+def table 253 64 16 N 1 31 63
+def type 253 10 3 N 1 31 63
+def possible_keys 253 4096 0 Y 0 31 63
+def key 253 64 0 Y 0 31 63
+def key_len 253 4096 0 Y 0 31 63
+def ref 253 1024 0 Y 0 31 63
+def rows 8 10 1 N 32801 0 8
+def Extra 253 255 44 N 1 31 63
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+drop table t2 ;
+test_sequence
+------ union tests ------
+prepare stmt1 from ' select a FROM t1 where a=1
+ union distinct
+ select a FROM t1 where a=1 ';
+execute stmt1 ;
+a
+1
+execute stmt1 ;
+a
+1
+prepare stmt1 from ' select a FROM t1 where a=1
+ union all
+ select a FROM t1 where a=1 ';
+execute stmt1 ;
+a
+1
+1
+set @arg00=1 ;
+select @arg00 FROM t1 where a=1
+union distinct
+select 1 FROM t1 where a=1;
+@arg00
+1
+prepare stmt1 from ' select ? FROM t1 where a=1
+ union distinct
+ select 1 FROM t1 where a=1 ' ;
+execute stmt1 using @arg00;
+?
+1
+set @arg00=1 ;
+select 1 FROM t1 where a=1
+union distinct
+select @arg00 FROM t1 where a=1;
+1
+1
+prepare stmt1 from ' select 1 FROM t1 where a=1
+ union distinct
+ select ? FROM t1 where a=1 ' ;
+execute stmt1 using @arg00;
+1
+1
+set @arg00='a' ;
+select @arg00 FROM t1 where a=1
+union distinct
+select @arg00 FROM t1 where a=1;
+@arg00
+a
+prepare stmt1 from ' select ? FROM t1 where a=1
+ union distinct
+ select ? FROM t1 where a=1 ';
+execute stmt1 using @arg00, @arg00;
+?
+a
+prepare stmt1 from ' select ?
+ union distinct
+ select ? ';
+execute stmt1 using @arg00, @arg00;
+?
+a
+set @arg00='a' ;
+set @arg01=1 ;
+set @arg02='a' ;
+set @arg03=2 ;
+select @arg00 FROM t1 where a=@arg01
+union distinct
+select @arg02 FROM t1 where a=@arg03;
+@arg00
+a
+prepare stmt1 from ' select ? FROM t1 where a=?
+ union distinct
+ select ? FROM t1 where a=? ' ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03;
+?
+a
+set @arg00=1 ;
+prepare stmt1 from ' select sum(a) + 200, ? from t1
+union distinct
+select sum(a) + 200, 1 from t1
+group by b ' ;
+execute stmt1 using @arg00;
+sum(a) + 200 ?
+210 1
+204 1
+201 1
+203 1
+202 1
+set @Oporto='Oporto' ;
+set @Lisboa='Lisboa' ;
+set @0=0 ;
+set @1=1 ;
+set @2=2 ;
+set @3=3 ;
+set @4=4 ;
+select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ;
+@Oporto @Lisboa @0 @1 @2 @3 @4
+Oporto Lisboa 0 1 2 3 4
+select sum(a) + 200 as the_sum, @Oporto as the_town from t1
+group by b
+union distinct
+select sum(a) + 200, @Lisboa from t1
+group by b ;
+the_sum the_town
+204 Oporto
+201 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+201 Lisboa
+203 Lisboa
+202 Lisboa
+prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
+ group by b
+ union distinct
+ select sum(a) + 200, ? from t1
+ group by b ' ;
+execute stmt1 using @Oporto, @Lisboa;
+the_sum the_town
+204 Oporto
+201 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+201 Lisboa
+203 Lisboa
+202 Lisboa
+select sum(a) + 200 as the_sum, @Oporto as the_town from t1
+where a > @1
+group by b
+union distinct
+select sum(a) + 200, @Lisboa from t1
+where a > @2
+group by b ;
+the_sum the_town
+204 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+203 Lisboa
+prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
+ where a > ?
+ group by b
+ union distinct
+ select sum(a) + 200, ? from t1
+ where a > ?
+ group by b ' ;
+execute stmt1 using @Oporto, @1, @Lisboa, @2;
+the_sum the_town
+204 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+203 Lisboa
+select sum(a) + 200 as the_sum, @Oporto as the_town from t1
+where a > @1
+group by b
+having avg(a) > @2
+union distinct
+select sum(a) + 200, @Lisboa from t1
+where a > @2
+group by b
+having avg(a) > @3;
+the_sum the_town
+204 Oporto
+203 Oporto
+204 Lisboa
+prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
+ where a > ?
+ group by b
+ having avg(a) > ?
+ union distinct
+ select sum(a) + 200, ? from t1
+ where a > ?
+ group by b
+ having avg(a) > ? ';
+execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3;
+the_sum the_town
+204 Oporto
+203 Oporto
+204 Lisboa
+test_sequence
+------ explain select tests ------
+prepare stmt1 from ' select * from t_many_col_types ' ;
+execute stmt1;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def test t_many_col_types t_many_col_types c1 c1 1 4 1 N 49155 0 63
+def test t_many_col_types t_many_col_types c2 c2 2 6 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c3 c3 9 9 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c4 c4 3 11 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c5 c5 3 11 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c6 c6 8 20 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c7 c7 4 12 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c8 c8 5 22 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c9 c9 5 22 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c10 c10 5 22 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63
+def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63
+def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63
+def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63
+def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1217 0 63
+def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63
+def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63
+def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c19 c19 1 1 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c20 c20 254 1 1 Y 0 0 8
+def test t_many_col_types t_many_col_types c21 c21 253 10 10 Y 0 0 8
+def test t_many_col_types t_many_col_types c22 c22 253 30 30 Y 0 0 8
+def test t_many_col_types t_many_col_types c23 c23 252 255 8 Y 144 0 63
+def test t_many_col_types t_many_col_types c24 c24 252 255 8 Y 16 0 8
+def test t_many_col_types t_many_col_types c25 c25 252 65535 4 Y 144 0 63
+def test t_many_col_types t_many_col_types c26 c26 252 65535 4 Y 16 0 8
+def test t_many_col_types t_many_col_types c27 c27 252 16777215 10 Y 144 0 63
+def test t_many_col_types t_many_col_types c28 c28 252 16777215 10 Y 16 0 8
+def test t_many_col_types t_many_col_types c29 c29 252 16777215 8 Y 144 0 63
+def test t_many_col_types t_many_col_types c30 c30 252 16777215 8 Y 16 0 8
+def test t_many_col_types t_many_col_types c31 c31 254 5 3 Y 256 0 8
+def test t_many_col_types t_many_col_types c32 c32 254 24 7 Y 2048 0 8
+c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
+1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
+9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
+test_sequence
+------ delete tests ------
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+prepare stmt1 from 'delete from t1 where a=2' ;
+execute stmt1;
+select a,b from t1 where a=2;
+a b
+execute stmt1;
+insert into t1 values(0,NULL);
+set @arg00=NULL;
+prepare stmt1 from 'delete from t1 where b=?' ;
+execute stmt1 using @arg00;
+select a,b from t1 where b is NULL ;
+a b
+0 NULL
+set @arg00='one';
+execute stmt1 using @arg00;
+select a,b from t1 where b=@arg00;
+a b
+prepare stmt1 from 'truncate table t1' ;
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+test_sequence
+------ update tests ------
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ;
+execute stmt1;
+select a,b from t1 where a=2;
+a b
+2 a=two
+execute stmt1;
+select a,b from t1 where a=2;
+a b
+2 a=two
+set @arg00=NULL;
+prepare stmt1 from 'update t1 set b=? where a=2' ;
+execute stmt1 using @arg00;
+select a,b from t1 where a=2;
+a b
+2 NULL
+set @arg00='two';
+execute stmt1 using @arg00;
+select a,b from t1 where a=2;
+a b
+2 two
+set @arg00=2;
+prepare stmt1 from 'update t1 set b=NULL where a=?' ;
+execute stmt1 using @arg00;
+select a,b from t1 where a=@arg00;
+a b
+2 NULL
+update t1 set b='two' where a=@arg00;
+set @arg00=2000;
+execute stmt1 using @arg00;
+select a,b from t1 where a=@arg00;
+a b
+set @arg00=2;
+set @arg01=22;
+prepare stmt1 from 'update t1 set a=? where a=?' ;
+execute stmt1 using @arg00, @arg00;
+select a,b from t1 where a=@arg00;
+a b
+2 two
+execute stmt1 using @arg01, @arg00;
+select a,b from t1 where a=@arg01;
+a b
+22 two
+execute stmt1 using @arg00, @arg01;
+select a,b from t1 where a=@arg00;
+a b
+2 two
+set @arg00=NULL;
+set @arg01=2;
+execute stmt1 using @arg00, @arg01;
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+select a,b from t1;
+a b
+0 two
+1 one
+3 three
+4 four
+set @arg00=0;
+execute stmt1 using @arg01, @arg00;
+select a,b from t1;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00=23;
+set @arg01='two';
+set @arg02=2;
+set @arg03='two';
+set @arg04=2;
+drop table if exists t2;
+create table t2 as select a,b from t1 ;
+prepare stmt1 from 'update t1 set a=? where b=?
+ and a in (select ? from t2
+ where b = ? or a = ?)';
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ;
+select a,b from t1 where a = @arg00 ;
+a b
+23 two
+prepare stmt1 from 'update t1 set a=? where b=?
+ and a not in (select ? from t2
+ where b = ? or a = ?)';
+execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
+select a,b from t1 ;
+a b
+1 one
+2 two
+3 three
+4 four
+drop table t2 ;
+set @arg00=1;
+prepare stmt1 from 'update t1 set b=''bla''
+where a=2
+limit 1';
+execute stmt1 ;
+select a,b from t1 where b = 'bla' ;
+a b
+2 bla
+prepare stmt1 from 'update t1 set b=''bla''
+where a=2
+limit ?';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3
+test_sequence
+------ insert tests ------
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+prepare stmt1 from 'insert into t1 values(5, ''five'' )';
+execute stmt1;
+select a,b from t1 where a = 5;
+a b
+5 five
+set @arg00='six' ;
+prepare stmt1 from 'insert into t1 values(6, ? )';
+execute stmt1 using @arg00;
+select a,b from t1 where b = @arg00;
+a b
+6 six
+execute stmt1 using @arg00;
+ERROR 23000: Duplicate entry '6' for key 1
+set @arg00=NULL ;
+prepare stmt1 from 'insert into t1 values(0, ? )';
+execute stmt1 using @arg00;
+select a,b from t1 where b is NULL;
+a b
+0 NULL
+set @arg00=8 ;
+set @arg01='eight' ;
+prepare stmt1 from 'insert into t1 values(?, ? )';
+execute stmt1 using @arg00, @arg01 ;
+select a,b from t1 where b = @arg01;
+a b
+8 eight
+set @arg00=81 ;
+set @arg01='8-1' ;
+set @arg02=82 ;
+set @arg03='8-2' ;
+prepare stmt1 from 'insert into t1 values(?,?),(?,?)';
+execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
+select a,b from t1 where a in (@arg00,@arg02) ;
+a b
+81 8-1
+82 8-2
+set @arg00=9 ;
+set @arg01='nine' ;
+prepare stmt1 from 'insert into t1 set a=?, b=? ';
+execute stmt1 using @arg00, @arg01 ;
+select a,b from t1 where a = @arg00 ;
+a b
+9 nine
+set @arg00=6 ;
+set @arg01=1 ;
+prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
+ on duplicate key update a=a + ?, b=concat(b,''modified'') ';
+execute stmt1 using @arg00, @arg01;
+select * from t1;
+a b
+0 NULL
+1 one
+2 two
+3 three
+4 four
+5 five
+7 sixmodified
+8 eight
+9 nine
+81 8-1
+82 8-2
+set @arg00=81 ;
+set @arg01=1 ;
+execute stmt1 using @arg00, @arg01;
+ERROR 23000: Duplicate entry '82' for key 1
+set @1000=1000 ;
+set @x1000_2="x1000_2" ;
+set @x1000_3="x1000_3" ;
+set @x1000="x1000" ;
+set @1100=1100 ;
+set @x1100="x1100" ;
+set @100=100 ;
+set @updated="updated" ;
+insert into t1 values(1000,'x1000_1') ;
+insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
+on duplicate key update a = a + @100, b = concat(b,@updated) ;
+select a,b from t1 where a >= 1000 ;
+a b
+1000 x1000_3
+1100 x1000_1updated
+delete from t1 where a >= 1000 ;
+insert into t1 values(1000,'x1000_1') ;
+prepare stmt1 from ' insert into t1 values(?,?),(?,?)
+ on duplicate key update a = a + ?, b = concat(b,?) ';
+execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
+select a,b from t1 where a >= 1000 ;
+a b
+1000 x1000_3
+1100 x1000_1updated
+delete from t1 where a >= 1000 ;
+insert into t1 values(1000,'x1000_1') ;
+execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
+select a,b from t1 where a >= 1000 ;
+a b
+1200 x1000_1updatedupdated
+delete from t1 where a >= 1000 ;
+prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+set @duplicate='duplicate ' ;
+set @1000=1000 ;
+set @5=5 ;
+select a,b from t1 where a < 5 ;
+a b
+0 NULL
+1 one
+2 two
+3 three
+4 four
+insert into t1 select a + @1000, concat(@duplicate,b) from t1
+where a < @5 ;
+affected rows: 5
+info: Records: 5 Duplicates: 0 Warnings: 0
+select a,b from t1 where a >= 1000 ;
+a b
+1000 NULL
+1001 duplicate one
+1002 duplicate two
+1003 duplicate three
+1004 duplicate four
+delete from t1 where a >= 1000 ;
+prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1
+where a < ? ' ;
+execute stmt1 using @1000, @duplicate, @5;
+affected rows: 5
+info: Records: 5 Duplicates: 0 Warnings: 0
+select a,b from t1 where a >= 1000 ;
+a b
+1000 NULL
+1001 duplicate one
+1002 duplicate two
+1003 duplicate three
+1004 duplicate four
+delete from t1 where a >= 1000 ;
+set @float=1.00;
+set @five='five' ;
+drop table if exists t2;
+create table t2 like t1 ;
+insert into t2 (b,a)
+select @duplicate, sum(first.a) from t1 first, t1 second
+where first.a <> @5 and second.b = first.b
+and second.b <> @five
+group by second.b
+having sum(second.a) > @2
+union
+select b, a + @100 from t1
+where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b
+from t1);
+affected rows: 8
+info: Records: 8 Duplicates: 0 Warnings: 0
+select a,b from t2;
+a b
+3 duplicate
+4 duplicate
+7 duplicate
+8 duplicate
+9 duplicate
+81 duplicate
+82 duplicate
+103 three
+delete from t2 ;
+prepare stmt1 from ' insert into t2 (b,a)
+select ?, sum(first.a)
+ from t1 first, t1 second
+ where first.a <> ? and second.b = first.b and second.b <> ?
+ group by second.b
+ having sum(second.a) > ?
+union
+select b, a + ? from t1
+ where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b
+ from t1 ) ' ;
+execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ;
+affected rows: 8
+info: Records: 8 Duplicates: 0 Warnings: 0
+select a,b from t2;
+a b
+3 duplicate
+4 duplicate
+7 duplicate
+8 duplicate
+9 duplicate
+81 duplicate
+82 duplicate
+103 three
+drop table t2;
+drop table t1, t_many_col_types;
diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result
new file mode 100644
index 00000000000..0fe3b95f8a8
--- /dev/null
+++ b/mysql-test/r/ps_4heap.result
@@ -0,0 +1,1270 @@
+use test;
+drop table if exists t1, t_many_col_types ;
+create table t1
+(
+a int, b varchar(30),
+primary key(a)
+) engine = 'HEAP' ;
+drop table if exists t_many_col_types;
+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 = 'HEAP' ;
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+test_sequence
+------ simple select tests ------
+set @arg00='SELECT' ;
+prepare stmt1 from ' ? a from t1 where a=1 ';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1
+set @arg00=1 ;
+select @arg00, b from t1 where a=1 ;
+@arg00 b
+1 one
+prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+? b
+1 one
+set @arg00='lion' ;
+select @arg00, b from t1 where a=1 ;
+@arg00 b
+lion one
+prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+? b
+lion one
+set @arg00=NULL ;
+select @arg00, b from t1 where a=1 ;
+@arg00 b
+NULL one
+prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+? b
+NULL one
+set @arg00=1 ;
+select b, a - @arg00 from t1 where a=1 ;
+b a - @arg00
+one 0
+prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+b a - ?
+one 0
+set @arg00='MySQL' ;
+select substr(@arg00,1,2) from t1 where a=1 ;
+substr(@arg00,1,2)
+My
+prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+substr(?,1,2)
+My
+set @arg00=3 ;
+select substr('MySQL',@arg00,5) from t1 where a=1 ;
+substr('MySQL',@arg00,5)
+SQL
+prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+substr('MySQL',?,5)
+SQL
+select substr('MySQL',1,@arg00) from t1 where a=1 ;
+substr('MySQL',1,@arg00)
+MyS
+prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+substr('MySQL',1,?)
+MyS
+set @arg00='MySQL' ;
+select a , concat(@arg00,b) from t1 ;
+a concat(@arg00,b)
+1 MySQLone
+2 MySQLtwo
+3 MySQLthree
+4 MySQLfour
+prepare stmt1 from ' select a , concat(?,b) from t1 ' ;
+execute stmt1 using @arg00;
+a concat(?,b)
+1 MySQLone
+2 MySQLtwo
+3 MySQLthree
+4 MySQLfour
+select a , concat(b,@arg00) from t1 ;
+a concat(b,@arg00)
+1 oneMySQL
+2 twoMySQL
+3 threeMySQL
+4 fourMySQL
+prepare stmt1 from ' select a , concat(b,?) from t1 ' ;
+execute stmt1 using @arg00;
+a concat(b,?)
+1 oneMySQL
+2 twoMySQL
+3 threeMySQL
+4 fourMySQL
+set @arg00='MySQL' ;
+select group_concat(@arg00,b) from t1
+group by 'a' ;
+group_concat(@arg00,b)
+MySQLone,MySQLtwo,MySQLthree,MySQLfour
+prepare stmt1 from ' select group_concat(?,b) from t1
+group by ''a'' ' ;
+execute stmt1 using @arg00;
+group_concat(?,b)
+MySQLone,MySQLtwo,MySQLthree,MySQLfour
+select group_concat(b,@arg00) from t1
+group by 'a' ;
+group_concat(b,@arg00)
+oneMySQL,twoMySQL,threeMySQL,fourMySQL
+prepare stmt1 from ' select group_concat(b,?) from t1
+group by ''a'' ' ;
+execute stmt1 using @arg00;
+group_concat(b,?)
+oneMySQL,twoMySQL,threeMySQL,fourMySQL
+set @arg00='first' ;
+set @arg01='second' ;
+set @arg02=NULL;
+select @arg00, @arg01 from t1 where a=1 ;
+@arg00 @arg01
+first second
+prepare stmt1 from ' select ?, ? from t1 where a=1 ' ;
+execute stmt1 using @arg00, @arg01 ;
+? ?
+first second
+execute stmt1 using @arg02, @arg01 ;
+? ?
+NULL second
+execute stmt1 using @arg00, @arg02 ;
+? ?
+first NULL
+execute stmt1 using @arg02, @arg02 ;
+? ?
+NULL NULL
+drop table if exists new_tab ;
+create table new_tab (id1 int(11) not null default '0',
+value2 varchar(100), value1 varchar(100)) ;
+insert into new_tab values (1,'hh','hh'),(2,'hh','hh'),
+(1,'ii','ii'),(2,'ii','ii') ;
+prepare stmt1 from ' select id1,value1 from new_tab where id1=? or value1=? ' ;
+set @arg00=1 ;
+set @arg01='hh' ;
+execute stmt1 using @arg00, @arg01 ;
+id1 value1
+1 hh
+2 hh
+1 ii
+drop table new_tab ;
+drop table if exists new_tab ;
+create table new_tab(session_id char(9) not null) ;
+insert into new_tab values ('abc') ;
+prepare stmt1 from ' select * from new_tab
+where ?=''1111'' and session_id = ''abc'' ' ;
+set @arg00='abc' ;
+execute stmt1 using @arg00 ;
+session_id
+set @arg00='1111' ;
+execute stmt1 using @arg00 ;
+session_id
+abc
+set @arg00='abc' ;
+execute stmt1 using @arg00 ;
+session_id
+drop table new_tab ;
+set @arg00='FROM' ;
+select a @arg00 t1 where a=1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1
+prepare stmt1 from ' select a ? t1 where a=1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1
+set @arg00='t1' ;
+select a from @arg00 where a=1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1
+prepare stmt1 from ' select a from ? where a=1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1
+set @arg00='WHERE' ;
+select a from t1 @arg00 a=1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1
+prepare stmt1 from ' select a from t1 ? a=1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1
+set @arg00=1 ;
+select a FROM t1 where a=@arg00 ;
+a
+1
+prepare stmt1 from ' select a FROM t1 where a=? ' ;
+execute stmt1 using @arg00 ;
+a
+1
+set @arg00=1000 ;
+execute stmt1 using @arg00 ;
+a
+set @arg00=NULL ;
+select a FROM t1 where a=@arg00 ;
+a
+prepare stmt1 from ' select a FROM t1 where a=? ' ;
+execute stmt1 using @arg00 ;
+a
+set @arg00=4 ;
+select a FROM t1 where a=sqrt(@arg00) ;
+a
+2
+prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
+execute stmt1 using @arg00 ;
+a
+2
+set @arg00=NULL ;
+select a FROM t1 where a=sqrt(@arg00) ;
+a
+prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
+execute stmt1 using @arg00 ;
+a
+set @arg00=2 ;
+set @arg01=3 ;
+select a FROM t1 where a in (@arg00,@arg01);
+a
+2
+3
+prepare stmt1 from ' select a FROM t1 where a in (?,?) ';
+execute stmt1 using @arg00, @arg01;
+a
+2
+3
+prepare stmt1 from ' select b FROM t1 where b like ? ';
+set @arg00='two' ;
+execute stmt1 using @arg00 ;
+b
+two
+set @arg00='tw%' ;
+execute stmt1 using @arg00 ;
+b
+two
+set @arg00='%wo' ;
+execute stmt1 using @arg00 ;
+b
+two
+set @arg00='>' ;
+select a FROM t1 where a @arg00 1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1
+prepare stmt1 from ' select a FROM t1 where a ? 1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1
+set @arg00=1 ;
+select a,b FROM t1 where a is not NULL
+AND b is not NULL group by a - @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+prepare stmt1 from ' select a,b FROM t1 where a is not NULL
+AND b is not NULL group by a - ? ' ;
+execute stmt1 using @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00='two' ;
+select a,b FROM t1 where a is not NULL
+AND b is not NULL having b <> @arg00 ;
+a b
+1 one
+3 three
+4 four
+prepare stmt1 from ' select a,b FROM t1 where a is not NULL
+AND b is not NULL having b <> ? ' ;
+execute stmt1 using @arg00 ;
+a b
+1 one
+3 three
+4 four
+set @arg00=1 ;
+select a,b FROM t1 where a is not NULL
+AND b is not NULL order by a - @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+prepare stmt1 from ' select a,b FROM t1 where a is not NULL
+AND b is not NULL order by a - ? ' ;
+execute stmt1 using @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00=2 ;
+select a,b from t1 order by 2 ;
+a b
+4 four
+1 one
+3 three
+2 two
+prepare stmt1 from ' select a,b from t1
+order by ? ';
+execute stmt1 using @arg00;
+a b
+4 four
+1 one
+3 three
+2 two
+set @arg00=1;
+prepare stmt1 from ' select a,b from t1
+limit 1 ';
+execute stmt1 ;
+a b
+1 one
+prepare stmt1 from ' select a,b from t1
+limit ? ';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2
+set @arg00='b' ;
+set @arg01=0 ;
+set @arg02=2 ;
+set @arg03=2 ;
+select sum(a), @arg00 from t1 where a > @arg01
+and b is not null group by substr(b,@arg02)
+having sum(a) <> @arg03 ;
+sum(a) @arg00
+3 b
+1 b
+4 b
+prepare stmt1 from ' select sum(a), ? from t1 where a > ?
+and b is not null group by substr(b,?)
+having sum(a) <> ? ';
+execute stmt1 using @arg00, @arg01, @arg02, @arg03;
+sum(a) ?
+3 b
+1 b
+4 b
+test_sequence
+------ join tests ------
+select first.a as a1, second.a as a2
+from t1 first, t1 second
+where first.a = second.a ;
+a1 a2
+1 1
+2 2
+3 3
+4 4
+prepare stmt1 from ' select first.a as a1, second.a as a2
+ from t1 first, t1 second
+ where first.a = second.a ';
+execute stmt1 ;
+a1 a2
+1 1
+2 2
+3 3
+4 4
+set @arg00='ABC';
+set @arg01='two';
+set @arg02='one';
+select first.a, @arg00, second.a FROM t1 first, t1 second
+where @arg01 = first.b or first.a = second.a or second.b = @arg02;
+a @arg00 a
+1 ABC 1
+2 ABC 1
+3 ABC 1
+4 ABC 1
+2 ABC 2
+2 ABC 3
+3 ABC 3
+2 ABC 4
+4 ABC 4
+prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
+ where ? = first.b or first.a = second.a or second.b = ? ';
+execute stmt1 using @arg00, @arg01, @arg02;
+a ? a
+1 ABC 1
+2 ABC 1
+3 ABC 1
+4 ABC 1
+2 ABC 2
+2 ABC 3
+3 ABC 3
+2 ABC 4
+4 ABC 4
+test_sequence
+------ subquery tests ------
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = ''two'') ';
+execute stmt1 ;
+a b
+2 two
+set @arg00='two' ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where b = 'two' ) and b=@arg00 ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = ''two'') and b=? ';
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00='two' ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where b = @arg00 ) and b='two' ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = ? ) and b=''two'' ' ;
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=3 ;
+set @arg01='three' ;
+select a,b FROM t1 where (a,b) in (select 3, 'three');
+a b
+3 three
+select a FROM t1 where (a,b) in (select @arg00,@arg01);
+a
+3
+prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) ';
+execute stmt1 using @arg00, @arg01;
+a
+3
+set @arg00=1 ;
+set @arg01='two' ;
+set @arg02=2 ;
+set @arg03='two' ;
+select a, @arg00, b FROM t1 outer_table where
+b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ;
+a @arg00 b
+2 1 two
+prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
+ b=? and a = (select ? from t1 where b = ? ) ' ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
+a ? b
+2 1 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = outer_table.b ) ';
+execute stmt1 ;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00='two' ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where b = outer_table.b ) and b=@arg00 ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = outer_table.b) and b=? ';
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=2 ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ;
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=2 ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ;
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=1 ;
+set @arg01='two' ;
+set @arg02=2 ;
+set @arg03='two' ;
+select a, @arg00, b FROM t1 outer_table where
+b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03
+and outer_table.a=a ) ;
+a @arg00 b
+2 1 two
+prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
+ b=? and a = (select ? from t1 where outer_table.b = ?
+ and outer_table.a=a ) ' ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
+a ? b
+2 1 two
+set @arg00=1 ;
+set @arg01=0 ;
+select a, @arg00
+from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2
+where a=@arg01;
+a @arg00
+0 1
+prepare stmt1 from ' select a, ?
+ from ( select a - ? as a from t1 where a=? ) as t2
+ where a=? ';
+execute stmt1 using @arg00, @arg00, @arg00, @arg01 ;
+a ?
+0 1
+drop table if exists t2 ;
+create table t2 as select * from t_many_col_types;
+set @stmt= ' SELECT
+ (SELECT SUM(c1 + c12 + 0.0) FROM t2
+ where (t_many_col_types.c2 - 0e-3) = t2.c2
+ GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s,
+ exists (select 1.0e+0 from t2
+ where t2.c3 * 9.0000000000 = t_many_col_types.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 t_many_col_types,
+(select c25 x, c32 y from t2) tt WHERE x = c25 ' ;
+prepare stmt1 from @stmt ;
+execute stmt1 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def scalar_s 5 21 7 Y 32768 4 8
+def exists_s 8 1 1 N 32769 0 8
+def in_s 8 21 1 Y 32768 0 8
+def in_row_s 8 21 1 Y 32768 0 8
+scalar_s exists_s in_s in_row_s
+2.0000 0 1 0
+18.0000 1 0 1
+2.0000 0 1 0
+18.0000 1 0 1
+execute stmt1 ;
+scalar_s exists_s in_s in_row_s
+2.0000 0 1 0
+18.0000 1 0 1
+2.0000 0 1 0
+18.0000 1 0 1
+set @stmt= concat('explain ',@stmt);
+prepare stmt1 from @stmt ;
+execute stmt1 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def id 8 3 1 N 32801 0 8
+def select_type 253 19 18 N 1 31 63
+def table 253 64 16 N 1 31 63
+def type 253 10 3 N 1 31 63
+def possible_keys 253 4096 0 Y 0 31 63
+def key 253 64 0 Y 0 31 63
+def key_len 253 4096 0 Y 0 31 63
+def ref 253 1024 0 Y 0 31 63
+def rows 8 10 1 N 32801 0 8
+def Extra 253 255 44 N 1 31 63
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+execute stmt1 ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+set @stmt= ' SELECT
+ (SELECT SUM(c1+c12+?) FROM t2 where (t_many_col_types.c2-?)=t2.c2
+ GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s,
+ exists (select ? from t2
+ where t2.c3*?=t_many_col_types.c4) as exists_s,
+ c5*? in (select c6+? from t2) as in_s,
+ (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s
+FROM t_many_col_types,
+(select c25 x, c32 y from t2) tt WHERE x =c25 ' ;
+set @arg00= 0.0 ;
+set @arg01= 0e-3 ;
+set @arg02= 1.0e+0 ;
+set @arg03= 9.0000000000 ;
+set @arg04= 4 ;
+set @arg05= 0.3e+1 ;
+set @arg06= 4 ;
+set @arg07= 4 ;
+set @arg08= 4.0 ;
+set @arg09= 40e-1 ;
+prepare stmt1 from @stmt ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def scalar_s 5 23 2 Y 32768 31 8
+def exists_s 8 1 1 N 32769 0 8
+def in_s 8 21 1 Y 32768 0 8
+def in_row_s 8 21 1 Y 32768 0 8
+scalar_s exists_s in_s in_row_s
+2 0 1 0
+18 1 0 1
+2 0 1 0
+18 1 0 1
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+scalar_s exists_s in_s in_row_s
+2 0 1 0
+18 1 0 1
+2 0 1 0
+18 1 0 1
+set @stmt= concat('explain ',@stmt);
+prepare stmt1 from @stmt ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def id 8 3 1 N 32801 0 8
+def select_type 253 19 18 N 1 31 63
+def table 253 64 16 N 1 31 63
+def type 253 10 3 N 1 31 63
+def possible_keys 253 4096 0 Y 0 31 63
+def key 253 64 0 Y 0 31 63
+def key_len 253 4096 0 Y 0 31 63
+def ref 253 1024 0 Y 0 31 63
+def rows 8 10 1 N 32801 0 8
+def Extra 253 255 44 N 1 31 63
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+drop table t2 ;
+test_sequence
+------ union tests ------
+prepare stmt1 from ' select a FROM t1 where a=1
+ union distinct
+ select a FROM t1 where a=1 ';
+execute stmt1 ;
+a
+1
+execute stmt1 ;
+a
+1
+prepare stmt1 from ' select a FROM t1 where a=1
+ union all
+ select a FROM t1 where a=1 ';
+execute stmt1 ;
+a
+1
+1
+set @arg00=1 ;
+select @arg00 FROM t1 where a=1
+union distinct
+select 1 FROM t1 where a=1;
+@arg00
+1
+prepare stmt1 from ' select ? FROM t1 where a=1
+ union distinct
+ select 1 FROM t1 where a=1 ' ;
+execute stmt1 using @arg00;
+?
+1
+set @arg00=1 ;
+select 1 FROM t1 where a=1
+union distinct
+select @arg00 FROM t1 where a=1;
+1
+1
+prepare stmt1 from ' select 1 FROM t1 where a=1
+ union distinct
+ select ? FROM t1 where a=1 ' ;
+execute stmt1 using @arg00;
+1
+1
+set @arg00='a' ;
+select @arg00 FROM t1 where a=1
+union distinct
+select @arg00 FROM t1 where a=1;
+@arg00
+a
+prepare stmt1 from ' select ? FROM t1 where a=1
+ union distinct
+ select ? FROM t1 where a=1 ';
+execute stmt1 using @arg00, @arg00;
+?
+a
+prepare stmt1 from ' select ?
+ union distinct
+ select ? ';
+execute stmt1 using @arg00, @arg00;
+?
+a
+set @arg00='a' ;
+set @arg01=1 ;
+set @arg02='a' ;
+set @arg03=2 ;
+select @arg00 FROM t1 where a=@arg01
+union distinct
+select @arg02 FROM t1 where a=@arg03;
+@arg00
+a
+prepare stmt1 from ' select ? FROM t1 where a=?
+ union distinct
+ select ? FROM t1 where a=? ' ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03;
+?
+a
+set @arg00=1 ;
+prepare stmt1 from ' select sum(a) + 200, ? from t1
+union distinct
+select sum(a) + 200, 1 from t1
+group by b ' ;
+execute stmt1 using @arg00;
+sum(a) + 200 ?
+210 1
+204 1
+201 1
+203 1
+202 1
+set @Oporto='Oporto' ;
+set @Lisboa='Lisboa' ;
+set @0=0 ;
+set @1=1 ;
+set @2=2 ;
+set @3=3 ;
+set @4=4 ;
+select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ;
+@Oporto @Lisboa @0 @1 @2 @3 @4
+Oporto Lisboa 0 1 2 3 4
+select sum(a) + 200 as the_sum, @Oporto as the_town from t1
+group by b
+union distinct
+select sum(a) + 200, @Lisboa from t1
+group by b ;
+the_sum the_town
+204 Oporto
+201 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+201 Lisboa
+203 Lisboa
+202 Lisboa
+prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
+ group by b
+ union distinct
+ select sum(a) + 200, ? from t1
+ group by b ' ;
+execute stmt1 using @Oporto, @Lisboa;
+the_sum the_town
+204 Oporto
+201 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+201 Lisboa
+203 Lisboa
+202 Lisboa
+select sum(a) + 200 as the_sum, @Oporto as the_town from t1
+where a > @1
+group by b
+union distinct
+select sum(a) + 200, @Lisboa from t1
+where a > @2
+group by b ;
+the_sum the_town
+204 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+203 Lisboa
+prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
+ where a > ?
+ group by b
+ union distinct
+ select sum(a) + 200, ? from t1
+ where a > ?
+ group by b ' ;
+execute stmt1 using @Oporto, @1, @Lisboa, @2;
+the_sum the_town
+204 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+203 Lisboa
+select sum(a) + 200 as the_sum, @Oporto as the_town from t1
+where a > @1
+group by b
+having avg(a) > @2
+union distinct
+select sum(a) + 200, @Lisboa from t1
+where a > @2
+group by b
+having avg(a) > @3;
+the_sum the_town
+204 Oporto
+203 Oporto
+204 Lisboa
+prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
+ where a > ?
+ group by b
+ having avg(a) > ?
+ union distinct
+ select sum(a) + 200, ? from t1
+ where a > ?
+ group by b
+ having avg(a) > ? ';
+execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3;
+the_sum the_town
+204 Oporto
+203 Oporto
+204 Lisboa
+test_sequence
+------ explain select tests ------
+prepare stmt1 from ' select * from t_many_col_types ' ;
+execute stmt1;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def test t_many_col_types t_many_col_types c1 c1 1 4 1 N 49155 0 63
+def test t_many_col_types t_many_col_types c2 c2 2 6 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c3 c3 9 9 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c4 c4 3 11 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c5 c5 3 11 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c6 c6 8 20 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c7 c7 4 12 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c8 c8 5 22 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c9 c9 5 22 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c10 c10 5 22 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63
+def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63
+def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63
+def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63
+def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1217 0 63
+def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63
+def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63
+def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c19 c19 1 1 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c20 c20 254 1 1 Y 0 0 8
+def test t_many_col_types t_many_col_types c21 c21 253 10 10 Y 0 0 8
+def test t_many_col_types t_many_col_types c22 c22 253 30 30 Y 0 0 8
+def test t_many_col_types t_many_col_types c23 c23 253 100 8 Y 0 0 8
+def test t_many_col_types t_many_col_types c24 c24 253 100 8 Y 0 0 8
+def test t_many_col_types t_many_col_types c25 c25 253 100 4 Y 0 0 8
+def test t_many_col_types t_many_col_types c26 c26 253 100 4 Y 0 0 8
+def test t_many_col_types t_many_col_types c27 c27 253 100 10 Y 0 0 8
+def test t_many_col_types t_many_col_types c28 c28 253 100 10 Y 0 0 8
+def test t_many_col_types t_many_col_types c29 c29 253 100 8 Y 0 0 8
+def test t_many_col_types t_many_col_types c30 c30 253 100 8 Y 0 0 8
+def test t_many_col_types t_many_col_types c31 c31 254 5 3 Y 256 0 8
+def test t_many_col_types t_many_col_types c32 c32 254 24 7 Y 2048 0 8
+c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
+1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
+9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
+test_sequence
+------ delete tests ------
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+prepare stmt1 from 'delete from t1 where a=2' ;
+execute stmt1;
+select a,b from t1 where a=2;
+a b
+execute stmt1;
+insert into t1 values(0,NULL);
+set @arg00=NULL;
+prepare stmt1 from 'delete from t1 where b=?' ;
+execute stmt1 using @arg00;
+select a,b from t1 where b is NULL ;
+a b
+0 NULL
+set @arg00='one';
+execute stmt1 using @arg00;
+select a,b from t1 where b=@arg00;
+a b
+prepare stmt1 from 'truncate table t1' ;
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+test_sequence
+------ update tests ------
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ;
+execute stmt1;
+select a,b from t1 where a=2;
+a b
+2 a=two
+execute stmt1;
+select a,b from t1 where a=2;
+a b
+2 a=two
+set @arg00=NULL;
+prepare stmt1 from 'update t1 set b=? where a=2' ;
+execute stmt1 using @arg00;
+select a,b from t1 where a=2;
+a b
+2 NULL
+set @arg00='two';
+execute stmt1 using @arg00;
+select a,b from t1 where a=2;
+a b
+2 two
+set @arg00=2;
+prepare stmt1 from 'update t1 set b=NULL where a=?' ;
+execute stmt1 using @arg00;
+select a,b from t1 where a=@arg00;
+a b
+2 NULL
+update t1 set b='two' where a=@arg00;
+set @arg00=2000;
+execute stmt1 using @arg00;
+select a,b from t1 where a=@arg00;
+a b
+set @arg00=2;
+set @arg01=22;
+prepare stmt1 from 'update t1 set a=? where a=?' ;
+execute stmt1 using @arg00, @arg00;
+select a,b from t1 where a=@arg00;
+a b
+2 two
+execute stmt1 using @arg01, @arg00;
+select a,b from t1 where a=@arg01;
+a b
+22 two
+execute stmt1 using @arg00, @arg01;
+select a,b from t1 where a=@arg00;
+a b
+2 two
+set @arg00=NULL;
+set @arg01=2;
+execute stmt1 using @arg00, @arg01;
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+select a,b from t1;
+a b
+1 one
+0 two
+3 three
+4 four
+set @arg00=0;
+execute stmt1 using @arg01, @arg00;
+select a,b from t1;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00=23;
+set @arg01='two';
+set @arg02=2;
+set @arg03='two';
+set @arg04=2;
+drop table if exists t2;
+create table t2 as select a,b from t1 ;
+prepare stmt1 from 'update t1 set a=? where b=?
+ and a in (select ? from t2
+ where b = ? or a = ?)';
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ;
+select a,b from t1 where a = @arg00 ;
+a b
+23 two
+prepare stmt1 from 'update t1 set a=? where b=?
+ and a not in (select ? from t2
+ where b = ? or a = ?)';
+execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
+select a,b from t1 ;
+a b
+1 one
+2 two
+3 three
+4 four
+drop table t2 ;
+set @arg00=1;
+prepare stmt1 from 'update t1 set b=''bla''
+where a=2
+limit 1';
+execute stmt1 ;
+select a,b from t1 where b = 'bla' ;
+a b
+2 bla
+prepare stmt1 from 'update t1 set b=''bla''
+where a=2
+limit ?';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3
+test_sequence
+------ insert tests ------
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+prepare stmt1 from 'insert into t1 values(5, ''five'' )';
+execute stmt1;
+select a,b from t1 where a = 5;
+a b
+5 five
+set @arg00='six' ;
+prepare stmt1 from 'insert into t1 values(6, ? )';
+execute stmt1 using @arg00;
+select a,b from t1 where b = @arg00;
+a b
+6 six
+execute stmt1 using @arg00;
+ERROR 23000: Duplicate entry '6' for key 1
+set @arg00=NULL ;
+prepare stmt1 from 'insert into t1 values(0, ? )';
+execute stmt1 using @arg00;
+select a,b from t1 where b is NULL;
+a b
+0 NULL
+set @arg00=8 ;
+set @arg01='eight' ;
+prepare stmt1 from 'insert into t1 values(?, ? )';
+execute stmt1 using @arg00, @arg01 ;
+select a,b from t1 where b = @arg01;
+a b
+8 eight
+set @arg00=81 ;
+set @arg01='8-1' ;
+set @arg02=82 ;
+set @arg03='8-2' ;
+prepare stmt1 from 'insert into t1 values(?,?),(?,?)';
+execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
+select a,b from t1 where a in (@arg00,@arg02) ;
+a b
+81 8-1
+82 8-2
+set @arg00=9 ;
+set @arg01='nine' ;
+prepare stmt1 from 'insert into t1 set a=?, b=? ';
+execute stmt1 using @arg00, @arg01 ;
+select a,b from t1 where a = @arg00 ;
+a b
+9 nine
+set @arg00=6 ;
+set @arg01=1 ;
+prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
+ on duplicate key update a=a + ?, b=concat(b,''modified'') ';
+execute stmt1 using @arg00, @arg01;
+select * from t1;
+a b
+1 one
+2 two
+3 three
+4 four
+5 five
+7 sixmodified
+0 NULL
+8 eight
+81 8-1
+82 8-2
+9 nine
+set @arg00=81 ;
+set @arg01=1 ;
+execute stmt1 using @arg00, @arg01;
+ERROR 23000: Duplicate entry '82' for key 1
+set @1000=1000 ;
+set @x1000_2="x1000_2" ;
+set @x1000_3="x1000_3" ;
+set @x1000="x1000" ;
+set @1100=1100 ;
+set @x1100="x1100" ;
+set @100=100 ;
+set @updated="updated" ;
+insert into t1 values(1000,'x1000_1') ;
+insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
+on duplicate key update a = a + @100, b = concat(b,@updated) ;
+select a,b from t1 where a >= 1000 ;
+a b
+1100 x1000_1updated
+1000 x1000_3
+delete from t1 where a >= 1000 ;
+insert into t1 values(1000,'x1000_1') ;
+prepare stmt1 from ' insert into t1 values(?,?),(?,?)
+ on duplicate key update a = a + ?, b = concat(b,?) ';
+execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
+select a,b from t1 where a >= 1000 ;
+a b
+1000 x1000_3
+1100 x1000_1updated
+delete from t1 where a >= 1000 ;
+insert into t1 values(1000,'x1000_1') ;
+execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
+select a,b from t1 where a >= 1000 ;
+a b
+1200 x1000_1updatedupdated
+delete from t1 where a >= 1000 ;
+prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+set @duplicate='duplicate ' ;
+set @1000=1000 ;
+set @5=5 ;
+select a,b from t1 where a < 5 ;
+a b
+1 one
+2 two
+3 three
+4 four
+0 NULL
+insert into t1 select a + @1000, concat(@duplicate,b) from t1
+where a < @5 ;
+affected rows: 5
+info: Records: 5 Duplicates: 0 Warnings: 0
+select a,b from t1 where a >= 1000 ;
+a b
+1002 duplicate two
+1001 duplicate one
+1003 duplicate three
+1004 duplicate four
+1000 NULL
+delete from t1 where a >= 1000 ;
+prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1
+where a < ? ' ;
+execute stmt1 using @1000, @duplicate, @5;
+affected rows: 5
+info: Records: 5 Duplicates: 0 Warnings: 0
+select a,b from t1 where a >= 1000 ;
+a b
+1000 NULL
+1004 duplicate four
+1003 duplicate three
+1002 duplicate two
+1001 duplicate one
+delete from t1 where a >= 1000 ;
+set @float=1.00;
+set @five='five' ;
+drop table if exists t2;
+create table t2 like t1 ;
+insert into t2 (b,a)
+select @duplicate, sum(first.a) from t1 first, t1 second
+where first.a <> @5 and second.b = first.b
+and second.b <> @five
+group by second.b
+having sum(second.a) > @2
+union
+select b, a + @100 from t1
+where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b
+from t1);
+affected rows: 8
+info: Records: 8 Duplicates: 0 Warnings: 0
+select a,b from t2;
+a b
+81 duplicate
+82 duplicate
+8 duplicate
+4 duplicate
+9 duplicate
+7 duplicate
+3 duplicate
+103 three
+delete from t2 ;
+prepare stmt1 from ' insert into t2 (b,a)
+select ?, sum(first.a)
+ from t1 first, t1 second
+ where first.a <> ? and second.b = first.b and second.b <> ?
+ group by second.b
+ having sum(second.a) > ?
+union
+select b, a + ? from t1
+ where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b
+ from t1 ) ' ;
+execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ;
+affected rows: 8
+info: Records: 8 Duplicates: 0 Warnings: 0
+select a,b from t2;
+a b
+81 duplicate
+82 duplicate
+8 duplicate
+4 duplicate
+9 duplicate
+7 duplicate
+3 duplicate
+103 three
+drop table t2;
+drop table t1, t_many_col_types;
diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result
new file mode 100644
index 00000000000..a4b01993e76
--- /dev/null
+++ b/mysql-test/r/ps_5merge.result
@@ -0,0 +1,2410 @@
+use test;
+drop table if exists t1, t1_1, t1_2,
+t_many_col_types, t_many_col_types_1, t_many_col_types_2;
+drop table if exists t1, t_many_col_types ;
+create table t1
+(
+a int, b varchar(30),
+primary key(a)
+) engine = 'MYISAM' ;
+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 = 'MYISAM' ;
+rename table t1 to t1_1, t_many_col_types to t_many_col_types_1 ;
+drop table if exists t1, t_many_col_types ;
+create table t1
+(
+a int, b varchar(30),
+primary key(a)
+) engine = 'MYISAM' ;
+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 = 'MYISAM' ;
+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;
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+test_sequence
+------ simple select tests ------
+set @arg00='SELECT' ;
+prepare stmt1 from ' ? a from t1 where a=1 ';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1
+set @arg00=1 ;
+select @arg00, b from t1 where a=1 ;
+@arg00 b
+1 one
+prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+? b
+1 one
+set @arg00='lion' ;
+select @arg00, b from t1 where a=1 ;
+@arg00 b
+lion one
+prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+? b
+lion one
+set @arg00=NULL ;
+select @arg00, b from t1 where a=1 ;
+@arg00 b
+NULL one
+prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+? b
+NULL one
+set @arg00=1 ;
+select b, a - @arg00 from t1 where a=1 ;
+b a - @arg00
+one 0
+prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+b a - ?
+one 0
+set @arg00='MySQL' ;
+select substr(@arg00,1,2) from t1 where a=1 ;
+substr(@arg00,1,2)
+My
+prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+substr(?,1,2)
+My
+set @arg00=3 ;
+select substr('MySQL',@arg00,5) from t1 where a=1 ;
+substr('MySQL',@arg00,5)
+SQL
+prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+substr('MySQL',?,5)
+SQL
+select substr('MySQL',1,@arg00) from t1 where a=1 ;
+substr('MySQL',1,@arg00)
+MyS
+prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+substr('MySQL',1,?)
+MyS
+set @arg00='MySQL' ;
+select a , concat(@arg00,b) from t1 ;
+a concat(@arg00,b)
+1 MySQLone
+2 MySQLtwo
+3 MySQLthree
+4 MySQLfour
+prepare stmt1 from ' select a , concat(?,b) from t1 ' ;
+execute stmt1 using @arg00;
+a concat(?,b)
+1 MySQLone
+2 MySQLtwo
+3 MySQLthree
+4 MySQLfour
+select a , concat(b,@arg00) from t1 ;
+a concat(b,@arg00)
+1 oneMySQL
+2 twoMySQL
+3 threeMySQL
+4 fourMySQL
+prepare stmt1 from ' select a , concat(b,?) from t1 ' ;
+execute stmt1 using @arg00;
+a concat(b,?)
+1 oneMySQL
+2 twoMySQL
+3 threeMySQL
+4 fourMySQL
+set @arg00='MySQL' ;
+select group_concat(@arg00,b) from t1
+group by 'a' ;
+group_concat(@arg00,b)
+MySQLone,MySQLtwo,MySQLthree,MySQLfour
+prepare stmt1 from ' select group_concat(?,b) from t1
+group by ''a'' ' ;
+execute stmt1 using @arg00;
+group_concat(?,b)
+MySQLone,MySQLtwo,MySQLthree,MySQLfour
+select group_concat(b,@arg00) from t1
+group by 'a' ;
+group_concat(b,@arg00)
+oneMySQL,twoMySQL,threeMySQL,fourMySQL
+prepare stmt1 from ' select group_concat(b,?) from t1
+group by ''a'' ' ;
+execute stmt1 using @arg00;
+group_concat(b,?)
+oneMySQL,twoMySQL,threeMySQL,fourMySQL
+set @arg00='first' ;
+set @arg01='second' ;
+set @arg02=NULL;
+select @arg00, @arg01 from t1 where a=1 ;
+@arg00 @arg01
+first second
+prepare stmt1 from ' select ?, ? from t1 where a=1 ' ;
+execute stmt1 using @arg00, @arg01 ;
+? ?
+first second
+execute stmt1 using @arg02, @arg01 ;
+? ?
+NULL second
+execute stmt1 using @arg00, @arg02 ;
+? ?
+first NULL
+execute stmt1 using @arg02, @arg02 ;
+? ?
+NULL NULL
+drop table if exists new_tab ;
+create table new_tab (id1 int(11) not null default '0',
+value2 varchar(100), value1 varchar(100)) ;
+insert into new_tab values (1,'hh','hh'),(2,'hh','hh'),
+(1,'ii','ii'),(2,'ii','ii') ;
+prepare stmt1 from ' select id1,value1 from new_tab where id1=? or value1=? ' ;
+set @arg00=1 ;
+set @arg01='hh' ;
+execute stmt1 using @arg00, @arg01 ;
+id1 value1
+1 hh
+2 hh
+1 ii
+drop table new_tab ;
+drop table if exists new_tab ;
+create table new_tab(session_id char(9) not null) ;
+insert into new_tab values ('abc') ;
+prepare stmt1 from ' select * from new_tab
+where ?=''1111'' and session_id = ''abc'' ' ;
+set @arg00='abc' ;
+execute stmt1 using @arg00 ;
+session_id
+set @arg00='1111' ;
+execute stmt1 using @arg00 ;
+session_id
+abc
+set @arg00='abc' ;
+execute stmt1 using @arg00 ;
+session_id
+drop table new_tab ;
+set @arg00='FROM' ;
+select a @arg00 t1 where a=1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1
+prepare stmt1 from ' select a ? t1 where a=1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1
+set @arg00='t1' ;
+select a from @arg00 where a=1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1
+prepare stmt1 from ' select a from ? where a=1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1
+set @arg00='WHERE' ;
+select a from t1 @arg00 a=1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1
+prepare stmt1 from ' select a from t1 ? a=1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1
+set @arg00=1 ;
+select a FROM t1 where a=@arg00 ;
+a
+1
+prepare stmt1 from ' select a FROM t1 where a=? ' ;
+execute stmt1 using @arg00 ;
+a
+1
+set @arg00=1000 ;
+execute stmt1 using @arg00 ;
+a
+set @arg00=NULL ;
+select a FROM t1 where a=@arg00 ;
+a
+prepare stmt1 from ' select a FROM t1 where a=? ' ;
+execute stmt1 using @arg00 ;
+a
+set @arg00=4 ;
+select a FROM t1 where a=sqrt(@arg00) ;
+a
+2
+prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
+execute stmt1 using @arg00 ;
+a
+2
+set @arg00=NULL ;
+select a FROM t1 where a=sqrt(@arg00) ;
+a
+prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
+execute stmt1 using @arg00 ;
+a
+set @arg00=2 ;
+set @arg01=3 ;
+select a FROM t1 where a in (@arg00,@arg01);
+a
+2
+3
+prepare stmt1 from ' select a FROM t1 where a in (?,?) ';
+execute stmt1 using @arg00, @arg01;
+a
+2
+3
+prepare stmt1 from ' select b FROM t1 where b like ? ';
+set @arg00='two' ;
+execute stmt1 using @arg00 ;
+b
+two
+set @arg00='tw%' ;
+execute stmt1 using @arg00 ;
+b
+two
+set @arg00='%wo' ;
+execute stmt1 using @arg00 ;
+b
+two
+set @arg00='>' ;
+select a FROM t1 where a @arg00 1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1
+prepare stmt1 from ' select a FROM t1 where a ? 1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1
+set @arg00=1 ;
+select a,b FROM t1 where a is not NULL
+AND b is not NULL group by a - @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+prepare stmt1 from ' select a,b FROM t1 where a is not NULL
+AND b is not NULL group by a - ? ' ;
+execute stmt1 using @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00='two' ;
+select a,b FROM t1 where a is not NULL
+AND b is not NULL having b <> @arg00 ;
+a b
+1 one
+3 three
+4 four
+prepare stmt1 from ' select a,b FROM t1 where a is not NULL
+AND b is not NULL having b <> ? ' ;
+execute stmt1 using @arg00 ;
+a b
+1 one
+3 three
+4 four
+set @arg00=1 ;
+select a,b FROM t1 where a is not NULL
+AND b is not NULL order by a - @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+prepare stmt1 from ' select a,b FROM t1 where a is not NULL
+AND b is not NULL order by a - ? ' ;
+execute stmt1 using @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00=2 ;
+select a,b from t1 order by 2 ;
+a b
+4 four
+1 one
+3 three
+2 two
+prepare stmt1 from ' select a,b from t1
+order by ? ';
+execute stmt1 using @arg00;
+a b
+4 four
+1 one
+3 three
+2 two
+set @arg00=1;
+prepare stmt1 from ' select a,b from t1
+limit 1 ';
+execute stmt1 ;
+a b
+1 one
+prepare stmt1 from ' select a,b from t1
+limit ? ';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2
+set @arg00='b' ;
+set @arg01=0 ;
+set @arg02=2 ;
+set @arg03=2 ;
+select sum(a), @arg00 from t1 where a > @arg01
+and b is not null group by substr(b,@arg02)
+having sum(a) <> @arg03 ;
+sum(a) @arg00
+3 b
+1 b
+4 b
+prepare stmt1 from ' select sum(a), ? from t1 where a > ?
+and b is not null group by substr(b,?)
+having sum(a) <> ? ';
+execute stmt1 using @arg00, @arg01, @arg02, @arg03;
+sum(a) ?
+3 b
+1 b
+4 b
+test_sequence
+------ join tests ------
+select first.a as a1, second.a as a2
+from t1 first, t1 second
+where first.a = second.a ;
+a1 a2
+1 1
+2 2
+3 3
+4 4
+prepare stmt1 from ' select first.a as a1, second.a as a2
+ from t1 first, t1 second
+ where first.a = second.a ';
+execute stmt1 ;
+a1 a2
+1 1
+2 2
+3 3
+4 4
+set @arg00='ABC';
+set @arg01='two';
+set @arg02='one';
+select first.a, @arg00, second.a FROM t1 first, t1 second
+where @arg01 = first.b or first.a = second.a or second.b = @arg02;
+a @arg00 a
+1 ABC 1
+2 ABC 1
+3 ABC 1
+4 ABC 1
+2 ABC 2
+2 ABC 3
+3 ABC 3
+2 ABC 4
+4 ABC 4
+prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
+ where ? = first.b or first.a = second.a or second.b = ? ';
+execute stmt1 using @arg00, @arg01, @arg02;
+a ? a
+1 ABC 1
+2 ABC 1
+3 ABC 1
+4 ABC 1
+2 ABC 2
+2 ABC 3
+3 ABC 3
+2 ABC 4
+4 ABC 4
+test_sequence
+------ subquery tests ------
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = ''two'') ';
+execute stmt1 ;
+a b
+2 two
+set @arg00='two' ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where b = 'two' ) and b=@arg00 ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = ''two'') and b=? ';
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00='two' ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where b = @arg00 ) and b='two' ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = ? ) and b=''two'' ' ;
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=3 ;
+set @arg01='three' ;
+select a,b FROM t1 where (a,b) in (select 3, 'three');
+a b
+3 three
+select a FROM t1 where (a,b) in (select @arg00,@arg01);
+a
+3
+prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) ';
+execute stmt1 using @arg00, @arg01;
+a
+3
+set @arg00=1 ;
+set @arg01='two' ;
+set @arg02=2 ;
+set @arg03='two' ;
+select a, @arg00, b FROM t1 outer_table where
+b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ;
+a @arg00 b
+2 1 two
+prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
+ b=? and a = (select ? from t1 where b = ? ) ' ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
+a ? b
+2 1 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = outer_table.b ) ';
+execute stmt1 ;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00='two' ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where b = outer_table.b ) and b=@arg00 ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = outer_table.b) and b=? ';
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=2 ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ;
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=2 ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ;
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=1 ;
+set @arg01='two' ;
+set @arg02=2 ;
+set @arg03='two' ;
+select a, @arg00, b FROM t1 outer_table where
+b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03
+and outer_table.a=a ) ;
+a @arg00 b
+2 1 two
+prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
+ b=? and a = (select ? from t1 where outer_table.b = ?
+ and outer_table.a=a ) ' ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
+a ? b
+2 1 two
+set @arg00=1 ;
+set @arg01=0 ;
+select a, @arg00
+from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2
+where a=@arg01;
+a @arg00
+0 1
+prepare stmt1 from ' select a, ?
+ from ( select a - ? as a from t1 where a=? ) as t2
+ where a=? ';
+execute stmt1 using @arg00, @arg00, @arg00, @arg01 ;
+a ?
+0 1
+drop table if exists t2 ;
+create table t2 as select * from t_many_col_types;
+set @stmt= ' SELECT
+ (SELECT SUM(c1 + c12 + 0.0) FROM t2
+ where (t_many_col_types.c2 - 0e-3) = t2.c2
+ GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s,
+ exists (select 1.0e+0 from t2
+ where t2.c3 * 9.0000000000 = t_many_col_types.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 t_many_col_types,
+(select c25 x, c32 y from t2) tt WHERE x = c25 ' ;
+prepare stmt1 from @stmt ;
+execute stmt1 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def scalar_s 5 21 7 Y 32768 4 8
+def exists_s 8 1 1 N 32769 0 8
+def in_s 8 21 1 Y 32768 0 8
+def in_row_s 8 21 1 Y 32768 0 8
+scalar_s exists_s in_s in_row_s
+2.0000 0 1 0
+18.0000 1 0 1
+2.0000 0 1 0
+18.0000 1 0 1
+execute stmt1 ;
+scalar_s exists_s in_s in_row_s
+2.0000 0 1 0
+18.0000 1 0 1
+2.0000 0 1 0
+18.0000 1 0 1
+set @stmt= concat('explain ',@stmt);
+prepare stmt1 from @stmt ;
+execute stmt1 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def id 8 3 1 N 32801 0 8
+def select_type 253 19 18 N 1 31 63
+def table 253 64 16 N 1 31 63
+def type 253 10 3 N 1 31 63
+def possible_keys 253 4096 0 Y 0 31 63
+def key 253 64 0 Y 0 31 63
+def key_len 253 4096 0 Y 0 31 63
+def ref 253 1024 0 Y 0 31 63
+def rows 8 10 1 N 32801 0 8
+def Extra 253 255 44 N 1 31 63
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+execute stmt1 ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+set @stmt= ' SELECT
+ (SELECT SUM(c1+c12+?) FROM t2 where (t_many_col_types.c2-?)=t2.c2
+ GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s,
+ exists (select ? from t2
+ where t2.c3*?=t_many_col_types.c4) as exists_s,
+ c5*? in (select c6+? from t2) as in_s,
+ (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s
+FROM t_many_col_types,
+(select c25 x, c32 y from t2) tt WHERE x =c25 ' ;
+set @arg00= 0.0 ;
+set @arg01= 0e-3 ;
+set @arg02= 1.0e+0 ;
+set @arg03= 9.0000000000 ;
+set @arg04= 4 ;
+set @arg05= 0.3e+1 ;
+set @arg06= 4 ;
+set @arg07= 4 ;
+set @arg08= 4.0 ;
+set @arg09= 40e-1 ;
+prepare stmt1 from @stmt ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def scalar_s 5 23 2 Y 32768 31 8
+def exists_s 8 1 1 N 32769 0 8
+def in_s 8 21 1 Y 32768 0 8
+def in_row_s 8 21 1 Y 32768 0 8
+scalar_s exists_s in_s in_row_s
+2 0 1 0
+18 1 0 1
+2 0 1 0
+18 1 0 1
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+scalar_s exists_s in_s in_row_s
+2 0 1 0
+18 1 0 1
+2 0 1 0
+18 1 0 1
+set @stmt= concat('explain ',@stmt);
+prepare stmt1 from @stmt ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def id 8 3 1 N 32801 0 8
+def select_type 253 19 18 N 1 31 63
+def table 253 64 16 N 1 31 63
+def type 253 10 3 N 1 31 63
+def possible_keys 253 4096 0 Y 0 31 63
+def key 253 64 0 Y 0 31 63
+def key_len 253 4096 0 Y 0 31 63
+def ref 253 1024 0 Y 0 31 63
+def rows 8 10 1 N 32801 0 8
+def Extra 253 255 44 N 1 31 63
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+drop table t2 ;
+test_sequence
+------ union tests ------
+prepare stmt1 from ' select a FROM t1 where a=1
+ union distinct
+ select a FROM t1 where a=1 ';
+execute stmt1 ;
+a
+1
+execute stmt1 ;
+a
+1
+prepare stmt1 from ' select a FROM t1 where a=1
+ union all
+ select a FROM t1 where a=1 ';
+execute stmt1 ;
+a
+1
+1
+set @arg00=1 ;
+select @arg00 FROM t1 where a=1
+union distinct
+select 1 FROM t1 where a=1;
+@arg00
+1
+prepare stmt1 from ' select ? FROM t1 where a=1
+ union distinct
+ select 1 FROM t1 where a=1 ' ;
+execute stmt1 using @arg00;
+?
+1
+set @arg00=1 ;
+select 1 FROM t1 where a=1
+union distinct
+select @arg00 FROM t1 where a=1;
+1
+1
+prepare stmt1 from ' select 1 FROM t1 where a=1
+ union distinct
+ select ? FROM t1 where a=1 ' ;
+execute stmt1 using @arg00;
+1
+1
+set @arg00='a' ;
+select @arg00 FROM t1 where a=1
+union distinct
+select @arg00 FROM t1 where a=1;
+@arg00
+a
+prepare stmt1 from ' select ? FROM t1 where a=1
+ union distinct
+ select ? FROM t1 where a=1 ';
+execute stmt1 using @arg00, @arg00;
+?
+a
+prepare stmt1 from ' select ?
+ union distinct
+ select ? ';
+execute stmt1 using @arg00, @arg00;
+?
+a
+set @arg00='a' ;
+set @arg01=1 ;
+set @arg02='a' ;
+set @arg03=2 ;
+select @arg00 FROM t1 where a=@arg01
+union distinct
+select @arg02 FROM t1 where a=@arg03;
+@arg00
+a
+prepare stmt1 from ' select ? FROM t1 where a=?
+ union distinct
+ select ? FROM t1 where a=? ' ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03;
+?
+a
+set @arg00=1 ;
+prepare stmt1 from ' select sum(a) + 200, ? from t1
+union distinct
+select sum(a) + 200, 1 from t1
+group by b ' ;
+execute stmt1 using @arg00;
+sum(a) + 200 ?
+210 1
+204 1
+201 1
+203 1
+202 1
+set @Oporto='Oporto' ;
+set @Lisboa='Lisboa' ;
+set @0=0 ;
+set @1=1 ;
+set @2=2 ;
+set @3=3 ;
+set @4=4 ;
+select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ;
+@Oporto @Lisboa @0 @1 @2 @3 @4
+Oporto Lisboa 0 1 2 3 4
+select sum(a) + 200 as the_sum, @Oporto as the_town from t1
+group by b
+union distinct
+select sum(a) + 200, @Lisboa from t1
+group by b ;
+the_sum the_town
+204 Oporto
+201 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+201 Lisboa
+203 Lisboa
+202 Lisboa
+prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
+ group by b
+ union distinct
+ select sum(a) + 200, ? from t1
+ group by b ' ;
+execute stmt1 using @Oporto, @Lisboa;
+the_sum the_town
+204 Oporto
+201 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+201 Lisboa
+203 Lisboa
+202 Lisboa
+select sum(a) + 200 as the_sum, @Oporto as the_town from t1
+where a > @1
+group by b
+union distinct
+select sum(a) + 200, @Lisboa from t1
+where a > @2
+group by b ;
+the_sum the_town
+204 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+203 Lisboa
+prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
+ where a > ?
+ group by b
+ union distinct
+ select sum(a) + 200, ? from t1
+ where a > ?
+ group by b ' ;
+execute stmt1 using @Oporto, @1, @Lisboa, @2;
+the_sum the_town
+204 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+203 Lisboa
+select sum(a) + 200 as the_sum, @Oporto as the_town from t1
+where a > @1
+group by b
+having avg(a) > @2
+union distinct
+select sum(a) + 200, @Lisboa from t1
+where a > @2
+group by b
+having avg(a) > @3;
+the_sum the_town
+204 Oporto
+203 Oporto
+204 Lisboa
+prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
+ where a > ?
+ group by b
+ having avg(a) > ?
+ union distinct
+ select sum(a) + 200, ? from t1
+ where a > ?
+ group by b
+ having avg(a) > ? ';
+execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3;
+the_sum the_town
+204 Oporto
+203 Oporto
+204 Lisboa
+test_sequence
+------ explain select tests ------
+prepare stmt1 from ' select * from t_many_col_types ' ;
+execute stmt1;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def test t_many_col_types t_many_col_types c1 c1 1 4 1 N 49155 0 63
+def test t_many_col_types t_many_col_types c2 c2 2 6 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c3 c3 9 9 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c4 c4 3 11 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c5 c5 3 11 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c6 c6 8 20 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c7 c7 4 12 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c8 c8 5 22 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c9 c9 5 22 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c10 c10 5 22 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63
+def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63
+def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63
+def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63
+def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1217 0 63
+def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63
+def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63
+def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c19 c19 1 1 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c20 c20 254 1 1 Y 0 0 8
+def test t_many_col_types t_many_col_types c21 c21 253 10 10 Y 0 0 8
+def test t_many_col_types t_many_col_types c22 c22 253 30 30 Y 0 0 8
+def test t_many_col_types t_many_col_types c23 c23 252 255 8 Y 144 0 63
+def test t_many_col_types t_many_col_types c24 c24 252 255 8 Y 16 0 8
+def test t_many_col_types t_many_col_types c25 c25 252 65535 4 Y 144 0 63
+def test t_many_col_types t_many_col_types c26 c26 252 65535 4 Y 16 0 8
+def test t_many_col_types t_many_col_types c27 c27 252 16777215 10 Y 144 0 63
+def test t_many_col_types t_many_col_types c28 c28 252 16777215 10 Y 16 0 8
+def test t_many_col_types t_many_col_types c29 c29 252 16777215 8 Y 144 0 63
+def test t_many_col_types t_many_col_types c30 c30 252 16777215 8 Y 16 0 8
+def test t_many_col_types t_many_col_types c31 c31 254 5 3 Y 256 0 8
+def test t_many_col_types t_many_col_types c32 c32 254 24 7 Y 2048 0 8
+c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
+1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
+9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
+test_sequence
+------ delete tests ------
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+prepare stmt1 from 'delete from t1 where a=2' ;
+execute stmt1;
+select a,b from t1 where a=2;
+a b
+execute stmt1;
+insert into t1 values(0,NULL);
+set @arg00=NULL;
+prepare stmt1 from 'delete from t1 where b=?' ;
+execute stmt1 using @arg00;
+select a,b from t1 where b is NULL ;
+a b
+0 NULL
+set @arg00='one';
+execute stmt1 using @arg00;
+select a,b from t1 where b=@arg00;
+a b
+prepare stmt1 from 'truncate table t1' ;
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+test_sequence
+------ update tests ------
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ;
+execute stmt1;
+select a,b from t1 where a=2;
+a b
+2 a=two
+execute stmt1;
+select a,b from t1 where a=2;
+a b
+2 a=two
+set @arg00=NULL;
+prepare stmt1 from 'update t1 set b=? where a=2' ;
+execute stmt1 using @arg00;
+select a,b from t1 where a=2;
+a b
+2 NULL
+set @arg00='two';
+execute stmt1 using @arg00;
+select a,b from t1 where a=2;
+a b
+2 two
+set @arg00=2;
+prepare stmt1 from 'update t1 set b=NULL where a=?' ;
+execute stmt1 using @arg00;
+select a,b from t1 where a=@arg00;
+a b
+2 NULL
+update t1 set b='two' where a=@arg00;
+set @arg00=2000;
+execute stmt1 using @arg00;
+select a,b from t1 where a=@arg00;
+a b
+set @arg00=2;
+set @arg01=22;
+prepare stmt1 from 'update t1 set a=? where a=?' ;
+execute stmt1 using @arg00, @arg00;
+select a,b from t1 where a=@arg00;
+a b
+2 two
+execute stmt1 using @arg01, @arg00;
+select a,b from t1 where a=@arg01;
+a b
+22 two
+execute stmt1 using @arg00, @arg01;
+select a,b from t1 where a=@arg00;
+a b
+2 two
+set @arg00=NULL;
+set @arg01=2;
+execute stmt1 using @arg00, @arg01;
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+select a,b from t1;
+a b
+3 three
+0 two
+1 one
+4 four
+set @arg00=0;
+execute stmt1 using @arg01, @arg00;
+select a,b from t1;
+a b
+3 three
+2 two
+1 one
+4 four
+set @arg00=23;
+set @arg01='two';
+set @arg02=2;
+set @arg03='two';
+set @arg04=2;
+drop table if exists t2;
+create table t2 as select a,b from t1 ;
+prepare stmt1 from 'update t1 set a=? where b=?
+ and a in (select ? from t2
+ where b = ? or a = ?)';
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ;
+select a,b from t1 where a = @arg00 ;
+a b
+23 two
+prepare stmt1 from 'update t1 set a=? where b=?
+ and a not in (select ? from t2
+ where b = ? or a = ?)';
+execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
+select a,b from t1 ;
+a b
+3 three
+2 two
+1 one
+4 four
+drop table t2 ;
+set @arg00=1;
+prepare stmt1 from 'update t1 set b=''bla''
+where a=2
+limit 1';
+execute stmt1 ;
+select a,b from t1 where b = 'bla' ;
+a b
+2 bla
+prepare stmt1 from 'update t1 set b=''bla''
+where a=2
+limit ?';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3
+test_sequence
+------ insert tests ------
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+prepare stmt1 from 'insert into t1 values(5, ''five'' )';
+execute stmt1;
+select a,b from t1 where a = 5;
+a b
+5 five
+set @arg00='six' ;
+prepare stmt1 from 'insert into t1 values(6, ? )';
+execute stmt1 using @arg00;
+select a,b from t1 where b = @arg00;
+a b
+6 six
+execute stmt1 using @arg00;
+ERROR 23000: Duplicate entry '6' for key 1
+set @arg00=NULL ;
+prepare stmt1 from 'insert into t1 values(0, ? )';
+execute stmt1 using @arg00;
+select a,b from t1 where b is NULL;
+a b
+0 NULL
+set @arg00=8 ;
+set @arg01='eight' ;
+prepare stmt1 from 'insert into t1 values(?, ? )';
+execute stmt1 using @arg00, @arg01 ;
+select a,b from t1 where b = @arg01;
+a b
+8 eight
+set @arg00=81 ;
+set @arg01='8-1' ;
+set @arg02=82 ;
+set @arg03='8-2' ;
+prepare stmt1 from 'insert into t1 values(?,?),(?,?)';
+execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
+select a,b from t1 where a in (@arg00,@arg02) ;
+a b
+81 8-1
+82 8-2
+set @arg00=9 ;
+set @arg01='nine' ;
+prepare stmt1 from 'insert into t1 set a=?, b=? ';
+execute stmt1 using @arg00, @arg01 ;
+select a,b from t1 where a = @arg00 ;
+a b
+9 nine
+set @arg00=6 ;
+set @arg01=1 ;
+prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
+ on duplicate key update a=a + ?, b=concat(b,''modified'') ';
+execute stmt1 using @arg00, @arg01;
+select * from t1;
+a b
+4 four
+3 three
+2 two
+1 one
+5 five
+7 sixmodified
+0 NULL
+8 eight
+81 8-1
+82 8-2
+9 nine
+set @arg00=81 ;
+set @arg01=1 ;
+execute stmt1 using @arg00, @arg01;
+ERROR 23000: Duplicate entry '82' for key 1
+set @1000=1000 ;
+set @x1000_2="x1000_2" ;
+set @x1000_3="x1000_3" ;
+set @x1000="x1000" ;
+set @1100=1100 ;
+set @x1100="x1100" ;
+set @100=100 ;
+set @updated="updated" ;
+insert into t1 values(1000,'x1000_1') ;
+insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
+on duplicate key update a = a + @100, b = concat(b,@updated) ;
+select a,b from t1 where a >= 1000 ;
+a b
+1000 x1000_3
+1100 x1000_1updated
+delete from t1 where a >= 1000 ;
+insert into t1 values(1000,'x1000_1') ;
+prepare stmt1 from ' insert into t1 values(?,?),(?,?)
+ on duplicate key update a = a + ?, b = concat(b,?) ';
+execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
+select a,b from t1 where a >= 1000 ;
+a b
+1000 x1000_3
+1100 x1000_1updated
+delete from t1 where a >= 1000 ;
+insert into t1 values(1000,'x1000_1') ;
+execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
+select a,b from t1 where a >= 1000 ;
+a b
+1200 x1000_1updatedupdated
+delete from t1 where a >= 1000 ;
+prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+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;
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+test_sequence
+------ simple select tests ------
+set @arg00='SELECT' ;
+prepare stmt1 from ' ? a from t1 where a=1 ';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1
+set @arg00=1 ;
+select @arg00, b from t1 where a=1 ;
+@arg00 b
+1 one
+prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+? b
+1 one
+set @arg00='lion' ;
+select @arg00, b from t1 where a=1 ;
+@arg00 b
+lion one
+prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+? b
+lion one
+set @arg00=NULL ;
+select @arg00, b from t1 where a=1 ;
+@arg00 b
+NULL one
+prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+? b
+NULL one
+set @arg00=1 ;
+select b, a - @arg00 from t1 where a=1 ;
+b a - @arg00
+one 0
+prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+b a - ?
+one 0
+set @arg00='MySQL' ;
+select substr(@arg00,1,2) from t1 where a=1 ;
+substr(@arg00,1,2)
+My
+prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+substr(?,1,2)
+My
+set @arg00=3 ;
+select substr('MySQL',@arg00,5) from t1 where a=1 ;
+substr('MySQL',@arg00,5)
+SQL
+prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+substr('MySQL',?,5)
+SQL
+select substr('MySQL',1,@arg00) from t1 where a=1 ;
+substr('MySQL',1,@arg00)
+MyS
+prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+substr('MySQL',1,?)
+MyS
+set @arg00='MySQL' ;
+select a , concat(@arg00,b) from t1 ;
+a concat(@arg00,b)
+1 MySQLone
+2 MySQLtwo
+3 MySQLthree
+4 MySQLfour
+prepare stmt1 from ' select a , concat(?,b) from t1 ' ;
+execute stmt1 using @arg00;
+a concat(?,b)
+1 MySQLone
+2 MySQLtwo
+3 MySQLthree
+4 MySQLfour
+select a , concat(b,@arg00) from t1 ;
+a concat(b,@arg00)
+1 oneMySQL
+2 twoMySQL
+3 threeMySQL
+4 fourMySQL
+prepare stmt1 from ' select a , concat(b,?) from t1 ' ;
+execute stmt1 using @arg00;
+a concat(b,?)
+1 oneMySQL
+2 twoMySQL
+3 threeMySQL
+4 fourMySQL
+set @arg00='MySQL' ;
+select group_concat(@arg00,b) from t1
+group by 'a' ;
+group_concat(@arg00,b)
+MySQLone,MySQLtwo,MySQLthree,MySQLfour
+prepare stmt1 from ' select group_concat(?,b) from t1
+group by ''a'' ' ;
+execute stmt1 using @arg00;
+group_concat(?,b)
+MySQLone,MySQLtwo,MySQLthree,MySQLfour
+select group_concat(b,@arg00) from t1
+group by 'a' ;
+group_concat(b,@arg00)
+oneMySQL,twoMySQL,threeMySQL,fourMySQL
+prepare stmt1 from ' select group_concat(b,?) from t1
+group by ''a'' ' ;
+execute stmt1 using @arg00;
+group_concat(b,?)
+oneMySQL,twoMySQL,threeMySQL,fourMySQL
+set @arg00='first' ;
+set @arg01='second' ;
+set @arg02=NULL;
+select @arg00, @arg01 from t1 where a=1 ;
+@arg00 @arg01
+first second
+prepare stmt1 from ' select ?, ? from t1 where a=1 ' ;
+execute stmt1 using @arg00, @arg01 ;
+? ?
+first second
+execute stmt1 using @arg02, @arg01 ;
+? ?
+NULL second
+execute stmt1 using @arg00, @arg02 ;
+? ?
+first NULL
+execute stmt1 using @arg02, @arg02 ;
+? ?
+NULL NULL
+drop table if exists new_tab ;
+create table new_tab (id1 int(11) not null default '0',
+value2 varchar(100), value1 varchar(100)) ;
+insert into new_tab values (1,'hh','hh'),(2,'hh','hh'),
+(1,'ii','ii'),(2,'ii','ii') ;
+prepare stmt1 from ' select id1,value1 from new_tab where id1=? or value1=? ' ;
+set @arg00=1 ;
+set @arg01='hh' ;
+execute stmt1 using @arg00, @arg01 ;
+id1 value1
+1 hh
+2 hh
+1 ii
+drop table new_tab ;
+drop table if exists new_tab ;
+create table new_tab(session_id char(9) not null) ;
+insert into new_tab values ('abc') ;
+prepare stmt1 from ' select * from new_tab
+where ?=''1111'' and session_id = ''abc'' ' ;
+set @arg00='abc' ;
+execute stmt1 using @arg00 ;
+session_id
+set @arg00='1111' ;
+execute stmt1 using @arg00 ;
+session_id
+abc
+set @arg00='abc' ;
+execute stmt1 using @arg00 ;
+session_id
+drop table new_tab ;
+set @arg00='FROM' ;
+select a @arg00 t1 where a=1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1
+prepare stmt1 from ' select a ? t1 where a=1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1
+set @arg00='t1' ;
+select a from @arg00 where a=1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1
+prepare stmt1 from ' select a from ? where a=1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1
+set @arg00='WHERE' ;
+select a from t1 @arg00 a=1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1
+prepare stmt1 from ' select a from t1 ? a=1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1
+set @arg00=1 ;
+select a FROM t1 where a=@arg00 ;
+a
+1
+prepare stmt1 from ' select a FROM t1 where a=? ' ;
+execute stmt1 using @arg00 ;
+a
+1
+set @arg00=1000 ;
+execute stmt1 using @arg00 ;
+a
+set @arg00=NULL ;
+select a FROM t1 where a=@arg00 ;
+a
+prepare stmt1 from ' select a FROM t1 where a=? ' ;
+execute stmt1 using @arg00 ;
+a
+set @arg00=4 ;
+select a FROM t1 where a=sqrt(@arg00) ;
+a
+2
+prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
+execute stmt1 using @arg00 ;
+a
+2
+set @arg00=NULL ;
+select a FROM t1 where a=sqrt(@arg00) ;
+a
+prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
+execute stmt1 using @arg00 ;
+a
+set @arg00=2 ;
+set @arg01=3 ;
+select a FROM t1 where a in (@arg00,@arg01);
+a
+2
+3
+prepare stmt1 from ' select a FROM t1 where a in (?,?) ';
+execute stmt1 using @arg00, @arg01;
+a
+2
+3
+prepare stmt1 from ' select b FROM t1 where b like ? ';
+set @arg00='two' ;
+execute stmt1 using @arg00 ;
+b
+two
+set @arg00='tw%' ;
+execute stmt1 using @arg00 ;
+b
+two
+set @arg00='%wo' ;
+execute stmt1 using @arg00 ;
+b
+two
+set @arg00='>' ;
+select a FROM t1 where a @arg00 1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1
+prepare stmt1 from ' select a FROM t1 where a ? 1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1
+set @arg00=1 ;
+select a,b FROM t1 where a is not NULL
+AND b is not NULL group by a - @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+prepare stmt1 from ' select a,b FROM t1 where a is not NULL
+AND b is not NULL group by a - ? ' ;
+execute stmt1 using @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00='two' ;
+select a,b FROM t1 where a is not NULL
+AND b is not NULL having b <> @arg00 ;
+a b
+1 one
+3 three
+4 four
+prepare stmt1 from ' select a,b FROM t1 where a is not NULL
+AND b is not NULL having b <> ? ' ;
+execute stmt1 using @arg00 ;
+a b
+1 one
+3 three
+4 four
+set @arg00=1 ;
+select a,b FROM t1 where a is not NULL
+AND b is not NULL order by a - @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+prepare stmt1 from ' select a,b FROM t1 where a is not NULL
+AND b is not NULL order by a - ? ' ;
+execute stmt1 using @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00=2 ;
+select a,b from t1 order by 2 ;
+a b
+4 four
+1 one
+3 three
+2 two
+prepare stmt1 from ' select a,b from t1
+order by ? ';
+execute stmt1 using @arg00;
+a b
+4 four
+1 one
+3 three
+2 two
+set @arg00=1;
+prepare stmt1 from ' select a,b from t1
+limit 1 ';
+execute stmt1 ;
+a b
+1 one
+prepare stmt1 from ' select a,b from t1
+limit ? ';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2
+set @arg00='b' ;
+set @arg01=0 ;
+set @arg02=2 ;
+set @arg03=2 ;
+select sum(a), @arg00 from t1 where a > @arg01
+and b is not null group by substr(b,@arg02)
+having sum(a) <> @arg03 ;
+sum(a) @arg00
+3 b
+1 b
+4 b
+prepare stmt1 from ' select sum(a), ? from t1 where a > ?
+and b is not null group by substr(b,?)
+having sum(a) <> ? ';
+execute stmt1 using @arg00, @arg01, @arg02, @arg03;
+sum(a) ?
+3 b
+1 b
+4 b
+test_sequence
+------ join tests ------
+select first.a as a1, second.a as a2
+from t1 first, t1 second
+where first.a = second.a ;
+a1 a2
+1 1
+2 2
+3 3
+4 4
+prepare stmt1 from ' select first.a as a1, second.a as a2
+ from t1 first, t1 second
+ where first.a = second.a ';
+execute stmt1 ;
+a1 a2
+1 1
+2 2
+3 3
+4 4
+set @arg00='ABC';
+set @arg01='two';
+set @arg02='one';
+select first.a, @arg00, second.a FROM t1 first, t1 second
+where @arg01 = first.b or first.a = second.a or second.b = @arg02;
+a @arg00 a
+1 ABC 1
+2 ABC 1
+3 ABC 1
+4 ABC 1
+2 ABC 2
+2 ABC 3
+3 ABC 3
+2 ABC 4
+4 ABC 4
+prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
+ where ? = first.b or first.a = second.a or second.b = ? ';
+execute stmt1 using @arg00, @arg01, @arg02;
+a ? a
+1 ABC 1
+2 ABC 1
+3 ABC 1
+4 ABC 1
+2 ABC 2
+2 ABC 3
+3 ABC 3
+2 ABC 4
+4 ABC 4
+test_sequence
+------ subquery tests ------
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = ''two'') ';
+execute stmt1 ;
+a b
+2 two
+set @arg00='two' ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where b = 'two' ) and b=@arg00 ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = ''two'') and b=? ';
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00='two' ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where b = @arg00 ) and b='two' ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = ? ) and b=''two'' ' ;
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=3 ;
+set @arg01='three' ;
+select a,b FROM t1 where (a,b) in (select 3, 'three');
+a b
+3 three
+select a FROM t1 where (a,b) in (select @arg00,@arg01);
+a
+3
+prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) ';
+execute stmt1 using @arg00, @arg01;
+a
+3
+set @arg00=1 ;
+set @arg01='two' ;
+set @arg02=2 ;
+set @arg03='two' ;
+select a, @arg00, b FROM t1 outer_table where
+b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ;
+a @arg00 b
+2 1 two
+prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
+ b=? and a = (select ? from t1 where b = ? ) ' ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
+a ? b
+2 1 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = outer_table.b ) ';
+execute stmt1 ;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00='two' ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where b = outer_table.b ) and b=@arg00 ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = outer_table.b) and b=? ';
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=2 ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ;
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=2 ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ;
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=1 ;
+set @arg01='two' ;
+set @arg02=2 ;
+set @arg03='two' ;
+select a, @arg00, b FROM t1 outer_table where
+b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03
+and outer_table.a=a ) ;
+a @arg00 b
+2 1 two
+prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
+ b=? and a = (select ? from t1 where outer_table.b = ?
+ and outer_table.a=a ) ' ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
+a ? b
+2 1 two
+set @arg00=1 ;
+set @arg01=0 ;
+select a, @arg00
+from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2
+where a=@arg01;
+a @arg00
+0 1
+prepare stmt1 from ' select a, ?
+ from ( select a - ? as a from t1 where a=? ) as t2
+ where a=? ';
+execute stmt1 using @arg00, @arg00, @arg00, @arg01 ;
+a ?
+0 1
+drop table if exists t2 ;
+create table t2 as select * from t_many_col_types;
+set @stmt= ' SELECT
+ (SELECT SUM(c1 + c12 + 0.0) FROM t2
+ where (t_many_col_types.c2 - 0e-3) = t2.c2
+ GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s,
+ exists (select 1.0e+0 from t2
+ where t2.c3 * 9.0000000000 = t_many_col_types.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 t_many_col_types,
+(select c25 x, c32 y from t2) tt WHERE x = c25 ' ;
+prepare stmt1 from @stmt ;
+execute stmt1 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def scalar_s 5 21 7 Y 32768 4 8
+def exists_s 8 1 1 N 32769 0 8
+def in_s 8 21 1 Y 32768 0 8
+def in_row_s 8 21 1 Y 32768 0 8
+scalar_s exists_s in_s in_row_s
+2.0000 0 1 0
+18.0000 1 0 1
+2.0000 0 1 0
+18.0000 1 0 1
+execute stmt1 ;
+scalar_s exists_s in_s in_row_s
+2.0000 0 1 0
+18.0000 1 0 1
+2.0000 0 1 0
+18.0000 1 0 1
+set @stmt= concat('explain ',@stmt);
+prepare stmt1 from @stmt ;
+execute stmt1 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def id 8 3 1 N 32801 0 8
+def select_type 253 19 18 N 1 31 63
+def table 253 64 16 N 1 31 63
+def type 253 10 3 N 1 31 63
+def possible_keys 253 4096 0 Y 0 31 63
+def key 253 64 0 Y 0 31 63
+def key_len 253 4096 0 Y 0 31 63
+def ref 253 1024 0 Y 0 31 63
+def rows 8 10 1 N 32801 0 8
+def Extra 253 255 44 N 1 31 63
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+execute stmt1 ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+set @stmt= ' SELECT
+ (SELECT SUM(c1+c12+?) FROM t2 where (t_many_col_types.c2-?)=t2.c2
+ GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s,
+ exists (select ? from t2
+ where t2.c3*?=t_many_col_types.c4) as exists_s,
+ c5*? in (select c6+? from t2) as in_s,
+ (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s
+FROM t_many_col_types,
+(select c25 x, c32 y from t2) tt WHERE x =c25 ' ;
+set @arg00= 0.0 ;
+set @arg01= 0e-3 ;
+set @arg02= 1.0e+0 ;
+set @arg03= 9.0000000000 ;
+set @arg04= 4 ;
+set @arg05= 0.3e+1 ;
+set @arg06= 4 ;
+set @arg07= 4 ;
+set @arg08= 4.0 ;
+set @arg09= 40e-1 ;
+prepare stmt1 from @stmt ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def scalar_s 5 23 2 Y 32768 31 8
+def exists_s 8 1 1 N 32769 0 8
+def in_s 8 21 1 Y 32768 0 8
+def in_row_s 8 21 1 Y 32768 0 8
+scalar_s exists_s in_s in_row_s
+2 0 1 0
+18 1 0 1
+2 0 1 0
+18 1 0 1
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+scalar_s exists_s in_s in_row_s
+2 0 1 0
+18 1 0 1
+2 0 1 0
+18 1 0 1
+set @stmt= concat('explain ',@stmt);
+prepare stmt1 from @stmt ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def id 8 3 1 N 32801 0 8
+def select_type 253 19 18 N 1 31 63
+def table 253 64 16 N 1 31 63
+def type 253 10 3 N 1 31 63
+def possible_keys 253 4096 0 Y 0 31 63
+def key 253 64 0 Y 0 31 63
+def key_len 253 4096 0 Y 0 31 63
+def ref 253 1024 0 Y 0 31 63
+def rows 8 10 1 N 32801 0 8
+def Extra 253 255 44 N 1 31 63
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+drop table t2 ;
+test_sequence
+------ union tests ------
+prepare stmt1 from ' select a FROM t1 where a=1
+ union distinct
+ select a FROM t1 where a=1 ';
+execute stmt1 ;
+a
+1
+execute stmt1 ;
+a
+1
+prepare stmt1 from ' select a FROM t1 where a=1
+ union all
+ select a FROM t1 where a=1 ';
+execute stmt1 ;
+a
+1
+1
+set @arg00=1 ;
+select @arg00 FROM t1 where a=1
+union distinct
+select 1 FROM t1 where a=1;
+@arg00
+1
+prepare stmt1 from ' select ? FROM t1 where a=1
+ union distinct
+ select 1 FROM t1 where a=1 ' ;
+execute stmt1 using @arg00;
+?
+1
+set @arg00=1 ;
+select 1 FROM t1 where a=1
+union distinct
+select @arg00 FROM t1 where a=1;
+1
+1
+prepare stmt1 from ' select 1 FROM t1 where a=1
+ union distinct
+ select ? FROM t1 where a=1 ' ;
+execute stmt1 using @arg00;
+1
+1
+set @arg00='a' ;
+select @arg00 FROM t1 where a=1
+union distinct
+select @arg00 FROM t1 where a=1;
+@arg00
+a
+prepare stmt1 from ' select ? FROM t1 where a=1
+ union distinct
+ select ? FROM t1 where a=1 ';
+execute stmt1 using @arg00, @arg00;
+?
+a
+prepare stmt1 from ' select ?
+ union distinct
+ select ? ';
+execute stmt1 using @arg00, @arg00;
+?
+a
+set @arg00='a' ;
+set @arg01=1 ;
+set @arg02='a' ;
+set @arg03=2 ;
+select @arg00 FROM t1 where a=@arg01
+union distinct
+select @arg02 FROM t1 where a=@arg03;
+@arg00
+a
+prepare stmt1 from ' select ? FROM t1 where a=?
+ union distinct
+ select ? FROM t1 where a=? ' ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03;
+?
+a
+set @arg00=1 ;
+prepare stmt1 from ' select sum(a) + 200, ? from t1
+union distinct
+select sum(a) + 200, 1 from t1
+group by b ' ;
+execute stmt1 using @arg00;
+sum(a) + 200 ?
+210 1
+204 1
+201 1
+203 1
+202 1
+set @Oporto='Oporto' ;
+set @Lisboa='Lisboa' ;
+set @0=0 ;
+set @1=1 ;
+set @2=2 ;
+set @3=3 ;
+set @4=4 ;
+select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ;
+@Oporto @Lisboa @0 @1 @2 @3 @4
+Oporto Lisboa 0 1 2 3 4
+select sum(a) + 200 as the_sum, @Oporto as the_town from t1
+group by b
+union distinct
+select sum(a) + 200, @Lisboa from t1
+group by b ;
+the_sum the_town
+204 Oporto
+201 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+201 Lisboa
+203 Lisboa
+202 Lisboa
+prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
+ group by b
+ union distinct
+ select sum(a) + 200, ? from t1
+ group by b ' ;
+execute stmt1 using @Oporto, @Lisboa;
+the_sum the_town
+204 Oporto
+201 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+201 Lisboa
+203 Lisboa
+202 Lisboa
+select sum(a) + 200 as the_sum, @Oporto as the_town from t1
+where a > @1
+group by b
+union distinct
+select sum(a) + 200, @Lisboa from t1
+where a > @2
+group by b ;
+the_sum the_town
+204 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+203 Lisboa
+prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
+ where a > ?
+ group by b
+ union distinct
+ select sum(a) + 200, ? from t1
+ where a > ?
+ group by b ' ;
+execute stmt1 using @Oporto, @1, @Lisboa, @2;
+the_sum the_town
+204 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+203 Lisboa
+select sum(a) + 200 as the_sum, @Oporto as the_town from t1
+where a > @1
+group by b
+having avg(a) > @2
+union distinct
+select sum(a) + 200, @Lisboa from t1
+where a > @2
+group by b
+having avg(a) > @3;
+the_sum the_town
+204 Oporto
+203 Oporto
+204 Lisboa
+prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
+ where a > ?
+ group by b
+ having avg(a) > ?
+ union distinct
+ select sum(a) + 200, ? from t1
+ where a > ?
+ group by b
+ having avg(a) > ? ';
+execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3;
+the_sum the_town
+204 Oporto
+203 Oporto
+204 Lisboa
+test_sequence
+------ explain select tests ------
+prepare stmt1 from ' select * from t_many_col_types ' ;
+execute stmt1;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def test t_many_col_types t_many_col_types c1 c1 1 4 1 N 49155 0 63
+def test t_many_col_types t_many_col_types c2 c2 2 6 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c3 c3 9 9 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c4 c4 3 11 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c5 c5 3 11 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c6 c6 8 20 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c7 c7 4 12 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c8 c8 5 22 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c9 c9 5 22 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c10 c10 5 22 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63
+def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63
+def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63
+def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63
+def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1217 0 63
+def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63
+def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63
+def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c19 c19 1 1 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c20 c20 254 1 1 Y 0 0 8
+def test t_many_col_types t_many_col_types c21 c21 253 10 10 Y 0 0 8
+def test t_many_col_types t_many_col_types c22 c22 253 30 30 Y 0 0 8
+def test t_many_col_types t_many_col_types c23 c23 252 255 8 Y 144 0 63
+def test t_many_col_types t_many_col_types c24 c24 252 255 8 Y 16 0 8
+def test t_many_col_types t_many_col_types c25 c25 252 65535 4 Y 144 0 63
+def test t_many_col_types t_many_col_types c26 c26 252 65535 4 Y 16 0 8
+def test t_many_col_types t_many_col_types c27 c27 252 16777215 10 Y 144 0 63
+def test t_many_col_types t_many_col_types c28 c28 252 16777215 10 Y 16 0 8
+def test t_many_col_types t_many_col_types c29 c29 252 16777215 8 Y 144 0 63
+def test t_many_col_types t_many_col_types c30 c30 252 16777215 8 Y 16 0 8
+def test t_many_col_types t_many_col_types c31 c31 254 5 3 Y 256 0 8
+def test t_many_col_types t_many_col_types c32 c32 254 24 7 Y 2048 0 8
+c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
+1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
+9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
+test_sequence
+------ delete tests ------
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+prepare stmt1 from 'delete from t1 where a=2' ;
+execute stmt1;
+select a,b from t1 where a=2;
+a b
+execute stmt1;
+insert into t1 values(0,NULL);
+set @arg00=NULL;
+prepare stmt1 from 'delete from t1 where b=?' ;
+execute stmt1 using @arg00;
+select a,b from t1 where b is NULL ;
+a b
+0 NULL
+set @arg00='one';
+execute stmt1 using @arg00;
+select a,b from t1 where b=@arg00;
+a b
+prepare stmt1 from 'truncate table t1' ;
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+test_sequence
+------ update tests ------
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ;
+execute stmt1;
+select a,b from t1 where a=2;
+a b
+2 a=two
+execute stmt1;
+select a,b from t1 where a=2;
+a b
+2 a=two
+set @arg00=NULL;
+prepare stmt1 from 'update t1 set b=? where a=2' ;
+execute stmt1 using @arg00;
+select a,b from t1 where a=2;
+a b
+2 NULL
+set @arg00='two';
+execute stmt1 using @arg00;
+select a,b from t1 where a=2;
+a b
+2 two
+set @arg00=2;
+prepare stmt1 from 'update t1 set b=NULL where a=?' ;
+execute stmt1 using @arg00;
+select a,b from t1 where a=@arg00;
+a b
+2 NULL
+update t1 set b='two' where a=@arg00;
+set @arg00=2000;
+execute stmt1 using @arg00;
+select a,b from t1 where a=@arg00;
+a b
+set @arg00=2;
+set @arg01=22;
+prepare stmt1 from 'update t1 set a=? where a=?' ;
+execute stmt1 using @arg00, @arg00;
+select a,b from t1 where a=@arg00;
+a b
+2 two
+execute stmt1 using @arg01, @arg00;
+select a,b from t1 where a=@arg01;
+a b
+22 two
+execute stmt1 using @arg00, @arg01;
+select a,b from t1 where a=@arg00;
+a b
+2 two
+set @arg00=NULL;
+set @arg01=2;
+execute stmt1 using @arg00, @arg01;
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+select a,b from t1;
+a b
+3 three
+0 two
+1 one
+4 four
+set @arg00=0;
+execute stmt1 using @arg01, @arg00;
+select a,b from t1;
+a b
+3 three
+2 two
+1 one
+4 four
+set @arg00=23;
+set @arg01='two';
+set @arg02=2;
+set @arg03='two';
+set @arg04=2;
+drop table if exists t2;
+create table t2 as select a,b from t1 ;
+prepare stmt1 from 'update t1 set a=? where b=?
+ and a in (select ? from t2
+ where b = ? or a = ?)';
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ;
+select a,b from t1 where a = @arg00 ;
+a b
+23 two
+prepare stmt1 from 'update t1 set a=? where b=?
+ and a not in (select ? from t2
+ where b = ? or a = ?)';
+execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
+select a,b from t1 ;
+a b
+3 three
+2 two
+1 one
+4 four
+drop table t2 ;
+set @arg00=1;
+prepare stmt1 from 'update t1 set b=''bla''
+where a=2
+limit 1';
+execute stmt1 ;
+select a,b from t1 where b = 'bla' ;
+a b
+2 bla
+prepare stmt1 from 'update t1 set b=''bla''
+where a=2
+limit ?';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3
+test_sequence
+------ insert tests ------
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+prepare stmt1 from 'insert into t1 values(5, ''five'' )';
+execute stmt1;
+select a,b from t1 where a = 5;
+a b
+5 five
+set @arg00='six' ;
+prepare stmt1 from 'insert into t1 values(6, ? )';
+execute stmt1 using @arg00;
+select a,b from t1 where b = @arg00;
+a b
+6 six
+execute stmt1 using @arg00;
+ERROR 23000: Duplicate entry '6' for key 1
+set @arg00=NULL ;
+prepare stmt1 from 'insert into t1 values(0, ? )';
+execute stmt1 using @arg00;
+select a,b from t1 where b is NULL;
+a b
+0 NULL
+set @arg00=8 ;
+set @arg01='eight' ;
+prepare stmt1 from 'insert into t1 values(?, ? )';
+execute stmt1 using @arg00, @arg01 ;
+select a,b from t1 where b = @arg01;
+a b
+8 eight
+set @arg00=81 ;
+set @arg01='8-1' ;
+set @arg02=82 ;
+set @arg03='8-2' ;
+prepare stmt1 from 'insert into t1 values(?,?),(?,?)';
+execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
+select a,b from t1 where a in (@arg00,@arg02) ;
+a b
+81 8-1
+82 8-2
+set @arg00=9 ;
+set @arg01='nine' ;
+prepare stmt1 from 'insert into t1 set a=?, b=? ';
+execute stmt1 using @arg00, @arg01 ;
+select a,b from t1 where a = @arg00 ;
+a b
+9 nine
+set @arg00=6 ;
+set @arg01=1 ;
+prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
+ on duplicate key update a=a + ?, b=concat(b,''modified'') ';
+execute stmt1 using @arg00, @arg01;
+select * from t1;
+a b
+4 four
+3 three
+2 two
+1 one
+5 five
+7 sixmodified
+0 NULL
+8 eight
+81 8-1
+82 8-2
+9 nine
+set @arg00=81 ;
+set @arg01=1 ;
+execute stmt1 using @arg00, @arg01;
+ERROR 23000: Duplicate entry '82' for key 1
+set @1000=1000 ;
+set @x1000_2="x1000_2" ;
+set @x1000_3="x1000_3" ;
+set @x1000="x1000" ;
+set @1100=1100 ;
+set @x1100="x1100" ;
+set @100=100 ;
+set @updated="updated" ;
+insert into t1 values(1000,'x1000_1') ;
+insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
+on duplicate key update a = a + @100, b = concat(b,@updated) ;
+select a,b from t1 where a >= 1000 ;
+a b
+1000 x1000_3
+1100 x1000_1updated
+delete from t1 where a >= 1000 ;
+insert into t1 values(1000,'x1000_1') ;
+prepare stmt1 from ' insert into t1 values(?,?),(?,?)
+ on duplicate key update a = a + ?, b = concat(b,?) ';
+execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
+select a,b from t1 where a >= 1000 ;
+a b
+1000 x1000_3
+1100 x1000_1updated
+delete from t1 where a >= 1000 ;
+insert into t1 values(1000,'x1000_1') ;
+execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
+select a,b from t1 where a >= 1000 ;
+a b
+1200 x1000_1updatedupdated
+delete from t1 where a >= 1000 ;
+prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+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/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result
new file mode 100644
index 00000000000..ef4c1aeaa43
--- /dev/null
+++ b/mysql-test/r/ps_6bdb.result
@@ -0,0 +1,1269 @@
+use test;
+drop table if exists t1, t_many_col_types ;
+create table t1
+(
+a int, b varchar(30),
+primary key(a)
+) engine = 'BDB' ;
+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 = 'BDB' ;
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+test_sequence
+------ simple select tests ------
+set @arg00='SELECT' ;
+prepare stmt1 from ' ? a from t1 where a=1 ';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1
+set @arg00=1 ;
+select @arg00, b from t1 where a=1 ;
+@arg00 b
+1 one
+prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+? b
+1 one
+set @arg00='lion' ;
+select @arg00, b from t1 where a=1 ;
+@arg00 b
+lion one
+prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+? b
+lion one
+set @arg00=NULL ;
+select @arg00, b from t1 where a=1 ;
+@arg00 b
+NULL one
+prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+? b
+NULL one
+set @arg00=1 ;
+select b, a - @arg00 from t1 where a=1 ;
+b a - @arg00
+one 0
+prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+b a - ?
+one 0
+set @arg00='MySQL' ;
+select substr(@arg00,1,2) from t1 where a=1 ;
+substr(@arg00,1,2)
+My
+prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+substr(?,1,2)
+My
+set @arg00=3 ;
+select substr('MySQL',@arg00,5) from t1 where a=1 ;
+substr('MySQL',@arg00,5)
+SQL
+prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+substr('MySQL',?,5)
+SQL
+select substr('MySQL',1,@arg00) from t1 where a=1 ;
+substr('MySQL',1,@arg00)
+MyS
+prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+substr('MySQL',1,?)
+MyS
+set @arg00='MySQL' ;
+select a , concat(@arg00,b) from t1 ;
+a concat(@arg00,b)
+1 MySQLone
+2 MySQLtwo
+3 MySQLthree
+4 MySQLfour
+prepare stmt1 from ' select a , concat(?,b) from t1 ' ;
+execute stmt1 using @arg00;
+a concat(?,b)
+1 MySQLone
+2 MySQLtwo
+3 MySQLthree
+4 MySQLfour
+select a , concat(b,@arg00) from t1 ;
+a concat(b,@arg00)
+1 oneMySQL
+2 twoMySQL
+3 threeMySQL
+4 fourMySQL
+prepare stmt1 from ' select a , concat(b,?) from t1 ' ;
+execute stmt1 using @arg00;
+a concat(b,?)
+1 oneMySQL
+2 twoMySQL
+3 threeMySQL
+4 fourMySQL
+set @arg00='MySQL' ;
+select group_concat(@arg00,b) from t1
+group by 'a' ;
+group_concat(@arg00,b)
+MySQLone,MySQLtwo,MySQLthree,MySQLfour
+prepare stmt1 from ' select group_concat(?,b) from t1
+group by ''a'' ' ;
+execute stmt1 using @arg00;
+group_concat(?,b)
+MySQLone,MySQLtwo,MySQLthree,MySQLfour
+select group_concat(b,@arg00) from t1
+group by 'a' ;
+group_concat(b,@arg00)
+oneMySQL,twoMySQL,threeMySQL,fourMySQL
+prepare stmt1 from ' select group_concat(b,?) from t1
+group by ''a'' ' ;
+execute stmt1 using @arg00;
+group_concat(b,?)
+oneMySQL,twoMySQL,threeMySQL,fourMySQL
+set @arg00='first' ;
+set @arg01='second' ;
+set @arg02=NULL;
+select @arg00, @arg01 from t1 where a=1 ;
+@arg00 @arg01
+first second
+prepare stmt1 from ' select ?, ? from t1 where a=1 ' ;
+execute stmt1 using @arg00, @arg01 ;
+? ?
+first second
+execute stmt1 using @arg02, @arg01 ;
+? ?
+NULL second
+execute stmt1 using @arg00, @arg02 ;
+? ?
+first NULL
+execute stmt1 using @arg02, @arg02 ;
+? ?
+NULL NULL
+drop table if exists new_tab ;
+create table new_tab (id1 int(11) not null default '0',
+value2 varchar(100), value1 varchar(100)) ;
+insert into new_tab values (1,'hh','hh'),(2,'hh','hh'),
+(1,'ii','ii'),(2,'ii','ii') ;
+prepare stmt1 from ' select id1,value1 from new_tab where id1=? or value1=? ' ;
+set @arg00=1 ;
+set @arg01='hh' ;
+execute stmt1 using @arg00, @arg01 ;
+id1 value1
+1 hh
+2 hh
+1 ii
+drop table new_tab ;
+drop table if exists new_tab ;
+create table new_tab(session_id char(9) not null) ;
+insert into new_tab values ('abc') ;
+prepare stmt1 from ' select * from new_tab
+where ?=''1111'' and session_id = ''abc'' ' ;
+set @arg00='abc' ;
+execute stmt1 using @arg00 ;
+session_id
+set @arg00='1111' ;
+execute stmt1 using @arg00 ;
+session_id
+abc
+set @arg00='abc' ;
+execute stmt1 using @arg00 ;
+session_id
+drop table new_tab ;
+set @arg00='FROM' ;
+select a @arg00 t1 where a=1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1
+prepare stmt1 from ' select a ? t1 where a=1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1
+set @arg00='t1' ;
+select a from @arg00 where a=1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1
+prepare stmt1 from ' select a from ? where a=1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1
+set @arg00='WHERE' ;
+select a from t1 @arg00 a=1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1
+prepare stmt1 from ' select a from t1 ? a=1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1
+set @arg00=1 ;
+select a FROM t1 where a=@arg00 ;
+a
+1
+prepare stmt1 from ' select a FROM t1 where a=? ' ;
+execute stmt1 using @arg00 ;
+a
+1
+set @arg00=1000 ;
+execute stmt1 using @arg00 ;
+a
+set @arg00=NULL ;
+select a FROM t1 where a=@arg00 ;
+a
+prepare stmt1 from ' select a FROM t1 where a=? ' ;
+execute stmt1 using @arg00 ;
+a
+set @arg00=4 ;
+select a FROM t1 where a=sqrt(@arg00) ;
+a
+2
+prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
+execute stmt1 using @arg00 ;
+a
+2
+set @arg00=NULL ;
+select a FROM t1 where a=sqrt(@arg00) ;
+a
+prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
+execute stmt1 using @arg00 ;
+a
+set @arg00=2 ;
+set @arg01=3 ;
+select a FROM t1 where a in (@arg00,@arg01);
+a
+2
+3
+prepare stmt1 from ' select a FROM t1 where a in (?,?) ';
+execute stmt1 using @arg00, @arg01;
+a
+2
+3
+prepare stmt1 from ' select b FROM t1 where b like ? ';
+set @arg00='two' ;
+execute stmt1 using @arg00 ;
+b
+two
+set @arg00='tw%' ;
+execute stmt1 using @arg00 ;
+b
+two
+set @arg00='%wo' ;
+execute stmt1 using @arg00 ;
+b
+two
+set @arg00='>' ;
+select a FROM t1 where a @arg00 1 ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1
+prepare stmt1 from ' select a FROM t1 where a ? 1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1
+set @arg00=1 ;
+select a,b FROM t1 where a is not NULL
+AND b is not NULL group by a - @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+prepare stmt1 from ' select a,b FROM t1 where a is not NULL
+AND b is not NULL group by a - ? ' ;
+execute stmt1 using @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00='two' ;
+select a,b FROM t1 where a is not NULL
+AND b is not NULL having b <> @arg00 ;
+a b
+1 one
+3 three
+4 four
+prepare stmt1 from ' select a,b FROM t1 where a is not NULL
+AND b is not NULL having b <> ? ' ;
+execute stmt1 using @arg00 ;
+a b
+1 one
+3 three
+4 four
+set @arg00=1 ;
+select a,b FROM t1 where a is not NULL
+AND b is not NULL order by a - @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+prepare stmt1 from ' select a,b FROM t1 where a is not NULL
+AND b is not NULL order by a - ? ' ;
+execute stmt1 using @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00=2 ;
+select a,b from t1 order by 2 ;
+a b
+4 four
+1 one
+3 three
+2 two
+prepare stmt1 from ' select a,b from t1
+order by ? ';
+execute stmt1 using @arg00;
+a b
+4 four
+1 one
+3 three
+2 two
+set @arg00=1;
+prepare stmt1 from ' select a,b from t1
+limit 1 ';
+execute stmt1 ;
+a b
+1 one
+prepare stmt1 from ' select a,b from t1
+limit ? ';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2
+set @arg00='b' ;
+set @arg01=0 ;
+set @arg02=2 ;
+set @arg03=2 ;
+select sum(a), @arg00 from t1 where a > @arg01
+and b is not null group by substr(b,@arg02)
+having sum(a) <> @arg03 ;
+sum(a) @arg00
+3 b
+1 b
+4 b
+prepare stmt1 from ' select sum(a), ? from t1 where a > ?
+and b is not null group by substr(b,?)
+having sum(a) <> ? ';
+execute stmt1 using @arg00, @arg01, @arg02, @arg03;
+sum(a) ?
+3 b
+1 b
+4 b
+test_sequence
+------ join tests ------
+select first.a as a1, second.a as a2
+from t1 first, t1 second
+where first.a = second.a ;
+a1 a2
+1 1
+2 2
+3 3
+4 4
+prepare stmt1 from ' select first.a as a1, second.a as a2
+ from t1 first, t1 second
+ where first.a = second.a ';
+execute stmt1 ;
+a1 a2
+1 1
+2 2
+3 3
+4 4
+set @arg00='ABC';
+set @arg01='two';
+set @arg02='one';
+select first.a, @arg00, second.a FROM t1 first, t1 second
+where @arg01 = first.b or first.a = second.a or second.b = @arg02;
+a @arg00 a
+1 ABC 1
+2 ABC 1
+3 ABC 1
+4 ABC 1
+2 ABC 2
+2 ABC 3
+3 ABC 3
+2 ABC 4
+4 ABC 4
+prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
+ where ? = first.b or first.a = second.a or second.b = ? ';
+execute stmt1 using @arg00, @arg01, @arg02;
+a ? a
+1 ABC 1
+2 ABC 1
+3 ABC 1
+4 ABC 1
+2 ABC 2
+2 ABC 3
+3 ABC 3
+2 ABC 4
+4 ABC 4
+test_sequence
+------ subquery tests ------
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = ''two'') ';
+execute stmt1 ;
+a b
+2 two
+set @arg00='two' ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where b = 'two' ) and b=@arg00 ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = ''two'') and b=? ';
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00='two' ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where b = @arg00 ) and b='two' ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = ? ) and b=''two'' ' ;
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=3 ;
+set @arg01='three' ;
+select a,b FROM t1 where (a,b) in (select 3, 'three');
+a b
+3 three
+select a FROM t1 where (a,b) in (select @arg00,@arg01);
+a
+3
+prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) ';
+execute stmt1 using @arg00, @arg01;
+a
+3
+set @arg00=1 ;
+set @arg01='two' ;
+set @arg02=2 ;
+set @arg03='two' ;
+select a, @arg00, b FROM t1 outer_table where
+b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ;
+a @arg00 b
+2 1 two
+prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
+ b=? and a = (select ? from t1 where b = ? ) ' ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
+a ? b
+2 1 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = outer_table.b ) ';
+execute stmt1 ;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00='two' ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where b = outer_table.b ) and b=@arg00 ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = outer_table.b) and b=? ';
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=2 ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ;
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=2 ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ;
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=1 ;
+set @arg01='two' ;
+set @arg02=2 ;
+set @arg03='two' ;
+select a, @arg00, b FROM t1 outer_table where
+b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03
+and outer_table.a=a ) ;
+a @arg00 b
+2 1 two
+prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
+ b=? and a = (select ? from t1 where outer_table.b = ?
+ and outer_table.a=a ) ' ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
+a ? b
+2 1 two
+set @arg00=1 ;
+set @arg01=0 ;
+select a, @arg00
+from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2
+where a=@arg01;
+a @arg00
+0 1
+prepare stmt1 from ' select a, ?
+ from ( select a - ? as a from t1 where a=? ) as t2
+ where a=? ';
+execute stmt1 using @arg00, @arg00, @arg00, @arg01 ;
+a ?
+0 1
+drop table if exists t2 ;
+create table t2 as select * from t_many_col_types;
+set @stmt= ' SELECT
+ (SELECT SUM(c1 + c12 + 0.0) FROM t2
+ where (t_many_col_types.c2 - 0e-3) = t2.c2
+ GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s,
+ exists (select 1.0e+0 from t2
+ where t2.c3 * 9.0000000000 = t_many_col_types.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 t_many_col_types,
+(select c25 x, c32 y from t2) tt WHERE x = c25 ' ;
+prepare stmt1 from @stmt ;
+execute stmt1 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def scalar_s 5 21 7 Y 32768 4 8
+def exists_s 8 1 1 N 32769 0 8
+def in_s 8 21 1 Y 32768 0 8
+def in_row_s 8 21 1 Y 32768 0 8
+scalar_s exists_s in_s in_row_s
+2.0000 0 1 0
+18.0000 1 0 1
+2.0000 0 1 0
+18.0000 1 0 1
+execute stmt1 ;
+scalar_s exists_s in_s in_row_s
+2.0000 0 1 0
+18.0000 1 0 1
+2.0000 0 1 0
+18.0000 1 0 1
+set @stmt= concat('explain ',@stmt);
+prepare stmt1 from @stmt ;
+execute stmt1 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def id 8 3 1 N 32801 0 8
+def select_type 253 19 18 N 1 31 63
+def table 253 64 16 N 1 31 63
+def type 253 10 3 N 1 31 63
+def possible_keys 253 4096 0 Y 0 31 63
+def key 253 64 0 Y 0 31 63
+def key_len 253 4096 0 Y 0 31 63
+def ref 253 1024 0 Y 0 31 63
+def rows 8 10 1 N 32801 0 8
+def Extra 253 255 44 N 1 31 63
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+execute stmt1 ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+set @stmt= ' SELECT
+ (SELECT SUM(c1+c12+?) FROM t2 where (t_many_col_types.c2-?)=t2.c2
+ GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s,
+ exists (select ? from t2
+ where t2.c3*?=t_many_col_types.c4) as exists_s,
+ c5*? in (select c6+? from t2) as in_s,
+ (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s
+FROM t_many_col_types,
+(select c25 x, c32 y from t2) tt WHERE x =c25 ' ;
+set @arg00= 0.0 ;
+set @arg01= 0e-3 ;
+set @arg02= 1.0e+0 ;
+set @arg03= 9.0000000000 ;
+set @arg04= 4 ;
+set @arg05= 0.3e+1 ;
+set @arg06= 4 ;
+set @arg07= 4 ;
+set @arg08= 4.0 ;
+set @arg09= 40e-1 ;
+prepare stmt1 from @stmt ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def scalar_s 5 23 2 Y 32768 31 8
+def exists_s 8 1 1 N 32769 0 8
+def in_s 8 21 1 Y 32768 0 8
+def in_row_s 8 21 1 Y 32768 0 8
+scalar_s exists_s in_s in_row_s
+2 0 1 0
+18 1 0 1
+2 0 1 0
+18 1 0 1
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+scalar_s exists_s in_s in_row_s
+2 0 1 0
+18 1 0 1
+2 0 1 0
+18 1 0 1
+set @stmt= concat('explain ',@stmt);
+prepare stmt1 from @stmt ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def id 8 3 1 N 32801 0 8
+def select_type 253 19 18 N 1 31 63
+def table 253 64 16 N 1 31 63
+def type 253 10 3 N 1 31 63
+def possible_keys 253 4096 0 Y 0 31 63
+def key 253 64 0 Y 0 31 63
+def key_len 253 4096 0 Y 0 31 63
+def ref 253 1024 0 Y 0 31 63
+def rows 8 10 1 N 32801 0 8
+def Extra 253 255 44 N 1 31 63
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
+6 DERIVED t2 ALL NULL NULL NULL NULL 2
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+drop table t2 ;
+test_sequence
+------ union tests ------
+prepare stmt1 from ' select a FROM t1 where a=1
+ union distinct
+ select a FROM t1 where a=1 ';
+execute stmt1 ;
+a
+1
+execute stmt1 ;
+a
+1
+prepare stmt1 from ' select a FROM t1 where a=1
+ union all
+ select a FROM t1 where a=1 ';
+execute stmt1 ;
+a
+1
+1
+set @arg00=1 ;
+select @arg00 FROM t1 where a=1
+union distinct
+select 1 FROM t1 where a=1;
+@arg00
+1
+prepare stmt1 from ' select ? FROM t1 where a=1
+ union distinct
+ select 1 FROM t1 where a=1 ' ;
+execute stmt1 using @arg00;
+?
+1
+set @arg00=1 ;
+select 1 FROM t1 where a=1
+union distinct
+select @arg00 FROM t1 where a=1;
+1
+1
+prepare stmt1 from ' select 1 FROM t1 where a=1
+ union distinct
+ select ? FROM t1 where a=1 ' ;
+execute stmt1 using @arg00;
+1
+1
+set @arg00='a' ;
+select @arg00 FROM t1 where a=1
+union distinct
+select @arg00 FROM t1 where a=1;
+@arg00
+a
+prepare stmt1 from ' select ? FROM t1 where a=1
+ union distinct
+ select ? FROM t1 where a=1 ';
+execute stmt1 using @arg00, @arg00;
+?
+a
+prepare stmt1 from ' select ?
+ union distinct
+ select ? ';
+execute stmt1 using @arg00, @arg00;
+?
+a
+set @arg00='a' ;
+set @arg01=1 ;
+set @arg02='a' ;
+set @arg03=2 ;
+select @arg00 FROM t1 where a=@arg01
+union distinct
+select @arg02 FROM t1 where a=@arg03;
+@arg00
+a
+prepare stmt1 from ' select ? FROM t1 where a=?
+ union distinct
+ select ? FROM t1 where a=? ' ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03;
+?
+a
+set @arg00=1 ;
+prepare stmt1 from ' select sum(a) + 200, ? from t1
+union distinct
+select sum(a) + 200, 1 from t1
+group by b ' ;
+execute stmt1 using @arg00;
+sum(a) + 200 ?
+210 1
+204 1
+201 1
+203 1
+202 1
+set @Oporto='Oporto' ;
+set @Lisboa='Lisboa' ;
+set @0=0 ;
+set @1=1 ;
+set @2=2 ;
+set @3=3 ;
+set @4=4 ;
+select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ;
+@Oporto @Lisboa @0 @1 @2 @3 @4
+Oporto Lisboa 0 1 2 3 4
+select sum(a) + 200 as the_sum, @Oporto as the_town from t1
+group by b
+union distinct
+select sum(a) + 200, @Lisboa from t1
+group by b ;
+the_sum the_town
+204 Oporto
+201 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+201 Lisboa
+203 Lisboa
+202 Lisboa
+prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
+ group by b
+ union distinct
+ select sum(a) + 200, ? from t1
+ group by b ' ;
+execute stmt1 using @Oporto, @Lisboa;
+the_sum the_town
+204 Oporto
+201 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+201 Lisboa
+203 Lisboa
+202 Lisboa
+select sum(a) + 200 as the_sum, @Oporto as the_town from t1
+where a > @1
+group by b
+union distinct
+select sum(a) + 200, @Lisboa from t1
+where a > @2
+group by b ;
+the_sum the_town
+204 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+203 Lisboa
+prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
+ where a > ?
+ group by b
+ union distinct
+ select sum(a) + 200, ? from t1
+ where a > ?
+ group by b ' ;
+execute stmt1 using @Oporto, @1, @Lisboa, @2;
+the_sum the_town
+204 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+203 Lisboa
+select sum(a) + 200 as the_sum, @Oporto as the_town from t1
+where a > @1
+group by b
+having avg(a) > @2
+union distinct
+select sum(a) + 200, @Lisboa from t1
+where a > @2
+group by b
+having avg(a) > @3;
+the_sum the_town
+204 Oporto
+203 Oporto
+204 Lisboa
+prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
+ where a > ?
+ group by b
+ having avg(a) > ?
+ union distinct
+ select sum(a) + 200, ? from t1
+ where a > ?
+ group by b
+ having avg(a) > ? ';
+execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3;
+the_sum the_town
+204 Oporto
+203 Oporto
+204 Lisboa
+test_sequence
+------ explain select tests ------
+prepare stmt1 from ' select * from t_many_col_types ' ;
+execute stmt1;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def test t_many_col_types t_many_col_types c1 c1 1 4 1 N 49155 0 63
+def test t_many_col_types t_many_col_types c2 c2 2 6 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c3 c3 9 9 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c4 c4 3 11 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c5 c5 3 11 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c6 c6 8 20 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c7 c7 4 12 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c8 c8 5 22 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c9 c9 5 22 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c10 c10 5 22 1 Y 32768 31 63
+def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63
+def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63
+def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63
+def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63
+def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1217 0 63
+def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63
+def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63
+def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c19 c19 1 1 1 Y 32768 0 63
+def test t_many_col_types t_many_col_types c20 c20 254 1 1 Y 0 0 8
+def test t_many_col_types t_many_col_types c21 c21 253 10 10 Y 0 0 8
+def test t_many_col_types t_many_col_types c22 c22 253 30 30 Y 0 0 8
+def test t_many_col_types t_many_col_types c23 c23 252 255 8 Y 144 0 63
+def test t_many_col_types t_many_col_types c24 c24 252 255 8 Y 16 0 8
+def test t_many_col_types t_many_col_types c25 c25 252 65535 4 Y 144 0 63
+def test t_many_col_types t_many_col_types c26 c26 252 65535 4 Y 16 0 8
+def test t_many_col_types t_many_col_types c27 c27 252 16777215 10 Y 144 0 63
+def test t_many_col_types t_many_col_types c28 c28 252 16777215 10 Y 16 0 8
+def test t_many_col_types t_many_col_types c29 c29 252 16777215 8 Y 144 0 63
+def test t_many_col_types t_many_col_types c30 c30 252 16777215 8 Y 16 0 8
+def test t_many_col_types t_many_col_types c31 c31 254 5 3 Y 256 0 8
+def test t_many_col_types t_many_col_types c32 c32 254 24 7 Y 2048 0 8
+c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
+1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
+9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
+test_sequence
+------ delete tests ------
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+prepare stmt1 from 'delete from t1 where a=2' ;
+execute stmt1;
+select a,b from t1 where a=2;
+a b
+execute stmt1;
+insert into t1 values(0,NULL);
+set @arg00=NULL;
+prepare stmt1 from 'delete from t1 where b=?' ;
+execute stmt1 using @arg00;
+select a,b from t1 where b is NULL ;
+a b
+0 NULL
+set @arg00='one';
+execute stmt1 using @arg00;
+select a,b from t1 where b=@arg00;
+a b
+prepare stmt1 from 'truncate table t1' ;
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+test_sequence
+------ update tests ------
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ;
+execute stmt1;
+select a,b from t1 where a=2;
+a b
+2 a=two
+execute stmt1;
+select a,b from t1 where a=2;
+a b
+2 a=two
+set @arg00=NULL;
+prepare stmt1 from 'update t1 set b=? where a=2' ;
+execute stmt1 using @arg00;
+select a,b from t1 where a=2;
+a b
+2 NULL
+set @arg00='two';
+execute stmt1 using @arg00;
+select a,b from t1 where a=2;
+a b
+2 two
+set @arg00=2;
+prepare stmt1 from 'update t1 set b=NULL where a=?' ;
+execute stmt1 using @arg00;
+select a,b from t1 where a=@arg00;
+a b
+2 NULL
+update t1 set b='two' where a=@arg00;
+set @arg00=2000;
+execute stmt1 using @arg00;
+select a,b from t1 where a=@arg00;
+a b
+set @arg00=2;
+set @arg01=22;
+prepare stmt1 from 'update t1 set a=? where a=?' ;
+execute stmt1 using @arg00, @arg00;
+select a,b from t1 where a=@arg00;
+a b
+2 two
+execute stmt1 using @arg01, @arg00;
+select a,b from t1 where a=@arg01;
+a b
+22 two
+execute stmt1 using @arg00, @arg01;
+select a,b from t1 where a=@arg00;
+a b
+2 two
+set @arg00=NULL;
+set @arg01=2;
+execute stmt1 using @arg00, @arg01;
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+select a,b from t1;
+a b
+0 two
+1 one
+3 three
+4 four
+set @arg00=0;
+execute stmt1 using @arg01, @arg00;
+select a,b from t1;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00=23;
+set @arg01='two';
+set @arg02=2;
+set @arg03='two';
+set @arg04=2;
+drop table if exists t2;
+create table t2 as select a,b from t1 ;
+prepare stmt1 from 'update t1 set a=? where b=?
+ and a in (select ? from t2
+ where b = ? or a = ?)';
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ;
+select a,b from t1 where a = @arg00 ;
+a b
+23 two
+prepare stmt1 from 'update t1 set a=? where b=?
+ and a not in (select ? from t2
+ where b = ? or a = ?)';
+execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
+select a,b from t1 ;
+a b
+1 one
+2 two
+3 three
+4 four
+drop table t2 ;
+set @arg00=1;
+prepare stmt1 from 'update t1 set b=''bla''
+where a=2
+limit 1';
+execute stmt1 ;
+select a,b from t1 where b = 'bla' ;
+a b
+2 bla
+prepare stmt1 from 'update t1 set b=''bla''
+where a=2
+limit ?';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3
+test_sequence
+------ insert tests ------
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t_many_col_types ;
+insert into t_many_col_types
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t_many_col_types
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+prepare stmt1 from 'insert into t1 values(5, ''five'' )';
+execute stmt1;
+select a,b from t1 where a = 5;
+a b
+5 five
+set @arg00='six' ;
+prepare stmt1 from 'insert into t1 values(6, ? )';
+execute stmt1 using @arg00;
+select a,b from t1 where b = @arg00;
+a b
+6 six
+execute stmt1 using @arg00;
+ERROR 23000: Duplicate entry '6' for key 1
+set @arg00=NULL ;
+prepare stmt1 from 'insert into t1 values(0, ? )';
+execute stmt1 using @arg00;
+select a,b from t1 where b is NULL;
+a b
+0 NULL
+set @arg00=8 ;
+set @arg01='eight' ;
+prepare stmt1 from 'insert into t1 values(?, ? )';
+execute stmt1 using @arg00, @arg01 ;
+select a,b from t1 where b = @arg01;
+a b
+8 eight
+set @arg00=81 ;
+set @arg01='8-1' ;
+set @arg02=82 ;
+set @arg03='8-2' ;
+prepare stmt1 from 'insert into t1 values(?,?),(?,?)';
+execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
+select a,b from t1 where a in (@arg00,@arg02) ;
+a b
+81 8-1
+82 8-2
+set @arg00=9 ;
+set @arg01='nine' ;
+prepare stmt1 from 'insert into t1 set a=?, b=? ';
+execute stmt1 using @arg00, @arg01 ;
+select a,b from t1 where a = @arg00 ;
+a b
+9 nine
+set @arg00=6 ;
+set @arg01=1 ;
+prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
+ on duplicate key update a=a + ?, b=concat(b,''modified'') ';
+execute stmt1 using @arg00, @arg01;
+select * from t1;
+a b
+0 NULL
+1 one
+2 two
+3 three
+4 four
+5 five
+7 sixmodified
+8 eight
+9 nine
+81 8-1
+82 8-2
+set @arg00=81 ;
+set @arg01=1 ;
+execute stmt1 using @arg00, @arg01;
+ERROR 23000: Duplicate entry '82' for key 1
+set @1000=1000 ;
+set @x1000_2="x1000_2" ;
+set @x1000_3="x1000_3" ;
+set @x1000="x1000" ;
+set @1100=1100 ;
+set @x1100="x1100" ;
+set @100=100 ;
+set @updated="updated" ;
+insert into t1 values(1000,'x1000_1') ;
+insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
+on duplicate key update a = a + @100, b = concat(b,@updated) ;
+select a,b from t1 where a >= 1000 ;
+a b
+1000 x1000_3
+1100 x1000_1updated
+delete from t1 where a >= 1000 ;
+insert into t1 values(1000,'x1000_1') ;
+prepare stmt1 from ' insert into t1 values(?,?),(?,?)
+ on duplicate key update a = a + ?, b = concat(b,?) ';
+execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
+select a,b from t1 where a >= 1000 ;
+a b
+1000 x1000_3
+1100 x1000_1updated
+delete from t1 where a >= 1000 ;
+insert into t1 values(1000,'x1000_1') ;
+execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
+select a,b from t1 where a >= 1000 ;
+a b
+1200 x1000_1updatedupdated
+delete from t1 where a >= 1000 ;
+prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+set @duplicate='duplicate ' ;
+set @1000=1000 ;
+set @5=5 ;
+select a,b from t1 where a < 5 ;
+a b
+0 NULL
+1 one
+2 two
+3 three
+4 four
+insert into t1 select a + @1000, concat(@duplicate,b) from t1
+where a < @5 ;
+affected rows: 5
+info: Records: 5 Duplicates: 0 Warnings: 0
+select a,b from t1 where a >= 1000 ;
+a b
+1000 NULL
+1001 duplicate one
+1002 duplicate two
+1003 duplicate three
+1004 duplicate four
+delete from t1 where a >= 1000 ;
+prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1
+where a < ? ' ;
+execute stmt1 using @1000, @duplicate, @5;
+affected rows: 5
+info: Records: 5 Duplicates: 0 Warnings: 0
+select a,b from t1 where a >= 1000 ;
+a b
+1000 NULL
+1001 duplicate one
+1002 duplicate two
+1003 duplicate three
+1004 duplicate four
+delete from t1 where a >= 1000 ;
+set @float=1.00;
+set @five='five' ;
+drop table if exists t2;
+create table t2 like t1 ;
+insert into t2 (b,a)
+select @duplicate, sum(first.a) from t1 first, t1 second
+where first.a <> @5 and second.b = first.b
+and second.b <> @five
+group by second.b
+having sum(second.a) > @2
+union
+select b, a + @100 from t1
+where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b
+from t1);
+affected rows: 8
+info: Records: 8 Duplicates: 0 Warnings: 0
+select a,b from t2;
+a b
+3 duplicate
+4 duplicate
+7 duplicate
+8 duplicate
+9 duplicate
+81 duplicate
+82 duplicate
+103 three
+delete from t2 ;
+prepare stmt1 from ' insert into t2 (b,a)
+select ?, sum(first.a)
+ from t1 first, t1 second
+ where first.a <> ? and second.b = first.b and second.b <> ?
+ group by second.b
+ having sum(second.a) > ?
+union
+select b, a + ? from t1
+ where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b
+ from t1 ) ' ;
+execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ;
+affected rows: 8
+info: Records: 8 Duplicates: 0 Warnings: 0
+select a,b from t2;
+a b
+3 duplicate
+4 duplicate
+7 duplicate
+8 duplicate
+9 duplicate
+81 duplicate
+82 duplicate
+103 three
+drop table t2;
+drop table t1, t_many_col_types;
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 0baebc745cc..ceca8db317e 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -593,7 +593,7 @@ select * from t1;
a
set GLOBAL query_cache_size=1024;
Warnings:
-Warning 1282 Query cache failed to set size 1024, new query cache size is 0
+Warning 1282 Query cache failed to set size 1024; new query cache size is 0
show global variables like "query_cache_size";
Variable_name Value
query_cache_size 0
@@ -601,7 +601,7 @@ select * from t1;
a
set GLOBAL query_cache_size=10240;
Warnings:
-Warning 1282 Query cache failed to set size 10240, new query cache size is 0
+Warning 1282 Query cache failed to set size 10240; new query cache size is 0
show global variables like "query_cache_size";
Variable_name Value
query_cache_size 0
@@ -609,7 +609,7 @@ select * from t1;
a
set GLOBAL query_cache_size=20480;
Warnings:
-Warning 1282 Query cache failed to set size 20480, new query cache size is 0
+Warning 1282 Query cache failed to set size 20480; new query cache size is 0
show global variables like "query_cache_size";
Variable_name Value
query_cache_size 0
@@ -617,7 +617,7 @@ select * from t1;
a
set GLOBAL query_cache_size=40960;
Warnings:
-Warning 1282 Query cache failed to set size 40960, new query cache size is 0
+Warning 1282 Query cache failed to set size 40960; new query cache size is 0
show global variables like "query_cache_size";
Variable_name Value
query_cache_size 0
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result
index 244dcbd03d4..bdd87919fd9 100644
--- a/mysql-test/r/range.result
+++ b/mysql-test/r/range.result
@@ -244,7 +244,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range x x 5 NULL 2 Using where
explain select count(*) from t1 where x in (1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index x x 5 NULL 9 Using where; Using index
+1 SIMPLE t1 ref x x 5 const 1 Using where; Using index
explain select count(*) from t1 where x in (1,2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index x x 5 NULL 9 Using where; Using index
@@ -299,6 +299,27 @@ a b
15 1
47 1
DROP TABLE t1;
+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;
+id columnid tableid content showid line ordinal
+13 13 1 188 1 5 0
+15 15 1 188 1 1 0
+drop table t1;
create table t1 (id int(10) primary key);
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9);
select id from t1 where id in (2,5,9) ;
diff --git a/mysql-test/r/rpl000001.result b/mysql-test/r/rpl000001.result
index b60cad18c54..eef986d8f8c 100644
--- a/mysql-test/r/rpl000001.result
+++ b/mysql-test/r/rpl000001.result
@@ -76,17 +76,17 @@ create table t1 (n int);
insert into t1 values(3456);
insert into mysql.user (Host, User, Password)
VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
-select select_priv,user from mysql.user where user = 'blafasel2';
+select select_priv,user from mysql.user where user = _binary'blafasel2';
select_priv user
N blafasel2
-update mysql.user set Select_priv = "Y" where User="blafasel2";
-select select_priv,user from mysql.user where user = 'blafasel2';
+update mysql.user set Select_priv = "Y" where User= _binary"blafasel2";
+select select_priv,user from mysql.user where user = _binary'blafasel2';
select_priv user
Y blafasel2
select n from t1;
n
3456
-select select_priv,user from mysql.user where user = 'blafasel2';
+select select_priv,user from mysql.user where user = _binary'blafasel2';
select_priv user
Y blafasel2
drop table t1;
diff --git a/mysql-test/r/rpl_charset.result b/mysql-test/r/rpl_charset.result
new file mode 100644
index 00000000000..d5f8ac4f293
--- /dev/null
+++ b/mysql-test/r/rpl_charset.result
@@ -0,0 +1,201 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+drop database if exists test2;
+drop database if exists test3;
+create database test2 character set latin2;
+set @@character_set_server=latin5;
+create database test3;
+
+--- --master--
+show create database test2;
+Database Create Database
+test2 CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET latin2 */
+show create database test3;
+Database Create Database
+test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET latin5 */
+
+--- --slave--
+show create database test2;
+Database Create Database
+test2 CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET latin2 */
+show create database test3;
+Database Create Database
+test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET latin5 */
+set @@collation_server=armscii8_bin;
+drop database test3;
+create database test3;
+
+--- --master--
+show create database test3;
+Database Create Database
+test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
+
+--- --slave--
+show create database test3;
+Database Create Database
+test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
+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);
+insert into t1 (b) values(@@character_set_client);
+insert into t1 (b) values(@@character_set_connection);
+insert into t1 (b) values(@@collation_connection);
+
+--- --master--
+select * from t1 order by a;
+a b
+1 armscii8
+2 armscii8_bin
+3 cp850
+4 latin2
+5 latin2_croatian_ci
+
+--- --slave--
+select * from test2.t1 order by a;
+a b
+1 armscii8
+2 armscii8_bin
+3 cp850
+4 latin2
+5 latin2_croatian_ci
+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("Müller","Muffler"));
+set collation_connection=latin1_german2_ci;
+insert into t1 (b) values(@@collation_connection);
+insert into t1 (b) values(LEAST("Müller","Muffler"));
+
+--- --master--
+select * from t1 order by a;
+a b
+1 latin1_german1_ci
+2 Muffler
+3 latin1_german2_ci
+4 Müller
+
+--- --slave--
+select * from test2.t1 order by a;
+a b
+1 latin1_german1_ci
+2 Muffler
+3 latin1_german2_ci
+4 Müller
+load data infile '../../std_data/words.dat' into table t1 (b);
+set @a= _cp850 'Müller' collate cp850_general_ci;
+truncate table t1;
+insert into t1 (b) values(collation(@a));
+
+--- --master--
+select * from t1 order by a;
+a b
+1 cp850_general_ci
+
+--- --slave--
+select * from test2.t1 order by a;
+a b
+1 cp850_general_ci
+drop database test2;
+drop database test3;
+show binlog events from 79;
+Log_name Pos Event_type Server_id Orig_log_pos Info
+master-bin.000001 79 Query 1 79 use `test`; drop database if exists test2
+master-bin.000001 143 Query 1 143 use `test`; drop database if exists test3
+master-bin.000001 207 Query 1 207 use `test`; create database test2 character set latin2
+master-bin.000001 284 Query 1 284 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=30
+master-bin.000001 418 Query 1 418 use `test`; create database test3
+master-bin.000001 474 Query 1 474 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64
+master-bin.000001 608 Query 1 608 use `test`; drop database test3
+master-bin.000001 662 Query 1 662 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64
+master-bin.000001 796 Query 1 796 use `test`; create database test3
+master-bin.000001 852 Query 1 852 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 987 Query 1 987 use `test2`; create table t1 (a int auto_increment primary key, b varchar(100))
+master-bin.000001 1089 Query 1 1089 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 1225 Intvar 1 1225 INSERT_ID=1
+master-bin.000001 1253 Query 1 1253 use `test2`; insert into t1 (b) values(@@character_set_server)
+master-bin.000001 1338 Query 1 1338 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 1474 Intvar 1 1474 INSERT_ID=2
+master-bin.000001 1502 Query 1 1502 use `test2`; insert into t1 (b) values(@@collation_server)
+master-bin.000001 1583 Query 1 1583 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 1719 Intvar 1 1719 INSERT_ID=3
+master-bin.000001 1747 Query 1 1747 use `test2`; insert into t1 (b) values(@@character_set_client)
+master-bin.000001 1832 Query 1 1832 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 1968 Intvar 1 1968 INSERT_ID=4
+master-bin.000001 1996 Query 1 1996 use `test2`; insert into t1 (b) values(@@character_set_connection)
+master-bin.000001 2085 Query 1 2085 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 2221 Intvar 1 2221 INSERT_ID=5
+master-bin.000001 2249 Query 1 2249 use `test2`; insert into t1 (b) values(@@collation_connection)
+master-bin.000001 2334 Query 1 2334 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 2469 Query 1 2469 use `test2`; truncate table t1
+master-bin.000001 2522 Query 1 2522 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 2657 Intvar 1 2657 INSERT_ID=1
+master-bin.000001 2685 Query 1 2685 use `test2`; insert into t1 (b) values(@@collation_connection)
+master-bin.000001 2770 Query 1 2770 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 2905 Intvar 1 2905 INSERT_ID=2
+master-bin.000001 2933 Query 1 2933 use `test2`; insert into t1 (b) values(LEAST("Müller","Muffler"))
+master-bin.000001 3021 Query 1 3021 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 3157 Intvar 1 3157 INSERT_ID=3
+master-bin.000001 3185 Query 1 3185 use `test2`; insert into t1 (b) values(@@collation_connection)
+master-bin.000001 3270 Query 1 3270 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 3406 Intvar 1 3406 INSERT_ID=4
+master-bin.000001 3434 Query 1 3434 use `test2`; insert into t1 (b) values(LEAST("Müller","Muffler"))
+master-bin.000001 3522 Query 1 3522 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 3658 Intvar 1 3658 INSERT_ID=74
+master-bin.000001 3686 Create_file 1 3686 db=test2;table=t1;file_id=1;block_len=581
+master-bin.000001 4354 Query 1 4354 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 4490 Intvar 1 4490 INSERT_ID=5
+master-bin.000001 4518 Exec_load 1 4518 ;file_id=1
+master-bin.000001 4541 Query 1 4541 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 4677 Query 1 4677 use `test2`; truncate table t1
+master-bin.000001 4730 Query 1 4730 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 4866 Intvar 1 4866 INSERT_ID=1
+master-bin.000001 4894 User var 1 4894 @`a`=_cp850 0x4DFC6C6C6572 COLLATE cp850_general_ci
+master-bin.000001 4934 Query 1 4934 use `test2`; insert into t1 (b) values(collation(@a))
+master-bin.000001 5010 Query 1 5010 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 5146 Query 1 5146 use `test2`; drop database test2
+master-bin.000001 5201 Query 1 5201 SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
+master-bin.000001 5332 Query 1 5332 drop database test3
+set global character_set_server=latin2;
+ERROR HY000: Binary logging and replication forbid changing the global server character set or collation
+set global character_set_server=latin2;
+ERROR HY000: Binary logging and replication forbid changing the global server character set or collation
+set one_shot @@character_set_server=latin5;
+set @@max_join_size=1000;
+select @@character_set_server;
+@@character_set_server
+latin5
+select @@character_set_server;
+@@character_set_server
+latin1
+set @@character_set_server=latin5;
+select @@character_set_server;
+@@character_set_server
+latin5
+select @@character_set_server;
+@@character_set_server
+latin5
+set one_shot max_join_size=10;
+ERROR HY000: The SET ONE_SHOT syntax is reserved for purposes internal to the MySQL server
+set character_set_client=9999999;
+ERROR 42000: Unknown character set: '9999999'
+set collation_server=9999998;
+ERROR HY000: Unknown collation: '9999998'
+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;
+hex(c1) hex(c2)
+CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
+select hex(c1), hex(c2) from t1;
+hex(c1) hex(c2)
+CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
+drop table t1;
diff --git a/mysql-test/r/rpl_delete_all.result b/mysql-test/r/rpl_delete_all.result
new file mode 100644
index 00000000000..97a535490dd
--- /dev/null
+++ b/mysql-test/r/rpl_delete_all.result
@@ -0,0 +1,31 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+create database test1;
+drop database if exists test1;
+Warnings:
+Note 1008 Can't drop database 'test1'; database doesn't exist
+show tables from test1;
+ERROR HY000: Can't read dir of './test1/' (Errcode: X)
+create table t1 (a int);
+drop table if exists t1;
+Warnings:
+Note 1051 Unknown table 't1'
+select * from t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+create table t1 (a int);
+insert into t1 values(1);
+delete from t1;
+select * from t1;
+a
+insert into t1 values(1);
+insert into t1 values(2);
+update t1 set a=2;
+select * from t1;
+a
+2
+2
+drop table t1;
diff --git a/mysql-test/r/rpl_do_grant.result b/mysql-test/r/rpl_do_grant.result
index 983cdf46620..ff3e059503c 100644
--- a/mysql-test/r/rpl_do_grant.result
+++ b/mysql-test/r/rpl_do_grant.result
@@ -4,11 +4,11 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-delete from mysql.user where user='rpl_do_grant';
-delete from mysql.db where user='rpl_do_grant';
+delete from mysql.user where user=_binary'rpl_do_grant';
+delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges;
-delete from mysql.user where user='rpl_ignore_grant';
-delete from mysql.db where user='rpl_ignore_grant';
+delete from mysql.user where user=_binary'rpl_ignore_grant';
+delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
grant select on *.* to rpl_do_grant@localhost;
grant drop on test.* to rpl_do_grant@localhost;
@@ -17,10 +17,10 @@ Grants for rpl_do_grant@localhost
GRANT SELECT ON *.* TO 'rpl_do_grant'@'localhost'
GRANT DROP ON `test`.* TO 'rpl_do_grant'@'localhost'
set password for rpl_do_grant@localhost=password("does it work?");
-select password<>'' from mysql.user where user='rpl_do_grant';
-password<>''
+select password<>_binary'' from mysql.user where user=_binary'rpl_do_grant';
+password<>_binary''
1
-delete from mysql.user where user='rpl_do_grant';
-delete from mysql.db where user='rpl_do_grant';
+delete from mysql.user where user=_binary'rpl_do_grant';
+delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges;
flush privileges;
diff --git a/mysql-test/r/rpl_flush_log_loop.result b/mysql-test/r/rpl_flush_log_loop.result
index cf588634132..4b73458386d 100644
--- a/mysql-test/r/rpl_flush_log_loop.result
+++ b/mysql-test/r/rpl_flush_log_loop.result
@@ -14,4 +14,4 @@ start slave;
flush logs;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root SLAVE_PORT 60 slave-bin.000001 95 # # slave-bin.000001 Yes Yes 0 0 95 # None 0 No #
+# 127.0.0.1 root SLAVE_PORT 60 slave-bin.000001 199 # # slave-bin.000001 Yes Yes 0 0 199 # None 0 No #
diff --git a/mysql-test/r/rpl_free_items.result b/mysql-test/r/rpl_free_items.result
new file mode 100644
index 00000000000..91c1e2aa6e5
--- /dev/null
+++ b/mysql-test/r/rpl_free_items.result
@@ -0,0 +1,10 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+create table t1 (a int);
+create table t2 (a int);
+drop table t1;
+drop table t2;
diff --git a/mysql-test/r/rpl_get_lock.result b/mysql-test/r/rpl_get_lock.result
index 2c57069e91a..26f33bfb42c 100644
--- a/mysql-test/r/rpl_get_lock.result
+++ b/mysql-test/r/rpl_get_lock.result
@@ -18,9 +18,9 @@ get_lock("lock",3)
select * from t1;
n
1
-select is_free_lock("lock"), is_used_lock("lock");
-is_free_lock("lock") is_used_lock("lock")
-0 6
+select is_free_lock("lock"), is_used_lock("lock") = connection_id();
+is_free_lock("lock") is_used_lock("lock") = connection_id()
+0 1
explain extended select is_free_lock("lock"), is_used_lock("lock");
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
diff --git a/mysql-test/r/rpl_ignore_grant.result b/mysql-test/r/rpl_ignore_grant.result
index 5e970e71d0b..5169cc8e888 100644
--- a/mysql-test/r/rpl_ignore_grant.result
+++ b/mysql-test/r/rpl_ignore_grant.result
@@ -4,11 +4,11 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-delete from mysql.user where user='rpl_ignore_grant';
-delete from mysql.db where user='rpl_ignore_grant';
+delete from mysql.user where user=_binary'rpl_ignore_grant';
+delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
-delete from mysql.user where user='rpl_ignore_grant';
-delete from mysql.db where user='rpl_ignore_grant';
+delete from mysql.user where user=_binary'rpl_ignore_grant';
+delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
grant select on *.* to rpl_ignore_grant@localhost;
grant drop on test.* to rpl_ignore_grant@localhost;
@@ -18,20 +18,20 @@ GRANT SELECT ON *.* TO 'rpl_ignore_grant'@'localhost'
GRANT DROP ON `test`.* TO 'rpl_ignore_grant'@'localhost'
show grants for rpl_ignore_grant@localhost;
ERROR 42000: There is no such grant defined for user 'rpl_ignore_grant' on host 'localhost'
-select count(*) from mysql.user where user='rpl_ignore_grant';
+select count(*) from mysql.user where user=_binary'rpl_ignore_grant';
count(*)
0
-select count(*) from mysql.db where user='rpl_ignore_grant';
+select count(*) from mysql.db where user=_binary'rpl_ignore_grant';
count(*)
0
grant select on *.* to rpl_ignore_grant@localhost;
set password for rpl_ignore_grant@localhost=password("does it work?");
-select password<>'' from mysql.user where user='rpl_ignore_grant';
-password<>''
+select password<>_binary'' from mysql.user where user=_binary'rpl_ignore_grant';
+password<>_binary''
0
-delete from mysql.user where user='rpl_ignore_grant';
-delete from mysql.db where user='rpl_ignore_grant';
+delete from mysql.user where user=_binary'rpl_ignore_grant';
+delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
-delete from mysql.user where user='rpl_ignore_grant';
-delete from mysql.db where user='rpl_ignore_grant';
+delete from mysql.user where user=_binary'rpl_ignore_grant';
+delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
diff --git a/mysql-test/r/rpl_ps.result b/mysql-test/r/rpl_ps.result
new file mode 100644
index 00000000000..c969575de76
--- /dev/null
+++ b/mysql-test/r/rpl_ps.result
@@ -0,0 +1,28 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+drop table if exists t1;
+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;
+n
+from-master-1
+from-master-2-'',
+set @var2= 'insert into t1 values (concat("from-var-", ?))';
+prepare stmt2 from @var2;
+set @var1='from-master-3';
+execute stmt2 using @var1;
+select * from t1;
+n
+from-master-1
+from-master-2-'',
+from-var-from-master-3
+drop table t1;
+stop slave;
diff --git a/mysql-test/r/rpl_replicate_do.result b/mysql-test/r/rpl_replicate_do.result
index a06125362c2..5cdcb6f30fb 100644
--- a/mysql-test/r/rpl_replicate_do.result
+++ b/mysql-test/r/rpl_replicate_do.result
@@ -28,4 +28,4 @@ ERROR 42S02: Table 'test.t11' doesn't exist
drop table if exists t1,t2,t11;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1473 # # master-bin.000001 Yes Yes test.t1 0 0 1473 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1554 # # master-bin.000001 Yes Yes test.t1 0 0 1554 # None 0 No #
diff --git a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/r/rpl_rotate_logs.result
index 01d39b2e44c..85071e13555 100644
--- a/mysql-test/r/rpl_rotate_logs.result
+++ b/mysql-test/r/rpl_rotate_logs.result
@@ -1,11 +1,11 @@
drop table if exists t1, t2, t3, t4;
drop table if exists t1, t2, t3, t4;
start slave;
-ERROR HY000: Could not initialize master info structure, more error messages can be found in the MySQL error log
+ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
start slave;
-ERROR HY000: Could not initialize master info structure, more error messages can be found in the MySQL error log
+ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
-ERROR HY000: Could not initialize master info structure, more error messages can be found in the MySQL error log
+ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
reset slave;
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
reset master;
diff --git a/mysql-test/r/rpl_server_id1.result b/mysql-test/r/rpl_server_id1.result
index b51022b0017..ed24c0ef35b 100644
--- a/mysql-test/r/rpl_server_id1.result
+++ b/mysql-test/r/rpl_server_id1.result
@@ -15,8 +15,5 @@ start slave;
insert into t1 values (1);
show status like "slave_running";
Variable_name Value
-Slave_running ON
-select * from t1;
-n
-1
+Slave_running OFF
drop table t1;
diff --git a/mysql-test/r/rpl_temporary.result b/mysql-test/r/rpl_temporary.result
index 9826d4ff1c4..3e8c11883be 100644
--- a/mysql-test/r/rpl_temporary.result
+++ b/mysql-test/r/rpl_temporary.result
@@ -7,12 +7,12 @@ start slave;
reset master;
SET @save_select_limit=@@session.sql_select_limit;
SET @@session.sql_select_limit=10, @@session.pseudo_thread_id=100;
-ERROR HY000: Access denied. You need the SUPER privilege for this operation
+ERROR HY000: Access denied; you need the SUPER privilege for this operation
SELECT @@session.sql_select_limit = @save_select_limit;
@@session.sql_select_limit = @save_select_limit
1
SET @@session.sql_select_limit=10, @@session.sql_log_bin=0;
-ERROR HY000: Access denied. You need the SUPER privilege for this operation
+ERROR HY000: Access denied; you need the SUPER privilege for this operation
SELECT @@session.sql_select_limit = @save_select_limit;
@@session.sql_select_limit = @save_select_limit
1
@@ -39,17 +39,18 @@ f
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 95 Server ver: VERSION, Binlog ver: 4
-master-bin.000001 95 Query 1 174 use `test`; create table t1(f int)
-master-bin.000001 174 Query 1 253 use `test`; create table t2(f int)
-master-bin.000001 253 Query 1 372 use `test`; insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10)
-master-bin.000001 372 Query 1 461 use `test`; create temporary table t3(f int)
-master-bin.000001 461 Query 1 559 use `test`; insert into t3 select * from t1 where f<6
-master-bin.000001 559 Query 1 648 use `test`; create temporary table t3(f int)
-master-bin.000001 648 Query 1 743 use `test`; insert into t2 select count(*) from t3
-master-bin.000001 743 Query 1 842 use `test`; insert into t3 select * from t1 where f>=4
-master-bin.000001 842 Query 1 922 use `test`; drop temporary table t3
-master-bin.000001 922 Query 1 1017 use `test`; insert into t2 select count(*) from t3
-master-bin.000001 1017 Query 1 1097 use `test`; drop temporary table t3
+master-bin.000001 95 Query 1 178 use `test`; drop table if exists t1,t2
+master-bin.000001 178 Query 1 257 use `test`; create table t1(f int)
+master-bin.000001 257 Query 1 336 use `test`; create table t2(f int)
+master-bin.000001 336 Query 1 455 use `test`; insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10)
+master-bin.000001 455 Query 1 544 use `test`; create temporary table t3(f int)
+master-bin.000001 544 Query 1 642 use `test`; insert into t3 select * from t1 where f<6
+master-bin.000001 642 Query 1 731 use `test`; create temporary table t3(f int)
+master-bin.000001 731 Query 1 826 use `test`; insert into t2 select count(*) from t3
+master-bin.000001 826 Query 1 925 use `test`; insert into t3 select * from t1 where f>=4
+master-bin.000001 925 Query 1 1005 use `test`; drop temporary table t3
+master-bin.000001 1005 Query 1 1100 use `test`; insert into t2 select count(*) from t3
+master-bin.000001 1100 Query 1 1180 use `test`; drop temporary table t3
drop table t1, t2;
use test;
SET TIMESTAMP=1040323920;
diff --git a/mysql-test/r/rpl_timezone.result b/mysql-test/r/rpl_timezone.result
new file mode 100644
index 00000000000..f5ecf474a1a
--- /dev/null
+++ b/mysql-test/r/rpl_timezone.result
@@ -0,0 +1,75 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+create table t1 (t timestamp);
+create table t2 (t char(32));
+select @@time_zone;
+@@time_zone
+Europe/Moscow
+set time_zone='UTC';
+insert into t1 values ('20040101000000'), ('20040611093902');
+select * from t1;
+t
+2004-01-01 00:00:00
+2004-06-11 09:39:02
+select * from t1;
+t
+2004-01-01 03:00:00
+2004-06-11 13:39:02
+delete from t1;
+set time_zone='Europe/Moscow';
+insert into t1 values ('20040101000000'), ('20040611093902');
+select * from t1;
+t
+2004-01-01 00:00:00
+2004-06-11 09:39:02
+select * from t1;
+t
+2004-01-01 00:00:00
+2004-06-11 09:39:02
+show binlog events;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 4 Format_desc 1 95 Server ver: VERSION, Binlog ver: 4
+master-bin.000001 95 Query 1 181 use `test`; create table t1 (t timestamp)
+master-bin.000001 181 Query 1 266 use `test`; create table t2 (t char(32))
+master-bin.000001 266 Query 1 383 use `test`; insert into t1 values ('20040101000000'), ('20040611093902')
+master-bin.000001 383 Query 1 454 use `test`; delete from t1
+master-bin.000001 454 Query 1 571 use `test`; insert into t1 values ('20040101000000'), ('20040611093902')
+set time_zone='MET';
+insert into t2 (select t from t1);
+select * from t1;
+t
+2003-12-31 22:00:00
+2004-06-11 07:39:02
+select * from t2;
+t
+2003-12-31 22:00:00
+2004-06-11 07:39:02
+delete from t2;
+set timestamp=1000072000;
+insert into t2 values (current_timestamp), (current_date), (current_time);
+set timestamp=1000072000;
+select current_timestamp, current_date, current_time;
+current_timestamp current_date current_time
+2001-09-10 01:46:40 2001-09-10 01:46:40
+select * from t2;
+t
+2001-09-09 23:46:40
+2001-09-09
+23:46:40
+delete from t2;
+insert into t2 values (from_unixtime(1000000000)),
+(unix_timestamp('2001-09-09 03:46:40'));
+select * from t2;
+t
+2001-09-09 03:46:40
+1000000000
+select * from t2;
+t
+2001-09-09 03:46:40
+1000000000
+set global time_zone='MET';
+drop table t1, t2;
diff --git a/mysql-test/r/rpl_until.result b/mysql-test/r/rpl_until.result
index 45bedd0b176..ba8c0c1f131 100644
--- a/mysql-test/r/rpl_until.result
+++ b/mysql-test/r/rpl_until.result
@@ -57,15 +57,15 @@ show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 731 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 731 # Master master-bin.000001 710 No #
start slave until master_log_file='master-bin', master_log_pos=561;
-ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL
+ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
-ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL
+ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until master_log_file='master-bin.000001';
-ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL
+ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until relay_log_file='slave-relay-bin.000002';
-ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL
+ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
-ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL
+ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave sql_thread;
start slave until master_log_file='master-bin.000001', master_log_pos=710;
Warnings:
diff --git a/mysql-test/r/rpl_user_variables.result b/mysql-test/r/rpl_user_variables.result
index e1abfbd0bf7..dd9a11e370f 100644
--- a/mysql-test/r/rpl_user_variables.result
+++ b/mysql-test/r/rpl_user_variables.result
@@ -78,32 +78,32 @@ NULL
NULL
show binlog events from 179;
Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 179 User var 2 222 @i1=12345678901234
-slave-bin.000001 222 User var 2 265 @i2=-12345678901234
-slave-bin.000001 265 User var 2 308 @i3=0
-slave-bin.000001 308 User var 2 351 @i4=-1
+slave-bin.000001 179 User var 2 222 @`i1`=12345678901234
+slave-bin.000001 222 User var 2 265 @`i2`=-12345678901234
+slave-bin.000001 265 User var 2 308 @`i3`=0
+slave-bin.000001 308 User var 2 351 @`i4`=-1
slave-bin.000001 351 Query 1 456 use `test`; insert into t1 values (@i1), (@i2), (@i3), (@i4)
-slave-bin.000001 456 User var 2 499 @r1=12.5
-slave-bin.000001 499 User var 2 542 @r2=-12.5
+slave-bin.000001 456 User var 2 499 @`r1`=12.5
+slave-bin.000001 499 User var 2 542 @`r2`=-12.5
slave-bin.000001 542 Query 1 633 use `test`; insert into t1 values (@r1), (@r2)
-slave-bin.000001 633 User var 2 682 @s1='This is a test'
-slave-bin.000001 682 User var 2 717 @s2=''
-slave-bin.000001 717 User var 2 759 @s3='abc'def'
-slave-bin.000001 759 User var 2 801 @s4='abc\def'
-slave-bin.000001 801 User var 2 843 @s5='abc'def'
+slave-bin.000001 633 User var 2 682 @`s1`=_latin1 0x5468697320697320612074657374 COLLATE latin1_swedish_ci
+slave-bin.000001 682 User var 2 717 @`s2`=_latin1 "" COLLATE latin1_swedish_ci
+slave-bin.000001 717 User var 2 759 @`s3`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci
+slave-bin.000001 759 User var 2 801 @`s4`=_latin1 0x6162635C646566 COLLATE latin1_swedish_ci
+slave-bin.000001 801 User var 2 843 @`s5`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci
slave-bin.000001 843 Query 1 955 use `test`; insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5)
-slave-bin.000001 955 User var 2 981 @n1=NULL
+slave-bin.000001 955 User var 2 981 @`n1`=NULL
slave-bin.000001 981 Query 1 1065 use `test`; insert into t1 values (@n1)
-slave-bin.000001 1065 User var 2 1091 @n2=NULL
+slave-bin.000001 1065 User var 2 1091 @`n2`=NULL
slave-bin.000001 1091 Query 1 1175 use `test`; insert into t1 values (@n2)
slave-bin.000001 1175 Query 1 1285 use `test`; insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1)
-slave-bin.000001 1285 User var 2 1327 @a=2
+slave-bin.000001 1285 User var 2 1327 @`a`=2
slave-bin.000001 1327 Query 1 1421 use `test`; insert into t1 values (@a+(@b:=@a+1))
-slave-bin.000001 1421 User var 2 1458 @q='abc'
+slave-bin.000001 1421 User var 2 1458 @`q`=_latin1 0x616263 COLLATE latin1_swedish_ci
slave-bin.000001 1458 Query 1 1584 use `test`; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2'))
-slave-bin.000001 1584 User var 2 1626 @a=5
+slave-bin.000001 1584 User var 2 1626 @`a`=5
slave-bin.000001 1626 Query 1 1714 use `test`; insert into t1 values (@a),(@a)
-slave-bin.000001 1714 User var 2 1739 @a=NULL
+slave-bin.000001 1714 User var 2 1739 @`a`=NULL
slave-bin.000001 1739 Query 1 1834 use `test`; insert into t1 values (@a),(@a),(@a*5)
drop table t1;
stop slave;
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 6759702475d..432c5171da5 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2071,7 +2071,12 @@ 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;
+gvid the_success the_fail the_size the_time
+Warnings:
+Warning 1292 Truncated incorrect datetime value: 'wrong-date-value'
+Warning 1292 Truncated incorrect datetime value: 'wrong-date-value'
+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;
gvid the_success the_fail the_size the_time
DROP TABLE t1,t2;
create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0');
diff --git a/mysql-test/r/select_found.result b/mysql-test/r/select_found.result
index 23a39a242a1..470a3e8439f 100644
--- a/mysql-test/r/select_found.result
+++ b/mysql-test/r/select_found.result
@@ -226,3 +226,20 @@ WHERE ( r = 1 AND a IN ( 1, 2 ) AND ( u = 'w' OR u LIKE 'w/%' ) )
OR ( r = 1 AND a IN ( 3 ) AND ( u = 'w/U' OR u LIKE 'w/U/%' ) )
OR ( r = 1 AND a IN ( 1, 2, 3 ) AND ( u = 'w' ) );
drop table t1;
+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;
+a
+2
+SELECT FOUND_ROWS();
+FOUND_ROWS()
+1
+DROP TABLE t1;
+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;
+a
+SELECT FOUND_ROWS();
+FOUND_ROWS()
+0
+DROP TABLE t1;
diff --git a/mysql-test/r/select_safe.result b/mysql-test/r/select_safe.result
index 6bffdd85aa4..766ee8c0e14 100644
--- a/mysql-test/r/select_safe.result
+++ b/mysql-test/r/select_safe.result
@@ -30,7 +30,7 @@ ERROR HY000: You are using safe update mode and you tried to update a table with
delete from t1 where a+0=1;
ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
select 1 from t1,t1 as t2,t1 as t3,t1 as t4,t1 as t5;
-ERROR 42000: The SELECT would examine more rows than MAX_JOIN_SIZE. Check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is ok
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
update t1 set b="a" limit 1;
update t1 set b="a" where b="b" limit 2;
delete from t1 where b="test" limit 1;
@@ -42,7 +42,7 @@ SELECT @@MAX_JOIN_SIZE, @@SQL_BIG_SELECTS;
2 0
insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a");
SELECT * from t1 order by a;
-ERROR 42000: The SELECT would examine more rows than MAX_JOIN_SIZE. Check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is ok
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
SET SQL_BIG_SELECTS=1;
SELECT * from t1 order by a;
a b
@@ -52,7 +52,7 @@ a b
5 a
SET MAX_JOIN_SIZE=2;
SELECT * from t1;
-ERROR 42000: The SELECT would examine more rows than MAX_JOIN_SIZE. Check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is ok
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
SET MAX_JOIN_SIZE=DEFAULT;
SELECT * from t1;
a b
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index 3ea2082873d..7aaaca043fd 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -43,7 +43,7 @@ wait_timeout 28800
show variables like "this_doesn't_exists%";
Variable_name Value
show table status from test like "this_doesn't_exists%";
-Name Engine Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
show databases;
Database
mysql
@@ -309,58 +309,58 @@ insert into t1 values (1),(2);
insert into t2 values (1),(2);
insert into t3 values (1,1),(2,2);
show table status;
-Name Engine Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 HEAP Fixed 2 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
-t2 HEAP Fixed 2 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
-t3 HEAP Fixed 2 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 HEAP 9 Fixed 2 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t2 HEAP 9 Fixed 2 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t3 HEAP 9 Fixed 2 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
insert into t1 values (3),(4);
insert into t2 values (3),(4);
insert into t3 values (3,3),(4,4);
show table status;
-Name Engine Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 HEAP Fixed 4 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
-t2 HEAP Fixed 4 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
-t3 HEAP Fixed 4 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 HEAP 9 Fixed 4 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t2 HEAP 9 Fixed 4 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t3 HEAP 9 Fixed 4 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
insert into t1 values (5);
insert into t2 values (5);
insert into t3 values (5,5);
show table status;
-Name Engine Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 HEAP Fixed 5 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
-t2 HEAP Fixed 5 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
-t3 HEAP Fixed 5 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 HEAP 9 Fixed 5 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t2 HEAP 9 Fixed 5 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t3 HEAP 9 Fixed 5 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
delete from t1 where a=3;
delete from t2 where b=3;
delete from t3 where a=3;
show table status;
-Name Engine Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 HEAP Fixed 4 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL
-t2 HEAP Fixed 4 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL
-t3 HEAP Fixed 4 9 # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 HEAP 9 Fixed 4 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL
+t2 HEAP 9 Fixed 4 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL
+t3 HEAP 9 Fixed 4 9 # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL
delete from t1;
delete from t2;
delete from t3;
show table status;
-Name Engine Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 HEAP Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
-t2 HEAP Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
-t3 HEAP Fixed 0 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 HEAP 9 Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t2 HEAP 9 Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t3 HEAP 9 Fixed 0 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
insert into t1 values (5);
insert into t2 values (5);
insert into t3 values (5,5);
show table status;
-Name Engine Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 HEAP Fixed 1 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
-t2 HEAP Fixed 1 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
-t3 HEAP Fixed 1 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 HEAP 9 Fixed 1 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t2 HEAP 9 Fixed 1 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t3 HEAP 9 Fixed 1 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
delete from t1 where a=5;
delete from t2 where b=5;
delete from t3 where a=5;
show table status;
-Name Engine Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 HEAP Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL
-t2 HEAP Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL
-t3 HEAP Fixed 0 9 # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 HEAP 9 Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL
+t2 HEAP 9 Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL
+t3 HEAP 9 Fixed 0 9 # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL
drop table t1, t2, t3;
create database test_$1;
show create database test_$1;
@@ -378,25 +378,33 @@ show create database test_$1;
Database Create Database
test_$1 CREATE DATABASE `test_$1` /*!40100 DEFAULT CHARACTER SET latin1 */
drop table t1;
-ERROR 42000: Access denied for user: 'mysqltest_1'@'localhost' to database 'test_$1'
+ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'test_$1'
drop database test_$1;
-ERROR 42000: Access denied for user: 'mysqltest_1'@'localhost' to database 'test_$1'
+ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'test_$1'
select * from test_$1.t1;
-ERROR 42000: Access denied for user: 'mysqltest_2'@'localhost' to database 'test_$1'
+ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'test_$1'
show create database test_$1;
-ERROR 42000: Access denied for user: 'mysqltest_2'@'localhost' to database 'test_$1'
+ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'test_$1'
drop table test_$1.t1;
-ERROR 42000: Access denied for user: 'mysqltest_2'@'localhost' to database 'test_$1'
+ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'test_$1'
drop database test_$1;
-ERROR 42000: Access denied for user: 'mysqltest_2'@'localhost' to database 'test_$1'
+ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'test_$1'
select * from test_$1.t1;
-ERROR 42000: Access denied for user: 'mysqltest_3'@'localhost' to database 'test_$1'
+ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'test_$1'
show create database test_$1;
-ERROR 42000: Access denied for user: 'mysqltest_3'@'localhost' to database 'test_$1'
+ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'test_$1'
drop table test_$1.t1;
drop database test_$1;
+set names binary;
delete from mysql.user
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
delete from mysql.db
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
flush privileges;
+set names latin1;
+create database `ä`;
+create table `ä`.`ä` (a int) engine=heap;
+show table status from `ä` LIKE 'ä';
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+ä HEAP 9 Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+drop database `ä`;
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index 59cd93d6e7b..d44360d9b5c 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -1,10 +1,10 @@
delete from mysql.proc;
create procedure syntaxerror(t int)|
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
create procedure syntaxerror(t int)|
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
create procedure syntaxerror(t int)|
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
drop table if exists t3|
create table t3 ( x int )|
insert into t3 values (2), (3)|
@@ -44,7 +44,7 @@ call foo()|
ERROR 42000: PROCEDURE test.foo does not exist
drop procedure if exists foo|
Warnings:
-Warning 1298 PROCEDURE foo does not exist
+Warning 1303 PROCEDURE foo does not exist
show create procedure foo|
ERROR 42000: PROCEDURE foo does not exist
create procedure foo()
@@ -80,7 +80,7 @@ declare y int;
set x = y;
end|
Warnings:
-Warning 1304 Referring to uninitialized variable y
+Warning 1309 Referring to uninitialized variable y
drop procedure foo|
create procedure foo()
return 42|
diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result
index f78b41764b9..cdcc4595a73 100644
--- a/mysql-test/r/sp-security.result
+++ b/mysql-test/r/sp-security.result
@@ -28,7 +28,7 @@ select db1_secret.db();
db1_secret.db()
db1_secret
select * from db1_secret.t1;
-ERROR 42000: Access denied for user: 'user1'@'localhost' to database 'db1_secret'
+ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db1_secret'
create procedure db1_secret.dummy() begin end;
ERROR 42000: Unknown database 'db1_secret'
drop procedure db1_secret.dummy;
@@ -38,7 +38,7 @@ select db1_secret.db();
db1_secret.db()
db1_secret
select * from db1_secret.t1;
-ERROR 42000: Access denied for user: ''@'localhost' to database 'db1_secret'
+ERROR 42000: Access denied for user ''@'localhost' to database 'db1_secret'
create procedure db1_secret.dummy() begin end;
ERROR 42000: Unknown database 'db1_secret'
drop procedure db1_secret.dummy;
@@ -67,13 +67,13 @@ select db();
db()
db1_secret
call db1_secret.stamp(5);
-ERROR 42000: Access denied for user: 'user1'@'localhost' to database 'db1_secret'
+ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db1_secret'
select db1_secret.db();
-ERROR 42000: Access denied for user: 'user1'@'localhost' to database 'db1_secret'
+ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db1_secret'
call db1_secret.stamp(6);
-ERROR 42000: Access denied for user: ''@'localhost' to database 'db1_secret'
+ERROR 42000: Access denied for user ''@'localhost' to database 'db1_secret'
select db1_secret.db();
-ERROR 42000: Access denied for user: ''@'localhost' to database 'db1_secret'
+ERROR 42000: Access denied for user ''@'localhost' to database 'db1_secret'
drop database if exists db2;
create database db2;
use db2;
@@ -87,10 +87,10 @@ flush privileges;
use db2;
create procedure p () insert into t2 values (1);
call p();
-ERROR 42000: Access denied for user: 'user1'@'localhost' to database 'db2'
+ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db2'
use db2;
call p();
-ERROR 42000: Access denied for user: 'user1'@'localhost' to database 'db2'
+ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db2'
select * from t2;
s1
0
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 7f496000644..bbad39c8ad4 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -1075,7 +1075,7 @@ drop table if exists t3|
create table t3 (s1 smallint)|
insert into t3 values (123456789012)|
Warnings:
-Warning 1264 Data truncated, out of range for column 's1' at row 1
+Warning 1264 Data truncated; out of range for column 's1' at row 1
create procedure bug2780()
begin
declare exit handler for sqlwarning set @x = 1;
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index bc1e5af0a81..887466e4388 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -6,7 +6,7 @@ explain extended select (select 2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1249 Select 2 was reduced during optimisation
+Note 1249 Select 2 was reduced during optimization
Note 1003 select 2 AS `(select 2)`
SELECT (SELECT 1) UNION SELECT (SELECT 2);
(SELECT 1)
@@ -18,8 +18,8 @@ id select_type table type possible_keys key key_len ref rows Extra
3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL
Warnings:
-Note 1249 Select 2 was reduced during optimisation
-Note 1249 Select 4 was reduced during optimisation
+Note 1249 Select 2 was reduced during optimization
+Note 1249 Select 4 was reduced during optimization
Note 1003 select 1 AS `(SELECT 1)` union select 2 AS `(SELECT 2)`
SELECT (SELECT (SELECT 0 UNION SELECT 0));
(SELECT (SELECT 0 UNION SELECT 0))
@@ -31,7 +31,7 @@ id select_type table type possible_keys key key_len ref rows Extra
4 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
Warnings:
-Note 1249 Select 2 was reduced during optimisation
+Note 1249 Select 2 was reduced during optimization
Note 1003 select (select 0 AS `0` union select 0 AS `0`) AS `(SELECT (SELECT 0 UNION SELECT 0))`
SELECT (SELECT 1 FROM (SELECT 1) as b HAVING a=1) as a;
ERROR 42S22: Reference 'a' not supported (forward reference in item list)
@@ -73,7 +73,7 @@ SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a));
1
1
select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1));
-ERROR HY000: Wrong usage of PROCEDURE and subquery
+ERROR HY000: Incorrect usage of PROCEDURE and subquery
SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1));
ERROR HY000: Incorrect parameters to procedure 'ANALYSE'
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL;
@@ -328,13 +328,13 @@ patient_uq clinic_uq
explain extended select * from t6 where exists (select * from t7 where uq = clinic_uq);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t6 ALL NULL NULL NULL NULL 4 Using where
-2 DEPENDENT SUBQUERY t7 eq_ref PRIMARY PRIMARY 4 test.t6.clinic_uq 1
+2 DEPENDENT SUBQUERY t7 eq_ref PRIMARY PRIMARY 4 test.t6.clinic_uq 1 Using index
Warnings:
Note 1276 Field or reference 'clinic_uq' of SELECT #2 was resolved in SELECT #1
-Note 1003 select test.t6.patient_uq AS `patient_uq`,test.t6.clinic_uq AS `clinic_uq` from test.t6 where exists(select test.t7.uq AS `uq`,test.t7.name AS `name` from test.t7 where (test.t7.uq = test.t6.clinic_uq))
+Note 1003 select test.t6.patient_uq AS `patient_uq`,test.t6.clinic_uq AS `clinic_uq` from test.t6 where exists(select 1 AS `Not_used` from test.t7 where (test.t7.uq = test.t6.clinic_uq))
select * from t1 where a= (select a from t2,t4 where t2.b=t4.b);
-ERROR 23000: Column: 'a' in field list is ambiguous
-drop table if exists t1,t2,t3;
+ERROR 23000: Column 'a' in field list is ambiguous
+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');
CREATE TABLE t2 (a varchar(20),b int NOT NULL default '0');
@@ -720,7 +720,7 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ref id id 5 const 1 Using where; Using index
Warnings:
-Note 1249 Select 2 was reduced during optimisation
+Note 1249 Select 2 was reduced during optimization
Note 1003 select test.t2.id AS `id` from test.t2 where (test.t2.id = 1)
SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3);
id
@@ -732,8 +732,8 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1+(select 1));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ref id id 5 const 1 Using where; Using index
Warnings:
-Note 1249 Select 3 was reduced during optimisation
-Note 1249 Select 2 was reduced during optimisation
+Note 1249 Select 3 was reduced during optimization
+Note 1249 Select 2 was reduced during optimization
Note 1003 select test.t2.id AS `id` from test.t2 where (test.t2.id = (1 + 1))
EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3);
id select_type table type possible_keys key key_len ref rows Extra
@@ -867,7 +867,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3
Warnings:
Note 1276 Field or reference 'a' of SELECT #2 was resolved in SELECT #1
-Note 1249 Select 2 was reduced during optimisation
+Note 1249 Select 2 was reduced during optimization
Note 1003 select (test.t1.a + 1) AS `(select a+1)` from test.t1
select (select a+1) from t1;
(select a+1)
@@ -984,7 +984,7 @@ ERROR 42S02: Table 'test.t1' doesn't exist
CREATE TABLE t1 (a int, KEY(a));
HANDLER t1 OPEN;
HANDLER t1 READ a=((SELECT 1));
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1))' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1))' at line 1
HANDLER t1 CLOSE;
drop table t1;
create table t1 (a int);
@@ -1083,24 +1083,24 @@ CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT 1)) a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bigint(1) NOT NULL default '0',
- `(SELECT 1)` bigint(1) NOT NULL default '0'
+ `a` bigint(20) NOT NULL default '0',
+ `(SELECT 1)` bigint(20) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a)) a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bigint(1) NOT NULL default '0',
- `(SELECT a)` bigint(1) NOT NULL default '0'
+ `a` bigint(20) NOT NULL default '0',
+ `(SELECT a)` bigint(20) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a+0)) a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bigint(1) NOT NULL default '0',
- `(SELECT a+0)` bigint(17) NOT NULL default '0'
+ `a` bigint(20) NOT NULL default '0',
+ `(SELECT a+0)` bigint(20) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
CREATE TABLE t1 SELECT (SELECT 1 as a UNION SELECT 1+1 limit 1,1) as a;
@@ -1110,7 +1110,7 @@ a
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` bigint(17) NOT NULL default '0'
+ `a` bigint(20) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int);
@@ -1722,7 +1722,7 @@ create table t1(id int);
create table t2(id int);
create table t3(flag int);
select (select * from t3 where id not null) from t1, t2;
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'null) from t1, t2' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null) from t1, t2' at line 1
drop table t1,t2,t3;
CREATE TABLE t1 (id INT);
CREATE TABLE t2 (id INT);
@@ -1825,3 +1825,77 @@ a
1
3
DROP TABLE t1;
+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);
+a b
+1 2
+3 4
+explain extended select * from t1 up where exists (select * from t1 where t1.a=up.a);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY up ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where
+Warnings:
+Note 1276 Field or reference 'up.a' of SELECT #2 was resolved in SELECT #1
+Note 1003 select test.up.a AS `a`,test.up.b AS `b` from test.t1 up where exists(select 1 AS `Not_used` from test.t1 where (test.t1.a = test.up.a))
+drop table t1;
+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);
+t1_a t2_a t2_b
+1 1 2
+DROP TABLE t1, t2;
+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;
+id name id pet
+1 Tim 1 Fido
+2 Rebecca 2 Spot
+3 NULL 3 Felix
+drop table t1,t2;
+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);
+abc b
+1 2
+2 3
+3 4
+INSERT INTO t2 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);
+select * from t2;
+c d
+1 2
+2 3
+3 4
+CREATE TABLE t3 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);
+select * from t3;
+abc b
+1 2
+2 3
+3 4
+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;
+c d
+1 2
+2 3
+3 4
+1 2
+2 3
+3 4
+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;
+abc b
+1 2
+2 3
+3 4
+deallocate prepare stmt1;
+DROP TABLE t1, t2, t3;
diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result
index 9c1816e295c..bbbc607b6f8 100644
--- a/mysql-test/r/subselect_innodb.result
+++ b/mysql-test/r/subselect_innodb.result
@@ -96,3 +96,13 @@ id value (select t1.value from t1 where t1.id=t2.id)
1 z a
2 x b
drop table t1,t2;
+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);
+a b
+1 5
+2 12
+4 105
+drop table t1, t2;
diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result
index 8376535593e..4b4377915c7 100644
--- a/mysql-test/r/system_mysql_db.result
+++ b/mysql-test/r/system_mysql_db.result
@@ -10,6 +10,11 @@ help_topic
host
proc
tables_priv
+time_zone
+time_zone_leap_second
+time_zone_name
+time_zone_transition
+time_zone_transition_type
user
show create table db;
Table Create Table
diff --git a/mysql-test/r/system_mysql_db_refs.result b/mysql-test/r/system_mysql_db_refs.result
index e15934b03ac..ac072505bc9 100644
--- a/mysql-test/r/system_mysql_db_refs.result
+++ b/mysql-test/r/system_mysql_db_refs.result
@@ -18,44 +18,44 @@ create table test_columns_priv select * from mysql.columns_priv;
delete from test_columns_priv;
insert into test_columns_priv (Host,Db,User,Table_name,Column_name) values (@name,@name,@name,@name,@name);
select
-if(isnull(test_db.Host),'WRONG!!!','ok') as test_db_Host,
-if(isnull(test_host.Host),'WRONG!!!','ok') as test_host_Host,
-if(isnull(test_user.Host),'WRONG!!!','ok') as test_user_Host,
-if(isnull(test_tables_priv.Host),'WRONG!!!','ok') as test_tables_priv_Host,
-if(isnull(test_columns_priv.Host),'WRONG!!!','ok') as test_columns_priv_Host
-from test_db
-left join test_host on test_db.Host=test_host.Host
-left join test_user on test_db.Host=test_user.Host
-left join test_tables_priv on test_db.Host=test_tables_priv.Host
+if(isnull(test_db.Host),'WRONG!!!','ok') as test_db_Host,
+if(isnull(test_host.Host),'WRONG!!!','ok') as test_host_Host,
+if(isnull(test_user.Host),'WRONG!!!','ok') as test_user_Host,
+if(isnull(test_tables_priv.Host),'WRONG!!!','ok') as test_tables_priv_Host,
+if(isnull(test_columns_priv.Host),'WRONG!!!','ok') as test_columns_priv_Host
+from test_db
+left join test_host on test_db.Host=test_host.Host
+left join test_user on test_db.Host=test_user.Host
+left join test_tables_priv on test_db.Host=test_tables_priv.Host
left join test_columns_priv on test_db.Host=test_columns_priv.Host;
test_db_Host test_host_Host test_user_Host test_tables_priv_Host test_columns_priv_Host
ok ok ok ok ok
select
-if(isnull(test_db.Db),'WRONG!!!','ok') as test_db_Db,
-if(isnull(test_host.Db),'WRONG!!!','ok') as test_host_Db,
-if(isnull(test_tables_priv.Db),'WRONG!!!','ok') as test_tables_priv_Db,
-if(isnull(test_columns_priv.Db),'WRONG!!!','ok') as est_columns_priv_Db
-from test_db
-left join test_host on test_db.Db=test_host.Db
-left join test_tables_priv on test_db.Db=test_tables_priv.Db
+if(isnull(test_db.Db),'WRONG!!!','ok') as test_db_Db,
+if(isnull(test_host.Db),'WRONG!!!','ok') as test_host_Db,
+if(isnull(test_tables_priv.Db),'WRONG!!!','ok') as test_tables_priv_Db,
+if(isnull(test_columns_priv.Db),'WRONG!!!','ok') as est_columns_priv_Db
+from test_db
+left join test_host on test_db.Db=test_host.Db
+left join test_tables_priv on test_db.Db=test_tables_priv.Db
left join test_columns_priv on test_db.Db=test_columns_priv.Db;
test_db_Db test_host_Db test_tables_priv_Db est_columns_priv_Db
ok ok ok ok
-select
-if(isnull(test_db.User),'WRONG!!!','ok') as test_db_User,
-if(isnull(test_user.User),'WRONG!!!','ok') as test_user_User,
-if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
-if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
-from test_db
-left join test_user on test_db.User=test_user.User
-left join test_tables_priv on test_db.User=test_tables_priv.User
+select
+if(isnull(test_db.User),'WRONG!!!','ok') as test_db_User,
+if(isnull(test_user.User),'WRONG!!!','ok') as test_user_User,
+if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
+if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
+from test_db
+left join test_user on test_db.User=test_user.User
+left join test_tables_priv on test_db.User=test_tables_priv.User
left join test_columns_priv on test_db.User=test_columns_priv.User;
test_db_User test_user_User test_tables_priv_User test_columns_priv_User
ok ok ok ok
-select
-if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
-if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
-from test_tables_priv
+select
+if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
+if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
+from test_tables_priv
left join test_columns_priv on test_tables_priv.Table_name=test_columns_priv.Table_name;
test_tables_priv_User test_columns_priv_User
ok ok
diff --git a/mysql-test/r/timezone.result b/mysql-test/r/timezone.result
index 15f0d4121c7..10944c3706e 100644
--- a/mysql-test/r/timezone.result
+++ b/mysql-test/r/timezone.result
@@ -1,7 +1,7 @@
DROP TABLE IF EXISTS t1;
-show variables like "timezone";
+show variables like "system_time_zone";
Variable_name Value
-timezone MET
+system_time_zone MET
select @a:=FROM_UNIXTIME(1);
@a:=FROM_UNIXTIME(1)
1970-01-01 01:00:01
@@ -32,6 +32,13 @@ ts from_unixtime(ts)
1048989599 2003-03-30 03:59:59
1048989601 2003-03-30 04:00:01
DROP TABLE t1;
+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');
+Warnings:
+Warning 1299 Invalid TIMESTAMP value in column 'ts' at row 2
+DROP TABLE t1;
select unix_timestamp('1970-01-01 01:00:00'),
unix_timestamp('1970-01-01 01:00:01'),
unix_timestamp('2038-01-01 00:59:59'),
diff --git a/mysql-test/r/timezone2.result b/mysql-test/r/timezone2.result
new file mode 100644
index 00000000000..5361ff4ffe6
--- /dev/null
+++ b/mysql-test/r/timezone2.result
@@ -0,0 +1,246 @@
+drop table if exists t1;
+create table t1 (ts timestamp);
+set time_zone='+00:00';
+select unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp());
+unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp())
+0
+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());
+unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp())
+-37800
+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());
+unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp())
+36000
+insert into t1 (ts) values ('2003-03-30 02:30:00');
+select * from t1;
+ts
+2003-03-29 16:30:00
+2003-03-29 06:00:00
+2003-03-30 02:30:00
+drop table t1;
+select Name from mysql.time_zone_name where Name in
+('UTC','Universal','MET','Europe/Moscow','leap/Europe/Moscow');
+Name
+Europe/Moscow
+leap/Europe/Moscow
+MET
+Universal
+UTC
+create table t1 (i int, ts timestamp);
+set time_zone='MET';
+insert into t1 (i, ts) values
+(unix_timestamp('2003-03-01 00:00:00'),'2003-03-01 00:00:00');
+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');
+Warnings:
+Warning 1299 Invalid TIMESTAMP value in column 'ts' at row 2
+insert into t1 (i, ts) values
+(unix_timestamp('2003-05-01 00:00:00'),'2003-05-01 00:00:00');
+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;
+i ts
+1046473200 2003-02-28 23:00:00
+1048985999 2003-03-30 00:59:59
+1048986000 2003-03-30 01:00:00
+1048986000 2003-03-30 01:00:00
+1051740000 2003-04-30 22:00:00
+1067122800 2003-10-25 23:00:00
+1067126400 2003-10-26 00:00:00
+1067129999 2003-10-26 00:59:59
+1067137200 2003-10-26 03:00:00
+1067129999 2003-10-26 00:59:59
+delete from t1;
+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');
+Warnings:
+Warning 1299 Invalid TIMESTAMP value in column 'ts' at row 2
+select * from t1;
+i ts
+1072904400 2004-01-01 00:00:00
+1080428400 2004-03-28 03:00:00
+1091304000 2003-08-01 00:00:00
+1099175400 2004-10-31 02:30:00
+delete from t1;
+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');
+Warnings:
+Warning 1299 Invalid TIMESTAMP value in column 'ts' at row 2
+select * from t1;
+i ts
+1072904422 2004-01-01 00:00:00
+1080428422 2004-03-28 03:00:00
+1091304022 2003-08-01 00:00:00
+1099175422 2004-10-31 02:30:00
+delete from t1;
+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;
+i ts
+362793608 1981-07-01 03:59:59
+362793610 1981-07-01 04:00:00
+select from_unixtime(362793609);
+from_unixtime(362793609)
+1981-07-01 03:59:60
+drop table t1;
+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');
+Warnings:
+Warning 1264 Data truncated; out of range for column 'ts' at row 2
+Warning 1264 Data truncated; out of range for column 'ts' at row 3
+Warning 1264 Data truncated; out of range for column 'ts' at row 6
+select * from t1;
+ts
+0000-00-00 00:00:00
+0000-00-00 00:00:00
+0000-00-00 00:00:00
+1970-01-01 00:00:01
+2037-12-31 23:59:59
+0000-00-00 00:00:00
+delete from t1;
+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');
+Warnings:
+Warning 1264 Data truncated; out of range for column 'ts' at row 2
+Warning 1264 Data truncated; out of range for column 'ts' at row 3
+Warning 1264 Data truncated; out of range for column 'ts' at row 6
+select * from t1;
+ts
+0000-00-00 00:00:00
+0000-00-00 00:00:00
+0000-00-00 00:00:00
+1970-01-01 01:00:01
+2038-01-01 00:59:59
+0000-00-00 00:00:00
+delete from t1;
+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');
+Warnings:
+Warning 1264 Data truncated; out of range for column 'ts' at row 2
+Warning 1264 Data truncated; out of range for column 'ts' at row 3
+Warning 1264 Data truncated; out of range for column 'ts' at row 6
+select * from t1;
+ts
+0000-00-00 00:00:00
+0000-00-00 00:00:00
+0000-00-00 00:00:00
+1970-01-01 01:30:01
+2038-01-01 01:29:59
+0000-00-00 00:00:00
+drop table t1;
+show variables like 'time_zone';
+Variable_name Value
+time_zone +01:30
+set time_zone = default;
+show variables like 'time_zone';
+Variable_name Value
+time_zone SYSTEM
+set time_zone= '0';
+ERROR HY000: Unknown or incorrect time zone: '0'
+set time_zone= '0:0';
+ERROR HY000: Unknown or incorrect time zone: '0:0'
+set time_zone= '-20:00';
+ERROR HY000: Unknown or incorrect time zone: '-20:00'
+set time_zone= '+20:00';
+ERROR HY000: Unknown or incorrect time zone: '+20:00'
+set time_zone= 'Some/Unknown/Time/Zone';
+ERROR HY000: Unknown or incorrect time zone: 'Some/Unknown/Time/Zone'
+select convert_tz(now(),'UTC', 'Universal') = now();
+convert_tz(now(),'UTC', 'Universal') = now()
+1
+select convert_tz(now(),'utc', 'UTC') = now();
+convert_tz(now(),'utc', 'UTC') = now()
+1
+select convert_tz('1917-11-07 12:00:00', 'MET', 'UTC');
+convert_tz('1917-11-07 12:00:00', 'MET', 'UTC')
+1917-11-07 12:00:00
+select convert_tz('1970-01-01 01:00:00', 'MET', 'UTC');
+convert_tz('1970-01-01 01:00:00', 'MET', 'UTC')
+1970-01-01 01:00:00
+select convert_tz('1970-01-01 01:00:01', 'MET', 'UTC');
+convert_tz('1970-01-01 01:00:01', 'MET', 'UTC')
+1970-01-01 00:00:01
+select convert_tz('2003-03-01 00:00:00', 'MET', 'UTC');
+convert_tz('2003-03-01 00:00:00', 'MET', 'UTC')
+2003-02-28 23:00:00
+select convert_tz('2003-03-30 01:59:59', 'MET', 'UTC');
+convert_tz('2003-03-30 01:59:59', 'MET', 'UTC')
+2003-03-30 00:59:59
+select convert_tz('2003-03-30 02:30:00', 'MET', 'UTC');
+convert_tz('2003-03-30 02:30:00', 'MET', 'UTC')
+2003-03-30 01:00:00
+select convert_tz('2003-03-30 03:00:00', 'MET', 'UTC');
+convert_tz('2003-03-30 03:00:00', 'MET', 'UTC')
+2003-03-30 01:00:00
+select convert_tz('2003-05-01 00:00:00', 'MET', 'UTC');
+convert_tz('2003-05-01 00:00:00', 'MET', 'UTC')
+2003-04-30 22:00:00
+select convert_tz('2003-10-26 01:00:00', 'MET', 'UTC');
+convert_tz('2003-10-26 01:00:00', 'MET', 'UTC')
+2003-10-25 23:00:00
+select convert_tz('2003-10-26 02:00:00', 'MET', 'UTC');
+convert_tz('2003-10-26 02:00:00', 'MET', 'UTC')
+2003-10-26 00:00:00
+select convert_tz('2003-10-26 02:59:59', 'MET', 'UTC');
+convert_tz('2003-10-26 02:59:59', 'MET', 'UTC')
+2003-10-26 00:59:59
+select convert_tz('2003-10-26 04:00:00', 'MET', 'UTC');
+convert_tz('2003-10-26 04:00:00', 'MET', 'UTC')
+2003-10-26 03:00:00
+select convert_tz('2038-01-01 00:59:59', 'MET', 'UTC');
+convert_tz('2038-01-01 00:59:59', 'MET', 'UTC')
+2037-12-31 23:59:59
+select convert_tz('2038-01-01 01:00:00', 'MET', 'UTC');
+convert_tz('2038-01-01 01:00:00', 'MET', 'UTC')
+2038-01-01 01:00:00
+select convert_tz('2103-01-01 04:00:00', 'MET', 'UTC');
+convert_tz('2103-01-01 04:00:00', 'MET', 'UTC')
+2103-01-01 04:00:00
+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;
+tz convert_tz('2003-12-31 00:00:00',tz,'UTC') convert_tz('2003-12-31 00:00:00','UTC',tz)
+MET 2003-12-30 23:00:00 2003-12-31 01:00:00
+UTC 2003-12-31 00:00:00 2003-12-31 00:00:00
+drop table t1;
+select convert_tz('2003-12-31 04:00:00', NULL, 'UTC');
+convert_tz('2003-12-31 04:00:00', NULL, 'UTC')
+NULL
+select convert_tz('2003-12-31 04:00:00', 'SomeNotExistingTimeZone', 'UTC');
+convert_tz('2003-12-31 04:00:00', 'SomeNotExistingTimeZone', 'UTC')
+NULL
+select convert_tz('2003-12-31 04:00:00', 'MET', 'SomeNotExistingTimeZone');
+convert_tz('2003-12-31 04:00:00', 'MET', 'SomeNotExistingTimeZone')
+NULL
+select convert_tz('2003-12-31 04:00:00', 'MET', NULL);
+convert_tz('2003-12-31 04:00:00', 'MET', NULL)
+NULL
+select convert_tz( NULL, 'MET', 'UTC');
+convert_tz( NULL, 'MET', 'UTC')
+NULL
diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result
index 6792f2f4c2c..580fc9a8d0b 100644
--- a/mysql-test/r/type_blob.result
+++ b/mysql-test/r/type_blob.result
@@ -27,7 +27,7 @@ t3 CREATE TABLE `t3` (
drop table t1,t2,t3
#;
CREATE TABLE t1 (a char(257) default "hello");
-ERROR 42000: Too big column length for column 'a' (max = 255). Use BLOB instead
+ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB instead
CREATE TABLE t2 (a blob default "hello");
ERROR 42000: BLOB/TEXT column 'a' can't have a default value
drop table if exists t1,t2;
diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result
index cebd005c2c8..e77ef9f975b 100644
--- a/mysql-test/r/type_date.result
+++ b/mysql-test/r/type_date.result
@@ -73,3 +73,9 @@ SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.
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))
Wed, 06 March 2002 10:11:12 GMT-0800 Wed, 06 March 2002 10:11:12 GMT-0800
drop table t1,t2;
+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;
+DATE_FORMAT(f1, "%l.%i %p") DATE_FORMAT(f2, "%l.%i %p")
+9.00 AM 12.00 PM
+DROP TABLE t1;
diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result
index 66eb744e7ce..524bc9c50d4 100644
--- a/mysql-test/r/type_datetime.result
+++ b/mysql-test/r/type_datetime.result
@@ -1,12 +1,6 @@
drop table if exists t1;
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);
-Warnings:
-Warning 1265 Data truncated for column 't' at row 13
-Warning 1265 Data truncated for column 't' at row 14
-Warning 1265 Data truncated for column 't' at row 15
-Warning 1265 Data truncated for column 't' at row 16
-Warning 1265 Data truncated for column 't' at row 17
+insert into t1 values (101),(691231),(700101),(991231),(10000101),(99991231),(101000000),(691231000000),(700101000000),(991231235959),(10000101000000),(99991231235959),(20030100000000),(20030000000000);
select * from t1;
t
2000-01-01 00:00:00
@@ -21,11 +15,8 @@ t
1999-12-31 23:59:59
1000-01-01 00:00:00
9999-12-31 23:59:59
-0000-00-00 00:00:00
-0000-00-00 00:00:00
-0000-00-00 00:00:00
-0000-00-00 00:00:00
-0000-00-00 00:00:00
+2003-01-00 00:00:00
+2003-00-00 00:00:00
delete from t1 where t > 0;
optimize table t1;
Table Op Msg_type Msg_text
@@ -34,13 +25,7 @@ check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
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");
-Warnings:
-Warning 1264 Data truncated, out of range for column 't' at row 14
-Warning 1264 Data truncated, out of range for column 't' at row 15
-Warning 1264 Data truncated, out of range for column 't' at row 16
-Warning 1264 Data truncated, out of range for column 't' at row 17
-Warning 1264 Data truncated, out of range for column 't' at row 18
+insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030100000000"),("20030000000000");
select * from t1;
t
2000-01-01 00:00:00
@@ -56,11 +41,8 @@ t
1999-12-31 23:59:59
1000-01-01 00:00:00
9999-12-31 23:59:59
-0000-00-00 00:00:00
-0000-00-00 00:00:00
-0000-00-00 00:00:00
-0000-00-00 00:00:00
-0000-00-00 00:00:00
+2003-01-00 00:00:00
+2003-00-00 00:00:00
drop table t1;
CREATE TABLE t1 (a timestamp, b date, c time, d datetime);
insert into t1 (b,c,d) values(now(),curtime(),now());
@@ -114,3 +96,43 @@ insert into t1 values (now(), now());
select * from t1 where a is null or b is null;
a b
drop table t1;
+create table t1 (t datetime);
+insert into t1 values (20030102030460),(20030102036301),(20030102240401),(20030132030401),(20031302030460);
+Warnings:
+Warning 1265 Data truncated for column 't' at row 1
+Warning 1265 Data truncated for column 't' at row 2
+Warning 1265 Data truncated for column 't' at row 3
+Warning 1265 Data truncated for column 't' at row 4
+Warning 1265 Data truncated for column 't' at row 5
+select * from t1;
+t
+0000-00-00 00:00:00
+0000-00-00 00:00:00
+0000-00-00 00:00:00
+0000-00-00 00:00:00
+0000-00-00 00:00:00
+delete from t1;
+insert into t1 values ("20030102030460"),("20030102036301"),("20030102240401"),("20030132030401"),("20031302030460");
+Warnings:
+Warning 1264 Data truncated; out of range for column 't' at row 1
+Warning 1264 Data truncated; out of range for column 't' at row 2
+Warning 1264 Data truncated; out of range for column 't' at row 3
+Warning 1264 Data truncated; out of range for column 't' at row 4
+Warning 1264 Data truncated; out of range for column 't' at row 5
+select * from t1;
+t
+0000-00-00 00:00:00
+0000-00-00 00:00:00
+0000-00-00 00:00:00
+0000-00-00 00:00:00
+0000-00-00 00:00:00
+delete from t1;
+insert into t1 values ("0000-00-00 00:00:00 some trailer"),("2003-01-01 00:00:00 some trailer");
+Warnings:
+Warning 1264 Data truncated; out of range for column 't' at row 1
+Warning 1264 Data truncated; out of range for column 't' at row 2
+select * from t1;
+t
+0000-00-00 00:00:00
+2003-01-01 00:00:00
+drop table t1;
diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result
index dc78369f583..a9dcabd121e 100644
--- a/mysql-test/r/type_decimal.result
+++ b/mysql-test/r/type_decimal.result
@@ -158,14 +158,14 @@ insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
Warnings:
-Warning 1264 Data truncated, out of range for column 'a' at row 1
-Warning 1264 Data truncated, out of range for column 'a' at row 2
-Warning 1264 Data truncated, out of range for column 'a' at row 3
+Warning 1264 Data truncated; out of range for column 'a' at row 1
+Warning 1264 Data truncated; out of range for column 'a' at row 2
+Warning 1264 Data truncated; out of range for column 'a' at row 3
insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
Warnings:
-Warning 1264 Data truncated, out of range for column 'a' at row 1
+Warning 1264 Data truncated; out of range for column 'a' at row 1
Warning 1265 Data truncated for column 'a' at row 2
-Warning 1264 Data truncated, out of range for column 'a' at row 3
+Warning 1264 Data truncated; out of range for column 'a' at row 3
insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
Warnings:
Warning 1265 Data truncated for column 'a' at row 3
@@ -201,29 +201,29 @@ drop table t1;
create table t1 (a decimal(10,2) unsigned);
insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0");
Warnings:
-Warning 1264 Data truncated, out of range for column 'a' at row 2
-Warning 1264 Data truncated, out of range for column 'a' at row 6
+Warning 1264 Data truncated; out of range for column 'a' at row 2
+Warning 1264 Data truncated; out of range for column 'a' at row 6
insert into t1 values ("-.1"),("+.1"),(".1");
Warnings:
-Warning 1264 Data truncated, out of range for column 'a' at row 1
+Warning 1264 Data truncated; out of range for column 'a' at row 1
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
Warnings:
-Warning 1264 Data truncated, out of range for column 'a' at row 3
+Warning 1264 Data truncated; out of range for column 'a' at row 3
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
Warnings:
-Warning 1264 Data truncated, out of range for column 'a' at row 1
-Warning 1264 Data truncated, out of range for column 'a' at row 2
-Warning 1264 Data truncated, out of range for column 'a' at row 3
+Warning 1264 Data truncated; out of range for column 'a' at row 1
+Warning 1264 Data truncated; out of range for column 'a' at row 2
+Warning 1264 Data truncated; out of range for column 'a' at row 3
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
Warnings:
-Warning 1264 Data truncated, out of range for column 'a' at row 1
-Warning 1264 Data truncated, out of range for column 'a' at row 2
-Warning 1264 Data truncated, out of range for column 'a' at row 3
+Warning 1264 Data truncated; out of range for column 'a' at row 1
+Warning 1264 Data truncated; out of range for column 'a' at row 2
+Warning 1264 Data truncated; out of range for column 'a' at row 3
insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
Warnings:
-Warning 1264 Data truncated, out of range for column 'a' at row 1
+Warning 1264 Data truncated; out of range for column 'a' at row 1
Warning 1265 Data truncated for column 'a' at row 2
-Warning 1264 Data truncated, out of range for column 'a' at row 3
+Warning 1264 Data truncated; out of range for column 'a' at row 3
insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
Warnings:
Warning 1265 Data truncated for column 'a' at row 3
@@ -259,29 +259,29 @@ drop table t1;
create table t1 (a decimal(10,2) zerofill);
insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0");
Warnings:
-Warning 1264 Data truncated, out of range for column 'a' at row 2
-Warning 1264 Data truncated, out of range for column 'a' at row 6
+Warning 1264 Data truncated; out of range for column 'a' at row 2
+Warning 1264 Data truncated; out of range for column 'a' at row 6
insert into t1 values ("-.1"),("+.1"),(".1");
Warnings:
-Warning 1264 Data truncated, out of range for column 'a' at row 1
+Warning 1264 Data truncated; out of range for column 'a' at row 1
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
Warnings:
-Warning 1264 Data truncated, out of range for column 'a' at row 3
+Warning 1264 Data truncated; out of range for column 'a' at row 3
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
Warnings:
-Warning 1264 Data truncated, out of range for column 'a' at row 1
-Warning 1264 Data truncated, out of range for column 'a' at row 2
-Warning 1264 Data truncated, out of range for column 'a' at row 3
+Warning 1264 Data truncated; out of range for column 'a' at row 1
+Warning 1264 Data truncated; out of range for column 'a' at row 2
+Warning 1264 Data truncated; out of range for column 'a' at row 3
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
Warnings:
-Warning 1264 Data truncated, out of range for column 'a' at row 1
-Warning 1264 Data truncated, out of range for column 'a' at row 2
-Warning 1264 Data truncated, out of range for column 'a' at row 3
+Warning 1264 Data truncated; out of range for column 'a' at row 1
+Warning 1264 Data truncated; out of range for column 'a' at row 2
+Warning 1264 Data truncated; out of range for column 'a' at row 3
insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
Warnings:
-Warning 1264 Data truncated, out of range for column 'a' at row 1
+Warning 1264 Data truncated; out of range for column 'a' at row 1
Warning 1265 Data truncated for column 'a' at row 2
-Warning 1264 Data truncated, out of range for column 'a' at row 3
+Warning 1264 Data truncated; out of range for column 'a' at row 3
insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
Warnings:
Warning 1265 Data truncated for column 'a' at row 3
@@ -321,13 +321,13 @@ insert into t1 values (00000000000001),(+0000000000001),(-0000000000001);
insert into t1 values (+111111111.11),(111111111.11),(-11111111.11);
insert into t1 values (-111111111.11),(+1111111111.11),(1111111111.11);
Warnings:
-Warning 1264 Data truncated, out of range for column 'a' at row 1
-Warning 1264 Data truncated, out of range for column 'a' at row 2
-Warning 1264 Data truncated, out of range for column 'a' at row 3
+Warning 1264 Data truncated; out of range for column 'a' at row 1
+Warning 1264 Data truncated; out of range for column 'a' at row 2
+Warning 1264 Data truncated; out of range for column 'a' at row 3
insert into t1 values (1e+100),(1e-100),(-1e+100);
Warnings:
-Warning 1264 Data truncated, out of range for column 'a' at row 1
-Warning 1264 Data truncated, out of range for column 'a' at row 3
+Warning 1264 Data truncated; out of range for column 'a' at row 1
+Warning 1264 Data truncated; out of range for column 'a' at row 3
insert into t1 values (123.4e0),(123.4e+2),(123.4e-2),(123e1),(123e+0);
select * from t1;
a
@@ -361,8 +361,8 @@ drop table t1;
create table t1 (a decimal);
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+12345678901'),(99999999999999);
Warnings:
-Warning 1264 Data truncated, out of range for column 'a' at row 1
-Warning 1264 Data truncated, out of range for column 'a' at row 7
+Warning 1264 Data truncated; out of range for column 'a' at row 1
+Warning 1264 Data truncated; out of range for column 'a' at row 7
select * from t1;
a
-9999999999
@@ -376,9 +376,9 @@ drop table t1;
create table t1 (a decimal unsigned);
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999);
Warnings:
-Warning 1264 Data truncated, out of range for column 'a' at row 1
-Warning 1264 Data truncated, out of range for column 'a' at row 2
-Warning 1264 Data truncated, out of range for column 'a' at row 7
+Warning 1264 Data truncated; out of range for column 'a' at row 1
+Warning 1264 Data truncated; out of range for column 'a' at row 2
+Warning 1264 Data truncated; out of range for column 'a' at row 7
select * from t1;
a
0
@@ -392,9 +392,9 @@ drop table t1;
create table t1 (a decimal zerofill);
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999);
Warnings:
-Warning 1264 Data truncated, out of range for column 'a' at row 1
-Warning 1264 Data truncated, out of range for column 'a' at row 2
-Warning 1264 Data truncated, out of range for column 'a' at row 7
+Warning 1264 Data truncated; out of range for column 'a' at row 1
+Warning 1264 Data truncated; out of range for column 'a' at row 2
+Warning 1264 Data truncated; out of range for column 'a' at row 7
select * from t1;
a
0000000000
@@ -408,9 +408,9 @@ drop table t1;
create table t1 (a decimal unsigned zerofill);
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999);
Warnings:
-Warning 1264 Data truncated, out of range for column 'a' at row 1
-Warning 1264 Data truncated, out of range for column 'a' at row 2
-Warning 1264 Data truncated, out of range for column 'a' at row 7
+Warning 1264 Data truncated; out of range for column 'a' at row 1
+Warning 1264 Data truncated; out of range for column 'a' at row 2
+Warning 1264 Data truncated; out of range for column 'a' at row 7
select * from t1;
a
0000000000
@@ -425,7 +425,7 @@ create table t1(a decimal(10,0));
insert into t1 values ("1e4294967295");
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
-Warning 1264 Data truncated, out of range for column 'a' at row 1
+Warning 1264 Data truncated; out of range for column 'a' at row 1
select * from t1;
a
99999999999
@@ -433,17 +433,24 @@ delete from t1;
insert into t1 values("1e4294967297");
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
-Warning 1264 Data truncated, out of range for column 'a' at row 1
+Warning 1264 Data truncated; out of range for column 'a' at row 1
select * from t1;
a
99999999999
drop table t1;
CREATE TABLE t1 (a_dec DECIMAL(-1,0));
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '-1,0))' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1,0))' at line 1
CREATE TABLE t1 (a_dec DECIMAL(-2,1));
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '-2,1))' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-2,1))' at line 1
CREATE TABLE t1 (a_dec DECIMAL(-1,1));
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '-1,1))' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1,1))' at line 1
+CREATE TABLE t1 (a_dec DECIMAL(0,11));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a_dec` decimal(12,11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
create table t1(a decimal(7,3));
insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000000001'),('10'),('+10'),('-10'),('0000000010'),('+0000000010'),('-0000000010'),('100'),('+100'),('-100'),('0000000100'),('+0000000100'),('-0000000100'),('1000'),('+1000'),('-1000'),('0000001000'),('+0000001000'),('-0000001000'),('10000'),('+10000'),('-10000'),('0000010000'),('+0000010000'),('-0000010000'),('100000'),('+100000'),('-100000'),('0000100000'),('+0000100000'),('-0000100000'),('1000000'),('+1000000'),('-1000000'),('0001000000'),('+0001000000'),('-0001000000'),('10000000'),('+10000000'),('-10000000'),('0010000000'),('+0010000000'),('-0010000000'),('100000000'),('+100000000'),('-100000000'),('0100000000'),('+0100000000'),('-0100000000'),('1000000000'),('+1000000000'),('-1000000000'),('1000000000'),('+1000000000'),('-1000000000');
select * from t1;
diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result
index f044ced2342..30de1e62df7 100644
--- a/mysql-test/r/type_float.result
+++ b/mysql-test/r/type_float.result
@@ -15,8 +15,8 @@ f1 float NULL YES NULL select,insert,update,references
f2 double NULL YES NULL select,insert,update,references
insert into t1 values(10,10),(1e+5,1e+5),(1234567890,1234567890),(1e+10,1e+10),(1e+15,1e+15),(1e+20,1e+20),(1e+50,1e+50),(1e+150,1e+150);
Warnings:
-Warning 1264 Data truncated, out of range for column 'f1' at row 7
-Warning 1264 Data truncated, out of range for column 'f1' at row 8
+Warning 1264 Data truncated; out of range for column 'f1' at row 7
+Warning 1264 Data truncated; out of range for column 'f1' at row 8
insert into t1 values(-10,-10),(1e-5,1e-5),(1e-10,1e-10),(1e-15,1e-15),(1e-20,1e-20),(1e-50,1e-50),(1e-150,1e-150);
select * from t1;
f1 f2
diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result
index 8d80f342c1c..e803fde14a6 100644
--- a/mysql-test/r/type_ranges.result
+++ b/mysql-test/r/type_ranges.result
@@ -89,33 +89,33 @@ insert into t1 values (NULL,2,2,2,2,2,2,2,2,2,2,2,2,2,NULL,NULL,NULL,NULL,NULL,N
insert into t1 values (0,1/3,3,3,3,3,3,3,3,3,3,3,3,3,NULL,'19970303','10:10:10','19970303101010','','','','3',3,3);
insert into t1 values (0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,NULL,19970807,080706,19970403090807,-1,-1,-1,'-1',-1,-1);
Warnings:
-Warning 1264 Data truncated, out of range for column 'utiny' at row 1
-Warning 1264 Data truncated, out of range for column 'ushort' at row 1
-Warning 1264 Data truncated, out of range for column 'umedium' at row 1
-Warning 1264 Data truncated, out of range for column 'ulong' at row 1
+Warning 1264 Data truncated; out of range for column 'utiny' at row 1
+Warning 1264 Data truncated; out of range for column 'ushort' at row 1
+Warning 1264 Data truncated; out of range for column 'umedium' at row 1
+Warning 1264 Data truncated; out of range for column 'ulong' at row 1
Warning 1265 Data truncated for column 'options' at row 1
Warning 1265 Data truncated for column 'flags' at row 1
insert into t1 values (0,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,NULL,0,0,0,-4294967295,-4294967295,-4294967295,'-4294967295',0,"one,two,tree");
Warnings:
Warning 1265 Data truncated for column 'string' at row 1
-Warning 1264 Data truncated, out of range for column 'tiny' at row 1
-Warning 1264 Data truncated, out of range for column 'short' at row 1
-Warning 1264 Data truncated, out of range for column 'medium' at row 1
-Warning 1264 Data truncated, out of range for column 'long_int' at row 1
-Warning 1264 Data truncated, out of range for column 'utiny' at row 1
-Warning 1264 Data truncated, out of range for column 'ushort' at row 1
-Warning 1264 Data truncated, out of range for column 'umedium' at row 1
-Warning 1264 Data truncated, out of range for column 'ulong' at row 1
+Warning 1264 Data truncated; out of range for column 'tiny' at row 1
+Warning 1264 Data truncated; out of range for column 'short' at row 1
+Warning 1264 Data truncated; out of range for column 'medium' at row 1
+Warning 1264 Data truncated; out of range for column 'long_int' at row 1
+Warning 1264 Data truncated; out of range for column 'utiny' at row 1
+Warning 1264 Data truncated; out of range for column 'ushort' at row 1
+Warning 1264 Data truncated; out of range for column 'umedium' at row 1
+Warning 1264 Data truncated; out of range for column 'ulong' at row 1
Warning 1265 Data truncated for column 'options' at row 1
insert into t1 values (0,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,NULL,0,0,0,4294967295,4294967295,4294967295,'4294967295',0,0);
Warnings:
-Warning 1264 Data truncated, out of range for column 'tiny' at row 1
-Warning 1264 Data truncated, out of range for column 'short' at row 1
-Warning 1264 Data truncated, out of range for column 'medium' at row 1
-Warning 1264 Data truncated, out of range for column 'long_int' at row 1
-Warning 1264 Data truncated, out of range for column 'utiny' at row 1
-Warning 1264 Data truncated, out of range for column 'ushort' at row 1
-Warning 1264 Data truncated, out of range for column 'umedium' at row 1
+Warning 1264 Data truncated; out of range for column 'tiny' at row 1
+Warning 1264 Data truncated; out of range for column 'short' at row 1
+Warning 1264 Data truncated; out of range for column 'medium' at row 1
+Warning 1264 Data truncated; out of range for column 'long_int' at row 1
+Warning 1264 Data truncated; out of range for column 'utiny' at row 1
+Warning 1264 Data truncated; out of range for column 'ushort' at row 1
+Warning 1264 Data truncated; out of range for column 'umedium' at row 1
Warning 1265 Data truncated for column 'options' at row 1
insert into t1 (tiny) values (1);
select auto,string,tiny,short,medium,long_int,longlong,real_float,real_double,utiny,ushort,umedium,ulong,ulonglong,mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000),date_field,time_field,date_time,blob_col,tinyblob_col,mediumblob_col,longblob_col from t1;
diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result
index 68b56802120..025cf2a57f1 100644
--- a/mysql-test/r/type_time.result
+++ b/mysql-test/r/type_time.result
@@ -25,11 +25,11 @@ t
36:30:31
insert into t1 values("10.22.22"),(1234567),(123456789),(123456789.10),("10 22:22"),("12.45a");
Warnings:
-Note 1292 Truncated wrong time value: '10.22.22'
-Warning 1264 Data truncated, out of range for column 't' at row 2
-Warning 1264 Data truncated, out of range for column 't' at row 3
-Warning 1264 Data truncated, out of range for column 't' at row 4
-Note 1292 Truncated wrong time value: '12.45a'
+Warning 1265 Data truncated for column 't' at row 1
+Warning 1264 Data truncated; out of range for column 't' at row 2
+Warning 1264 Data truncated; out of range for column 't' at row 3
+Warning 1264 Data truncated; out of range for column 't' at row 4
+Warning 1265 Data truncated for column 't' at row 6
select * from t1;
t
10:22:33
diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result
index 976b3e72385..aa8c0903558 100644
--- a/mysql-test/r/type_timestamp.result
+++ b/mysql-test/r/type_timestamp.result
@@ -43,13 +43,7 @@ date_format(a,"%Y %y") year(a) year(now())
1970 70 1970 1970
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);
-Warnings:
-Warning 1265 Data truncated for column 'ix' at row 10
-Warning 1265 Data truncated for column 'ix' at row 11
-Warning 1265 Data truncated for column 'ix' at row 12
-Warning 1265 Data truncated for column 'ix' at row 13
-Warning 1265 Data truncated for column 'ix' at row 14
+insert into t1 values (19991101000000),(19990102030405),(19990630232922),(19990601000000),(19990930232922),(19990531232922),(19990501000000),(19991101000000),(19990501000000);
select ix+0 from t1;
ix+0
19991101000000
@@ -61,24 +55,14 @@ ix+0
19990501000000
19991101000000
19990501000000
-0
-0
-0
-0
-0
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;
ix+0
19991101000000
19990102030405
19990630232922
19990601000000
-0
-0
-0
-0
-0
drop table t1;
CREATE TABLE t1 (date date, date_time datetime, time_stamp timestamp);
INSERT INTO t1 VALUES ("1998-12-31","1998-12-31 23:59:59",19981231235959);
@@ -128,16 +112,66 @@ t2 t4 t6 t8 t10 t12 t14
0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00
1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59
drop table t1;
+create table t1 (ix timestamp);
+insert into t1 values (0),(20030101010160),(20030101016001),(20030101240101),(20030132010101),(20031301010101),(20031200000000),(20030000000000);
+Warnings:
+Warning 1265 Data truncated for column 'ix' at row 2
+Warning 1265 Data truncated for column 'ix' at row 3
+Warning 1265 Data truncated for column 'ix' at row 4
+Warning 1265 Data truncated for column 'ix' at row 5
+Warning 1265 Data truncated for column 'ix' at row 6
+Warning 1265 Data truncated for column 'ix' at row 7
+Warning 1265 Data truncated for column 'ix' at row 8
+select ix+0 from t1;
+ix+0
+0
+0
+0
+0
+0
+0
+0
+0
+delete from t1;
+insert into t1 values ("00000000000000"),("20030101010160"),("20030101016001"),("20030101240101"),("20030132010101"),("20031301010101"),("20031200000000"),("20030000000000");
+Warnings:
+Warning 1265 Data truncated for column 'ix' at row 2
+Warning 1265 Data truncated for column 'ix' at row 3
+Warning 1265 Data truncated for column 'ix' at row 4
+Warning 1265 Data truncated for column 'ix' at row 5
+Warning 1265 Data truncated for column 'ix' at row 6
+Warning 1265 Data truncated for column 'ix' at row 7
+Warning 1265 Data truncated for column 'ix' at row 8
+select ix+0 from t1;
+ix+0
+0
+0
+0
+0
+0
+0
+0
+0
+delete from t1;
+insert into t1 values ("0000-00-00 00:00:00 some trailer"),("2003-01-01 00:00:00 some trailer");
+Warnings:
+Warning 1265 Data truncated for column 'ix' at row 1
+Warning 1265 Data truncated for column 'ix' at row 2
+select ix+0 from t1;
+ix+0
+0
+20030101000000
+drop table t1;
create table t1 (t1 timestamp, t2 timestamp default now());
-ERROR HY000: Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
+ERROR HY000: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
create table t1 (t1 timestamp, t2 timestamp on update now());
-ERROR HY000: Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
+ERROR HY000: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
create table t1 (t1 timestamp, t2 timestamp default now() on update now());
-ERROR HY000: Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
+ERROR HY000: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
create table t1 (t1 timestamp default now(), t2 timestamp on update now());
-ERROR HY000: Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
+ERROR HY000: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
create table t1 (t1 timestamp on update now(), t2 timestamp default now() on update now());
-ERROR HY000: Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
+ERROR HY000: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
create table t1 (t1 timestamp default '2003-01-01 00:00:00', t2 datetime, t3 timestamp);
SET TIMESTAMP=1000000000;
insert into t1 values ();
diff --git a/mysql-test/r/type_uint.result b/mysql-test/r/type_uint.result
index f312e9b7f64..07eb47faa7c 100644
--- a/mysql-test/r/type_uint.result
+++ b/mysql-test/r/type_uint.result
@@ -4,7 +4,7 @@ create table t1 (this int unsigned);
insert into t1 values (1);
insert into t1 values (-1);
Warnings:
-Warning 1264 Data truncated, out of range for column 'this' at row 1
+Warning 1264 Data truncated; out of range for column 'this' at row 1
select * from t1;
this
1
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 0735ea4dc40..afee837b1a5 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -81,7 +81,7 @@ a b
2 b
1 a
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by t1.b;
-ERROR 42000: Table 't1' from one of SELECT's can not be used in global ORDER clause
+ERROR 42000: Table 't1' from one of the SELECTs cannot be used in global ORDER clause
explain extended (select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
@@ -117,11 +117,11 @@ ERROR 21000: The used SELECT statements have a different number of columns
explain select a,b from t1 union select 1 limit 0;
ERROR 21000: The used SELECT statements have a different number of columns
select a,b from t1 into outfile 'skr' union select a,b from t2;
-ERROR HY000: Wrong usage of UNION and INTO
+ERROR HY000: Incorrect usage of UNION and INTO
select a,b from t1 order by a union select a,b from t2;
-ERROR HY000: Wrong usage of UNION and ORDER BY
+ERROR HY000: Incorrect usage of UNION and ORDER BY
insert into t3 select a from t1 order by a union select a from t2;
-ERROR HY000: Wrong usage of UNION and ORDER BY
+ERROR HY000: Incorrect usage of UNION and ORDER BY
create table t3 select a,b from t1 union select a from t2;
ERROR 21000: The used SELECT statements have a different number of columns
select a,b from t1 union select a from t2;
@@ -131,7 +131,7 @@ ERROR 21000: The used SELECT statements have a different number of columns
select a from t1 union select * from t2;
ERROR 21000: The used SELECT statements have a different number of columns
select * from t1 union select SQL_BUFFER_RESULT * from t2;
-ERROR 42000: Wrong usage/placement of 'SQL_BUFFER_RESULT'
+ERROR 42000: Incorrect usage/placement of 'SQL_BUFFER_RESULT'
create table t3 select a,b from t1 union all select a,b from t2;
insert into t3 select a,b from t1 union all select a,b from t2;
replace into t3 select a,b as c from t1 union all select a,b from t2;
@@ -341,7 +341,7 @@ select found_rows();
found_rows()
4
(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION SELECT * FROM t2 LIMIT 1;
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION all SELECT * FROM t2 LIMIT 2;
a
1
@@ -424,7 +424,7 @@ a
3
3
(SELECT * FROM t1) UNION all (SELECT SQL_CALC_FOUND_ROWS * FROM t2) LIMIT 1;
-ERROR 42000: Wrong usage/placement of 'SQL_CALC_FOUND_ROWS'
+ERROR 42000: Incorrect usage/placement of 'SQL_CALC_FOUND_ROWS'
create temporary table t1 select a from t1 union select a from t2;
drop temporary table t1;
create table t1 select a from t1 union select a from t2;
@@ -546,7 +546,7 @@ aa
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` char(2) NOT NULL default ''
+ `a` char(20) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 SELECT 12 as a UNION select 12.2 as a;
@@ -557,7 +557,7 @@ a
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` double(4,1) NOT NULL default '0.0'
+ `a` double(53,1) NOT NULL default '0.0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t2 (it1 tinyint, it2 tinyint not null, i int not null, ib bigint, f float, d double, y year, da date, dt datetime, sc char(10), sv varchar(10), b blob, tx text);
@@ -647,7 +647,7 @@ f
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f` binary(12) default NULL
+ `f` binary(24) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 SELECT y from t2 UNION select da from t2;
@@ -795,7 +795,7 @@ select * from t1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `1` bigint(1) NOT NULL default '0'
+ `1` bigint(20) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 select _latin1"test" union select _latin2"testt" ;
@@ -953,3 +953,38 @@ CREATE TABLE t2 (i int(11) default NULL,c char(1) default NULL,KEY i (i));
explain (select * from t1) union (select * from t2) order by not_existing_column;
ERROR 42S22: Unknown column 'not_existing_column' in 'order clause'
drop table t1, t2;
+CREATE TABLE t1 (uid int(1));
+INSERT INTO t1 SELECT 150;
+SELECT 'a' UNION SELECT uid FROM t1;
+a
+a
+150
+drop table t1;
+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);
+ID1 ID2 DATA1 DATA2 DATA3 ID DATA1
+drop table t1,t2;
diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result
index a9351d2f1fb..9bbfefeb34a 100644
--- a/mysql-test/r/user_var.result
+++ b/mysql-test/r/user_var.result
@@ -162,3 +162,38 @@ charset(@a) collation(@a) coercibility(@a)
latin2 latin2_bin 0
select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' collate latin2_general_ci;
ERROR HY000: Illegal mix of collations (latin2_bin,EXPLICIT) and (latin2_general_ci,EXPLICIT) for operation '='
+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 95;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 95 User var 1 136 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci
+master-bin.000001 136 Query 1 222 use `test`; INSERT INTO t1 VALUES(@`a b`)
+master-bin.000001 222 User var 1 264 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci
+master-bin.000001 264 Query 1 350 use `test`; insert into t1 values (@var1)
+master-bin.000001 350 Query 1 448 use `test`; create table t2 (c char(30)) charset=ucs2
+master-bin.000001 448 User var 1 488 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci
+master-bin.000001 488 Query 1 571 use `test`; insert into t2 values (@v)
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+SET @`a b`:=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci;
+use test;
+SET TIMESTAMP=10000;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
+SET @@session.sql_mode=0;
+INSERT INTO t1 VALUES(@`a b`);
+SET @`var1`:=_latin1 0x273B616161 COLLATE latin1_swedish_ci;
+SET TIMESTAMP=10000;
+insert into t1 values (@var1);
+SET TIMESTAMP=10000;
+create table t2 (c char(30)) charset=ucs2;
+SET @`v`:=_ucs2 0x006100620063 COLLATE ucs2_general_ci;
+SET TIMESTAMP=10000;
+insert into t2 values (@v);
+drop table t1, t2;
diff --git a/mysql-test/r/varbinary.result b/mysql-test/r/varbinary.result
index 26ce91286da..ab5779859ae 100644
--- a/mysql-test/r/varbinary.result
+++ b/mysql-test/r/varbinary.result
@@ -18,7 +18,7 @@ Warnings:
Note 1003 select test.t1.ID AS `ID`,test.t1.UNIQ AS `UNIQ` from test.t1 where (test.t1.UNIQ = 4084688022709641610)
drop table t1;
select x'hello';
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'x'hello'' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'x'hello'' at line 1
select 0xfg;
ERROR 42S22: Unknown column '0xfg' in 'field list'
create table t1 select 1 as x, 2 as xx;
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index 31a0ada1267..37e848ad0d9 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -239,7 +239,7 @@ ERROR 42000: Variable 'big_tables' can't be set to the value of 'OFFF'
set unknown_variable=1;
ERROR HY000: Unknown system variable 'unknown_variable'
set max_join_size="hello";
-ERROR 42000: Wrong argument type to variable 'max_join_size'
+ERROR 42000: Incorrect argument type to variable 'max_join_size'
set storage_engine=UNKNOWN_TABLE_TYPE;
ERROR 42000: Unknown table engine 'UNKNOWN_TABLE_TYPE'
set storage_engine=INNODB, big_tables=2;
@@ -364,7 +364,7 @@ set sql_log_bin=1;
set sql_log_off=1;
set sql_log_update=1;
Warnings:
-Note 1308 The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored
+Note 1313 The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored
set sql_low_priority_updates=1;
set sql_max_join_size=200;
select @@sql_max_join_size,@@max_join_size;
@@ -424,7 +424,7 @@ ERROR 42000: Variable 'ft_boolean_syntax' can't be set to the value of ''
set global myisam_max_sort_file_size=4294967296;
show global variables like 'myisam_max_sort_file_size';
Variable_name Value
-myisam_max_sort_file_size 4294967296
+myisam_max_sort_file_size MAX_FILE_SIZE
set global myisam_max_sort_file_size=default;
select @@global.max_user_connections,@@local.max_join_size;
@@global.max_user_connections @@session.max_join_size
@@ -451,12 +451,12 @@ select @a, @b;
@a @b
2 1
set @@global.global.key_buffer_size= 1;
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size= 1' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size= 1' at line 1
set GLOBAL global.key_buffer_size= 1;
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size= 1' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size= 1' at line 1
SELECT @@global.global.key_buffer_size;
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size' at line 1
SELECT @@global.session.key_buffer_size;
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size' at line 1
SELECT @@global.local.key_buffer_size;
-ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size' at line 1
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size' at line 1
diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result
index 19d44ab6fea..d883feb7ce2 100644
--- a/mysql-test/r/warnings.result
+++ b/mysql-test/r/warnings.result
@@ -43,13 +43,13 @@ drop table t1;
create table t1(a tinyint, b int not null, c date, d char(5));
load data infile '../../std_data/warnings_loaddata.dat' into table t1 fields terminated by ',';
Warnings:
-Warning 1263 Data truncated, NULL supplied to NOT NULL column 'b' at row 2
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'b' at row 2
Warning 1265 Data truncated for column 'd' at row 3
Warning 1265 Data truncated for column 'c' at row 4
Warning 1261 Row 5 doesn't contain data for all columns
Warning 1265 Data truncated for column 'b' at row 6
-Warning 1262 Row 7 was truncated; It contained more data than there were input columns
-Warning 1264 Data truncated, out of range for column 'a' at row 8
+Warning 1262 Row 7 was truncated; it contained more data than there were input columns
+Warning 1264 Data truncated; out of range for column 'a' at row 8
select @@warning_count;
@@warning_count
7
@@ -57,11 +57,11 @@ drop table t1;
create table t1(a tinyint NOT NULL, b tinyint unsigned, c char(5));
insert into t1 values(NULL,100,'mysql'),(10,-1,'mysql ab'),(500,256,'open source'),(20,NULL,'test');
Warnings:
-Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 1
-Warning 1264 Data truncated, out of range for column 'b' at row 2
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1
+Warning 1264 Data truncated; out of range for column 'b' at row 2
Warning 1265 Data truncated for column 'c' at row 2
-Warning 1264 Data truncated, out of range for column 'a' at row 3
-Warning 1264 Data truncated, out of range for column 'b' at row 3
+Warning 1264 Data truncated; out of range for column 'a' at row 3
+Warning 1264 Data truncated; out of range for column 'b' at row 3
Warning 1265 Data truncated for column 'c' at row 3
alter table t1 modify c char(4);
Warnings:
@@ -70,7 +70,7 @@ Warning 1265 Data truncated for column 'c' at row 2
alter table t1 add d char(2);
update t1 set a=NULL where a=10;
Warnings:
-Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 2
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 2
update t1 set c='mysql ab' where c='test';
Warnings:
Warning 1265 Data truncated for column 'c' at row 4
@@ -86,7 +86,7 @@ Warnings:
Warning 1265 Data truncated for column 'b' at row 1
Warning 1265 Data truncated for column 'b' at row 2
Warning 1265 Data truncated for column 'b' at row 3
-Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 4
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 4
Warning 1265 Data truncated for column 'b' at row 4
insert into t2(b) values('mysqlab');
Warnings:
@@ -125,11 +125,11 @@ Warning 1266 Using storage engine MyISAM for table 't1'
drop table t1;
create table t1 (id int) type=heap;
Warnings:
-Warning 1287 'TYPE=storage_engine' is deprecated, use 'ENGINE=storage_engine' instead
+Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
alter table t1 type=myisam;
Warnings:
-Warning 1287 'TYPE=storage_engine' is deprecated, use 'ENGINE=storage_engine' instead
+Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
drop table t1;
set table_type=MYISAM;
Warnings:
-Warning 1287 'table_type' is deprecated, use 'storage_engine' instead
+Warning 1287 'table_type' is deprecated; use 'storage_engine' instead