summaryrefslogtreecommitdiff
path: root/mysql-test/suite/pbxt/t
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/pbxt/t')
-rw-r--r--mysql-test/suite/pbxt/t/alias.test91
-rw-r--r--mysql-test/suite/pbxt/t/alter_table.test757
-rw-r--r--mysql-test/suite/pbxt/t/analyze.test78
-rw-r--r--mysql-test/suite/pbxt/t/ansi.test44
-rw-r--r--mysql-test/suite/pbxt/t/auto_increment.test321
-rw-r--r--mysql-test/suite/pbxt/t/bench_count_distinct.test25
-rw-r--r--mysql-test/suite/pbxt/t/bigint.test293
-rw-r--r--mysql-test/suite/pbxt/t/binary.test107
-rw-r--r--mysql-test/suite/pbxt/t/bool.test65
-rw-r--r--mysql-test/suite/pbxt/t/bulk_replace.test17
-rw-r--r--mysql-test/suite/pbxt/t/case.test159
-rw-r--r--mysql-test/suite/pbxt/t/cast.test225
-rw-r--r--mysql-test/suite/pbxt/t/check.test44
-rw-r--r--mysql-test/suite/pbxt/t/client_xml.test25
-rw-r--r--mysql-test/suite/pbxt/t/comments.test21
-rw-r--r--mysql-test/suite/pbxt/t/compare.test52
-rw-r--r--mysql-test/suite/pbxt/t/connect.test108
-rw-r--r--mysql-test/suite/pbxt/t/consistent_snapshot.test53
-rw-r--r--mysql-test/suite/pbxt/t/constraints.test34
-rw-r--r--mysql-test/suite/pbxt/t/contributors.test1
-rw-r--r--mysql-test/suite/pbxt/t/count_distinct.test82
-rw-r--r--mysql-test/suite/pbxt/t/count_distinct2.test89
-rw-r--r--mysql-test/suite/pbxt/t/count_distinct3.test65
-rw-r--r--mysql-test/suite/pbxt/t/create.test1305
-rw-r--r--mysql-test/suite/pbxt/t/date_formats.test347
-rw-r--r--mysql-test/suite/pbxt/t/default.test145
-rw-r--r--mysql-test/suite/pbxt/t/delete.test201
-rw-r--r--mysql-test/suite/pbxt/t/derived.test294
-rw-r--r--mysql-test/suite/pbxt/t/dirty_close.test19
-rw-r--r--mysql-test/suite/pbxt/t/distinct.test537
-rw-r--r--mysql-test/suite/pbxt/t/drop.test130
-rw-r--r--mysql-test/suite/pbxt/t/empty_table.test18
-rw-r--r--mysql-test/suite/pbxt/t/endspace.test106
-rw-r--r--mysql-test/suite/pbxt/t/errors.test47
-rw-r--r--mysql-test/suite/pbxt/t/explain.test57
-rw-r--r--mysql-test/suite/pbxt/t/flush.test142
-rw-r--r--mysql-test/suite/pbxt/t/flush_read_lock_kill.test54
-rw-r--r--mysql-test/suite/pbxt/t/flush_table.test132
-rw-r--r--mysql-test/suite/pbxt/t/foreign_key.test33
-rw-r--r--mysql-test/suite/pbxt/t/func_concat.test74
-rw-r--r--mysql-test/suite/pbxt/t/func_crypt.test61
-rw-r--r--mysql-test/suite/pbxt/t/func_date_add.test83
-rw-r--r--mysql-test/suite/pbxt/t/func_default.test34
-rw-r--r--mysql-test/suite/pbxt/t/func_equal.test49
-rw-r--r--mysql-test/suite/pbxt/t/func_gconcat.test506
-rw-r--r--mysql-test/suite/pbxt/t/func_group.test834
-rw-r--r--mysql-test/suite/pbxt/t/func_if.test103
-rw-r--r--mysql-test/suite/pbxt/t/func_in.test307
-rw-r--r--mysql-test/suite/pbxt/t/func_isnull.test18
-rw-r--r--mysql-test/suite/pbxt/t/func_like.test119
-rw-r--r--mysql-test/suite/pbxt/t/func_math.test202
-rw-r--r--mysql-test/suite/pbxt/t/func_misc.test138
-rw-r--r--mysql-test/suite/pbxt/t/func_op.test40
-rw-r--r--mysql-test/suite/pbxt/t/func_regexp.test80
-rw-r--r--mysql-test/suite/pbxt/t/func_sapdb.test137
-rw-r--r--mysql-test/suite/pbxt/t/func_set.test60
-rw-r--r--mysql-test/suite/pbxt/t/func_str.test1113
-rw-r--r--mysql-test/suite/pbxt/t/func_system.test60
-rw-r--r--mysql-test/suite/pbxt/t/func_timestamp.test27
-rw-r--r--mysql-test/suite/pbxt/t/gcc296.test22
-rw-r--r--mysql-test/suite/pbxt/t/grant.test947
-rw-r--r--mysql-test/suite/pbxt/t/grant_cache.test173
-rw-r--r--mysql-test/suite/pbxt/t/greedy_optimizer.test322
-rw-r--r--mysql-test/suite/pbxt/t/group_by.test787
-rw-r--r--mysql-test/suite/pbxt/t/group_min_max.test948
-rw-r--r--mysql-test/suite/pbxt/t/having.test412
-rw-r--r--mysql-test/suite/pbxt/t/heap.test.THIS476
-rw-r--r--mysql-test/suite/pbxt/t/heap_auto_increment.test35
-rw-r--r--mysql-test/suite/pbxt/t/heap_btree.test207
-rw-r--r--mysql-test/suite/pbxt/t/heap_hash.test266
-rw-r--r--mysql-test/suite/pbxt/t/help.test141
-rw-r--r--mysql-test/suite/pbxt/t/insert.test241
-rw-r--r--mysql-test/suite/pbxt/t/insert_select.test272
-rw-r--r--mysql-test/suite/pbxt/t/insert_update.test147
-rw-r--r--mysql-test/suite/pbxt/t/join.test659
-rw-r--r--mysql-test/suite/pbxt/t/join_crash.test121
-rw-r--r--mysql-test/suite/pbxt/t/join_nested.test1074
-rw-r--r--mysql-test/suite/pbxt/t/join_outer.test819
-rw-r--r--mysql-test/suite/pbxt/t/key.test447
-rw-r--r--mysql-test/suite/pbxt/t/key_diff.test35
-rw-r--r--mysql-test/suite/pbxt/t/key_primary.test23
-rw-r--r--mysql-test/suite/pbxt/t/keywords.test48
-rw-r--r--mysql-test/suite/pbxt/t/limit.test76
-rw-r--r--mysql-test/suite/pbxt/t/lock.test120
-rw-r--r--mysql-test/suite/pbxt/t/lock_multi.test563
-rw-r--r--mysql-test/suite/pbxt/t/lock_tables_lost_commit.test24
-rw-r--r--mysql-test/suite/pbxt/t/lowercase_table2.test156
-rw-r--r--mysql-test/suite/pbxt/t/lowercase_table_grant-master.opt1
-rw-r--r--mysql-test/suite/pbxt/t/lowercase_table_grant.test30
-rw-r--r--mysql-test/suite/pbxt/t/lowercase_table_qcache-master.opt1
-rw-r--r--mysql-test/suite/pbxt/t/lowercase_table_qcache.test34
-rw-r--r--mysql-test/suite/pbxt/t/lowercase_view-master.opt1
-rw-r--r--mysql-test/suite/pbxt/t/lowercase_view.test166
-rw-r--r--mysql-test/suite/pbxt/t/metadata.test86
-rw-r--r--mysql-test/suite/pbxt/t/multi_statement-master.opt3
-rw-r--r--mysql-test/suite/pbxt/t/multi_statement.test40
-rw-r--r--mysql-test/suite/pbxt/t/multi_update.test584
-rw-r--r--mysql-test/suite/pbxt/t/mysql_protocols.test15
-rw-r--r--mysql-test/suite/pbxt/t/mysqlshow.test42
-rw-r--r--mysql-test/suite/pbxt/t/mysqlslap.test44
-rw-r--r--mysql-test/suite/pbxt/t/negation_elimination.test78
-rw-r--r--mysql-test/suite/pbxt/t/null.test239
-rw-r--r--mysql-test/suite/pbxt/t/null_key.test245
-rw-r--r--mysql-test/suite/pbxt/t/odbc.test39
-rw-r--r--mysql-test/suite/pbxt/t/olap.test333
-rw-r--r--mysql-test/suite/pbxt/t/order_by.test646
-rw-r--r--mysql-test/suite/pbxt/t/order_fill_sortbuf.test29
-rw-r--r--mysql-test/suite/pbxt/t/overflow.test6
-rw-r--r--mysql-test/suite/pbxt/t/partition_charset.test25
-rw-r--r--mysql-test/suite/pbxt/t/partition_error.test801
-rw-r--r--mysql-test/suite/pbxt/t/partition_grant.test62
-rw-r--r--mysql-test/suite/pbxt/t/partition_hash.test149
-rw-r--r--mysql-test/suite/pbxt/t/partition_list.test185
-rw-r--r--mysql-test/suite/pbxt/t/partition_order.test848
-rw-r--r--mysql-test/suite/pbxt/t/partition_pruning.test762
-rw-r--r--mysql-test/suite/pbxt/t/partition_range.test763
-rw-r--r--mysql-test/suite/pbxt/t/pbxt_assertions.test31
-rw-r--r--mysql-test/suite/pbxt/t/pbxt_bugs.test985
-rw-r--r--mysql-test/suite/pbxt/t/pbxt_locking.test128
-rw-r--r--mysql-test/suite/pbxt/t/pbxt_my_fail2.test74
-rw-r--r--mysql-test/suite/pbxt/t/pbxt_ref_int.test391
-rw-r--r--mysql-test/suite/pbxt/t/pbxt_transactions.test540
-rw-r--r--mysql-test/suite/pbxt/t/pbxt_updates.test111
-rw-r--r--mysql-test/suite/pbxt/t/pbxt_xa.test23
-rw-r--r--mysql-test/suite/pbxt/t/pbxt_xa_binlog.test32
-rw-r--r--mysql-test/suite/pbxt/t/perror.test19
-rw-r--r--mysql-test/suite/pbxt/t/preload.test105
-rw-r--r--mysql-test/suite/pbxt/t/ps_10nestset.test76
-rw-r--r--mysql-test/suite/pbxt/t/ps_11bugs.test183
-rw-r--r--mysql-test/suite/pbxt/t/ps_1general.test931
-rw-r--r--mysql-test/suite/pbxt/t/ps_grant.test130
-rw-r--r--mysql-test/suite/pbxt/t/range.test778
-rw-r--r--mysql-test/suite/pbxt/t/read_only.test231
-rw-r--r--mysql-test/suite/pbxt/t/rename.test97
-rw-r--r--mysql-test/suite/pbxt/t/renamedb.test53
-rw-r--r--mysql-test/suite/pbxt/t/replace.test51
-rw-r--r--mysql-test/suite/pbxt/t/rollback.test25
-rw-r--r--mysql-test/suite/pbxt/t/schema.test21
-rw-r--r--mysql-test/suite/pbxt/t/select.test3146
-rw-r--r--mysql-test/suite/pbxt/t/select_found.test198
-rw-r--r--mysql-test/suite/pbxt/t/select_safe.test99
-rw-r--r--mysql-test/suite/pbxt/t/skip_grants.test114
-rw-r--r--mysql-test/suite/pbxt/t/skip_name_resolve.test20
-rw-r--r--mysql-test/suite/pbxt/t/sql_mode.test273
-rw-r--r--mysql-test/suite/pbxt/t/status.test190
-rw-r--r--mysql-test/suite/pbxt/t/subselect.test3241
-rw-r--r--mysql-test/suite/pbxt/t/sum_distinct.test99
-rw-r--r--mysql-test/suite/pbxt/t/temp_table.test183
-rw-r--r--mysql-test/suite/pbxt/t/truncate.test57
-rw-r--r--mysql-test/suite/pbxt/t/type_binary.test105
-rw-r--r--mysql-test/suite/pbxt/t/type_bit.test278
-rw-r--r--mysql-test/suite/pbxt/t/type_date.test128
-rw-r--r--mysql-test/suite/pbxt/t/type_datetime.test140
-rw-r--r--mysql-test/suite/pbxt/t/type_decimal.test400
-rw-r--r--mysql-test/suite/pbxt/t/type_enum.test172
-rw-r--r--mysql-test/suite/pbxt/t/type_float.test203
-rw-r--r--mysql-test/suite/pbxt/t/type_nchar.test39
-rw-r--r--mysql-test/suite/pbxt/t/type_newdecimal.test1149
-rw-r--r--mysql-test/suite/pbxt/t/type_ranges.test179
-rw-r--r--mysql-test/suite/pbxt/t/type_set.test44
-rw-r--r--mysql-test/suite/pbxt/t/type_time.test45
-rw-r--r--mysql-test/suite/pbxt/t/type_timestamp.test334
-rw-r--r--mysql-test/suite/pbxt/t/type_uint.test20
-rw-r--r--mysql-test/suite/pbxt/t/type_year.test27
-rw-r--r--mysql-test/suite/pbxt/t/udf.test444
-rw-r--r--mysql-test/suite/pbxt/t/union.test923
-rw-r--r--mysql-test/suite/pbxt/t/update.test314
-rw-r--r--mysql-test/suite/pbxt/t/user_var.test226
-rw-r--r--mysql-test/suite/pbxt/t/view_grant.test.THIS1228
-rw-r--r--mysql-test/suite/pbxt/t/view_query_cache.test134
-rw-r--r--mysql-test/suite/pbxt/t/xml.test408
171 files changed, 0 insertions, 45761 deletions
diff --git a/mysql-test/suite/pbxt/t/alias.test b/mysql-test/suite/pbxt/t/alias.test
deleted file mode 100644
index 74894a3721a..00000000000
--- a/mysql-test/suite/pbxt/t/alias.test
+++ /dev/null
@@ -1,91 +0,0 @@
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-CREATE TABLE t1 (
- cont_nr int(11) NOT NULL auto_increment,
- ver_nr int(11) NOT NULL default '0',
- aufnr int(11) NOT NULL default '0',
- username varchar(50) NOT NULL default '',
- hdl_nr int(11) NOT NULL default '0',
- eintrag date NOT NULL default '0000-00-00',
- st_klasse varchar(40) NOT NULL default '',
- st_wert varchar(40) NOT NULL default '',
- st_zusatz varchar(40) NOT NULL default '',
- st_bemerkung varchar(255) NOT NULL default '',
- kunden_art varchar(40) NOT NULL default '',
- mcbs_knr int(11) default NULL,
- mcbs_aufnr int(11) NOT NULL default '0',
- schufa_status char(1) default '?',
- bemerkung text,
- wirknetz text,
- wf_igz int(11) NOT NULL default '0',
- tarifcode varchar(80) default NULL,
- recycle char(1) default NULL,
- sim varchar(30) default NULL,
- mcbs_tpl varchar(30) default NULL,
- emp_nr int(11) NOT NULL default '0',
- laufzeit int(11) default NULL,
- hdl_name varchar(30) default NULL,
- prov_hdl_nr int(11) NOT NULL default '0',
- auto_wirknetz varchar(50) default NULL,
- auto_billing varchar(50) default NULL,
- touch timestamp NOT NULL,
- kategorie varchar(50) default NULL,
- kundentyp varchar(20) NOT NULL default '',
- sammel_rech_msisdn varchar(30) NOT NULL default '',
- p_nr varchar(9) NOT NULL default '',
- suffix char(3) NOT NULL default '',
- PRIMARY KEY (cont_nr),
- KEY idx_aufnr(aufnr),
- KEY idx_hdl_nr(hdl_nr),
- KEY idx_st_klasse(st_klasse),
- KEY ver_nr(ver_nr),
- KEY eintrag_idx(eintrag),
- KEY emp_nr_idx(emp_nr),
- KEY wf_igz(wf_igz),
- KEY touch(touch),
- KEY hdl_tag(eintrag,hdl_nr),
- KEY prov_hdl_nr(prov_hdl_nr),
- KEY mcbs_aufnr(mcbs_aufnr),
- KEY kundentyp(kundentyp),
- KEY p_nr(p_nr,suffix)
-) ENGINE=MyISAM;
-
-INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
-INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
-INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
-INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
-INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007');
-INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. mchte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
-INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
-
-# This died because we used the field Kundentyp twice
-SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie;
-
-drop table t1;
-
-#
-# test case for #570
-#
-
-CREATE TABLE t1 (
- AUFNR varchar(12) NOT NULL default '',
- PLNFL varchar(6) NOT NULL default '',
- VORNR varchar(4) NOT NULL default '',
- xstatus_vor smallint(5) unsigned NOT NULL default '0'
-);
-
-INSERT INTO t1 VALUES ('40004712','000001','0010',9);
-INSERT INTO t1 VALUES ('40004712','000001','0020',0);
-
-UPDATE t1 SET t1.xstatus_vor = Greatest(t1.xstatus_vor,1) WHERE t1.aufnr =
-"40004712" AND t1.plnfl = "000001" AND t1.vornr > "0010" ORDER BY t1.vornr
-ASC LIMIT 1;
-
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/alter_table.test b/mysql-test/suite/pbxt/t/alter_table.test
deleted file mode 100644
index 4c328077961..00000000000
--- a/mysql-test/suite/pbxt/t/alter_table.test
+++ /dev/null
@@ -1,757 +0,0 @@
-#
-# Test of alter table
-#
---disable_warnings
-drop table if exists t1,t2;
-drop database if exists mysqltest;
---enable_warnings
-
-create table t1 (
-col1 int not null auto_increment primary key,
-col2 varchar(30) not null,
-col3 varchar (20) not null,
-col4 varchar(4) not null,
-col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
-col6 int not null, to_be_deleted int);
-insert into t1 values (2,4,3,5,"PENDING",1,7);
-alter table t1
-add column col4_5 varchar(20) not null after col4,
-add column col7 varchar(30) not null after col5,
-add column col8 datetime not null, drop column to_be_deleted,
-change column col2 fourth varchar(30) not null after col3,
-modify column col6 int not null first;
-select * from t1;
-drop table t1;
-
-create table t1 (bandID MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY, payoutID SMALLINT UNSIGNED NOT NULL);
-insert into t1 (bandID,payoutID) VALUES (1,6),(2,6),(3,4),(4,9),(5,10),(6,1),(7,12),(8,12);
-alter table t1 add column new_col int, order by payoutid,bandid;
-select * from t1;
-alter table t1 order by bandid,payoutid;
-select * from t1;
-drop table t1;
-
-# Check that pack_keys and dynamic length rows are not forced.
-
-CREATE TABLE t1 (
-GROUP_ID int(10) unsigned DEFAULT '0' NOT NULL,
-LANG_ID smallint(5) unsigned DEFAULT '0' NOT NULL,
-NAME varchar(80) DEFAULT '' NOT NULL,
-PRIMARY KEY (GROUP_ID,LANG_ID),
-KEY NAME (NAME));
-#show table status like "t1";
-ALTER TABLE t1 CHANGE NAME NAME CHAR(80) not null;
---replace_column 8 #
-SHOW FULL COLUMNS FROM t1;
-DROP TABLE t1;
-
-#
-# Test of ALTER TABLE ... ORDER BY
-#
-
-create table t1 (n int);
-insert into t1 values(9),(3),(12),(10);
-alter table t1 order by n;
-select * from t1;
-drop table t1;
-
-CREATE TABLE t1 (
- id int(11) unsigned NOT NULL default '0',
- category_id tinyint(4) unsigned NOT NULL default '0',
- type_id tinyint(4) unsigned NOT NULL default '0',
- body text NOT NULL,
- user_id int(11) unsigned NOT NULL default '0',
- status enum('new','old') NOT NULL default 'new',
- PRIMARY KEY (id)
-) ENGINE=MyISAM;
-
-ALTER TABLE t1 ORDER BY t1.id, t1.status, t1.type_id, t1.user_id, t1.body;
-DROP TABLE t1;
-
-#
-# The following combination found a hang-bug in MyISAM
-#
-
-CREATE TABLE t1 (AnamneseId int(10) unsigned NOT NULL auto_increment,B BLOB,PRIMARY KEY (AnamneseId)) engine=myisam;
-insert into t1 values (null,"hello");
-LOCK TABLES t1 WRITE;
-ALTER TABLE t1 ADD Column new_col int not null;
-UNLOCK TABLES;
-OPTIMIZE TABLE t1;
-DROP TABLE t1;
-
-#
-# Drop and add an auto_increment column
-#
-
-create table t1 (i int unsigned not null auto_increment primary key);
-insert into t1 values (null),(null),(null),(null);
-alter table t1 drop i,add i int unsigned not null auto_increment, drop primary key, add primary key (i);
-select * from t1;
-drop table t1;
-
-#
-# Bug #2628: 'alter table t1 rename mysqltest.t1' silently drops mysqltest.t1
-# if it exists
-#
-create table t1 (name char(15));
-insert into t1 (name) values ("current");
-create database mysqltest;
-create table mysqltest.t1 (name char(15));
-insert into mysqltest.t1 (name) values ("mysqltest");
-select * from t1;
-select * from mysqltest.t1;
---error ER_TABLE_EXISTS_ERROR
-alter table t1 rename mysqltest.t1;
-select * from t1;
-select * from mysqltest.t1;
-drop table t1;
-drop database mysqltest;
-
-#
-# ALTER TABLE ... ENABLE/DISABLE KEYS
-
-create table t1 (n1 int not null, n2 int, n3 int, n4 float,
- unique(n1),
- key (n1, n2, n3, n4),
- key (n2, n3, n4, n1),
- key (n3, n4, n1, n2),
- key (n4, n1, n2, n3) );
---disable_warnings # PBXT: disable keys not supported
-alter table t1 disable keys;
---enable_warnings # PBXT: disable keys not supported
-show keys from t1;
-#let $1=10000;
-let $1=10;
-while ($1)
-{
- eval insert into t1 values($1,RAND()*1000,RAND()*1000,RAND());
- dec $1;
-}
---disable_warnings # PBXT: disable keys not supported
-alter table t1 enable keys;
---enable_warnings # PBXT: disable keys not supported
-show keys from t1;
-drop table t1;
-
-#
-# Alter table and rename
-#
-
-create table t1 (i int unsigned not null auto_increment primary key);
-alter table t1 rename t2;
-alter table t2 rename t1, add c char(10) comment "no comment";
-show columns from t1;
-drop table t1;
-
-# implicit analyze
-
-create table t1 (a int, b int);
-let $1=100;
-while ($1)
-{
- eval insert into t1 values(1,$1), (2,$1), (3, $1);
- dec $1;
-}
-alter table t1 add unique (a,b), add key (b);
-show keys from t1;
-analyze table t1;
-show keys from t1;
-drop table t1;
-
-#
-# Test of ALTER TABLE DELAYED
-#
-
-CREATE TABLE t1 (i int(10), index(i) );
---disable_warnings # PBXT: disable keys not supported
-ALTER TABLE t1 DISABLE KEYS;
---enable_warnings # PBXT: disable keys not supported
-# PBXT: DELAYED not supported
-#INSERT DELAYED INTO t1 VALUES(1),(2),(3);
-INSERT INTO t1 VALUES(1),(2),(3);
---disable_warnings # PBXT: disable keys not supported
-ALTER TABLE t1 ENABLE KEYS;
---enable_warnings # PBXT: disable keys not supported
-drop table t1;
-
-#
-# Test ALTER TABLE ENABLE/DISABLE keys when things are locked
-#
-
-CREATE TABLE t1 (
- Host varchar(16) binary NOT NULL default '',
- User varchar(16) binary NOT NULL default '',
- PRIMARY KEY (Host,User)
-) ENGINE=MyISAM;
-
---disable_warnings # PBXT: disable keys not supported
-ALTER TABLE t1 DISABLE KEYS;
---enable_warnings # PBXT: disable keys not supported
-LOCK TABLES t1 WRITE;
-INSERT INTO t1 VALUES ('localhost','root'),('localhost',''),('games','monty');
-SHOW INDEX FROM t1;
---disable_warnings # PBXT: disable keys not supported
-ALTER TABLE t1 ENABLE KEYS;
---enable_warnings # PBXT: disable keys not supported
-UNLOCK TABLES;
-CHECK TABLES t1;
-DROP TABLE t1;
-
-#
-# Test with two keys
-#
-
-CREATE TABLE t1 (
- Host varchar(16) binary NOT NULL default '',
- User varchar(16) binary NOT NULL default '',
- PRIMARY KEY (Host,User),
- KEY (Host)
-) ENGINE=MyISAM;
-
---disable_warnings # PBXT: disable keys not supported
-ALTER TABLE t1 DISABLE KEYS;
---enable_warnings # PBXT: disable keys not supported
-SHOW INDEX FROM t1;
-LOCK TABLES t1 WRITE;
-INSERT INTO t1 VALUES ('localhost','root'),('localhost','');
-SHOW INDEX FROM t1;
---disable_warnings # PBXT: disable keys not supported
-ALTER TABLE t1 ENABLE KEYS;
---enable_warnings # PBXT: disable keys not supported
-SHOW INDEX FROM t1;
-UNLOCK TABLES;
-CHECK TABLES t1;
-
-# Test RENAME with LOCK TABLES
-LOCK TABLES t1 WRITE;
-ALTER TABLE t1 RENAME t2;
-UNLOCK TABLES;
-select * from t2;
-DROP TABLE t2;
-
-#
-# Test disable keys with locking
-#
-CREATE TABLE t1 (
- Host varchar(16) binary NOT NULL default '',
- User varchar(16) binary NOT NULL default '',
- PRIMARY KEY (Host,User),
- KEY (Host)
-) ENGINE=MyISAM;
-
-LOCK TABLES t1 WRITE;
---disable_warnings # PBXT: disable keys not supported
-ALTER TABLE t1 DISABLE KEYS;
---enable_warnings # PBXT: disable keys not supported
-SHOW INDEX FROM t1;
-DROP TABLE t1;
-
-#
-# BUG#4717 - check for valid table names
-#
-create table t1 (a int);
---error ER_WRONG_TABLE_NAME
-alter table t1 rename to ``;
---error ER_WRONG_TABLE_NAME
-rename table t1 to ``;
-drop table t1;
-
-#
-# BUG#6236 - ALTER TABLE MODIFY should set implicit NOT NULL on PK columns
-#
-drop table if exists t1, t2;
-create table t1 ( a varchar(10) not null primary key ) engine=myisam;
-create table t2 ( a varchar(10) not null primary key ) engine=merge union=(t1);
-flush tables;
-alter table t1 modify a varchar(10);
-show create table t2;
-flush tables;
-alter table t1 modify a varchar(10) not null;
-show create table t2;
-drop table if exists t1, t2;
-
-# The following is also part of bug #6236 (CREATE TABLE didn't properly count
-# not null columns for primary keys)
-
-create table t1 (a int, b int, c int, d int, e int, f int, g int, h int,i int, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM;
-insert into t1 (a) values(1);
---replace_column 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X
-show table status like 't1';
-alter table t1 modify a int;
---replace_column 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X
-show table status like 't1';
-drop table t1;
-create table t1 (a int not null, b int not null, c int not null, d int not null, e int not null, f int not null, g int not null, h int not null,i int not null, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM;
-insert into t1 (a) values(1);
---replace_column 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X
-show table status like 't1';
-drop table t1;
-
-#
-# Test that data get converted when character set is changed
-# Test that data doesn't get converted when src or dst is BINARY/BLOB
-#
-set names koi8r;
-create table t1 (a char(10) character set koi8r);
-insert into t1 values ('');
-select a,hex(a) from t1;
-alter table t1 change a a char(10) character set cp1251;
-select a,hex(a) from t1;
-alter table t1 change a a binary(4);
-select a,hex(a) from t1;
-alter table t1 change a a char(10) character set cp1251;
-select a,hex(a) from t1;
-alter table t1 change a a char(10) character set koi8r;
-select a,hex(a) from t1;
-alter table t1 change a a varchar(10) character set cp1251;
-select a,hex(a) from t1;
-alter table t1 change a a char(10) character set koi8r;
-select a,hex(a) from t1;
-alter table t1 change a a text character set cp1251;
-select a,hex(a) from t1;
-alter table t1 change a a char(10) character set koi8r;
-select a,hex(a) from t1;
-delete from t1;
-
-#
-# Test ALTER TABLE .. CHARACTER SET ..
-#
-show create table t1;
-alter table t1 DEFAULT CHARACTER SET latin1;
-show create table t1;
-alter table t1 CONVERT TO CHARACTER SET latin1;
-show create table t1;
-alter table t1 DEFAULT CHARACTER SET cp1251;
-show create table t1;
-
-drop table t1;
-
-#
-# Bug#2821
-# Test that table CHARACTER SET does not affect blobs
-#
-create table t1 (myblob longblob,mytext longtext)
-default charset latin1 collate latin1_general_cs;
-show create table t1;
-alter table t1 character set latin2;
-show create table t1;
-drop table t1;
-
-#
-# Bug 2361 (Don't drop UNIQUE with DROP PRIMARY KEY)
-#
-
-CREATE TABLE t1 (a int PRIMARY KEY, b INT UNIQUE);
-ALTER TABLE t1 DROP PRIMARY KEY;
-SHOW CREATE TABLE t1;
---error ER_CANT_DROP_FIELD_OR_KEY
-ALTER TABLE t1 DROP PRIMARY KEY;
-DROP TABLE t1;
-
-# BUG#3899
-create table t1 (a int, b int, key(a));
-insert into t1 values (1,1), (2,2);
---error ER_CANT_DROP_FIELD_OR_KEY
-alter table t1 drop key no_such_key;
-alter table t1 drop key a;
-drop table t1;
-
-#
-# BUG 12207 alter table ... discard table space on MyISAM table causes ERROR 2013 (HY000)
-#
-# Some platforms (Mac OS X, Windows) will send the error message using small letters.
-CREATE TABLE T12207(a int) ENGINE=MYISAM;
---replace_result t12207 T12207
---error ER_ILLEGAL_HA
-ALTER TABLE T12207 DISCARD TABLESPACE;
-DROP TABLE T12207;
-
-#
-# Bug #6479 ALTER TABLE ... changing charset fails for TEXT columns
-#
-# The column's character set was changed but the actual data was not
-# modified. In other words, the values were reinterpreted
-# as UTF8 instead of being converted.
-create table t1 (a text) character set koi8r;
-insert into t1 values (_koi8r'');
-select hex(a) from t1;
-alter table t1 convert to character set cp1251;
-select hex(a) from t1;
-drop table t1;
-
-#
-# Test for bug #7884 "Able to add invalid unique index on TIMESTAMP prefix"
-# MySQL should not think that packed field with non-zero decimals is
-# geometry field and allow to create prefix index which is
-# shorter than packed field length.
-#
-create table t1 ( a timestamp );
---error ER_WRONG_SUB_KEY
-alter table t1 add unique ( a(1) );
-drop table t1;
-
-#
-# Bug #24395: ALTER TABLE DISABLE KEYS doesn't work when modifying the table
-#
-# This problem happens if the data change is compatible.
-# Changing to the same type is compatible for example.
-#
---disable_warnings
-drop table if exists t1;
---enable_warnings
-create table t1 (a int, key(a));
-show indexes from t1;
---echo "this used not to disable the index"
---disable_warnings # PBXT: disable keys not supported
-alter table t1 modify a int, disable keys;
---enable_warnings # PBXT: disable keys not supported
-show indexes from t1;
-
---disable_warnings # PBXT: disable keys not supported
-alter table t1 enable keys;
---enable_warnings # PBXT: disable keys not supported
-show indexes from t1;
-
---disable_warnings # PBXT: disable keys not supported
-alter table t1 modify a bigint, disable keys;
---enable_warnings # PBXT: disable keys not supported
-show indexes from t1;
-
---disable_warnings # PBXT: disable keys not supported
-alter table t1 enable keys;
---enable_warnings # PBXT: disable keys not supported
-show indexes from t1;
-
---disable_warnings # PBXT: disable keys not supported
-alter table t1 add b char(10), disable keys;
---enable_warnings # PBXT: disable keys not supported
-show indexes from t1;
-
---disable_warnings # PBXT: disable keys not supported
-alter table t1 add c decimal(10,2), enable keys;
---enable_warnings # PBXT: disable keys not supported
-show indexes from t1;
-
---echo "this however did"
---disable_warnings # PBXT: disable keys not supported
-alter table t1 disable keys;
---enable_warnings # PBXT: disable keys not supported
-show indexes from t1;
-
-desc t1;
-
-alter table t1 add d decimal(15,5);
---echo "The key should still be disabled"
-show indexes from t1;
-
-drop table t1;
-
---echo "Now will test with one unique index"
-create table t1(a int, b char(10), unique(a));
-show indexes from t1;
---disable_warnings # PBXT: disable keys not supported
-alter table t1 disable keys;
---enable_warnings # PBXT: disable keys not supported
-show indexes from t1;
---disable_warnings # PBXT: disable keys not supported
-alter table t1 enable keys;
---enable_warnings # PBXT: disable keys not supported
-
---echo "If no copy on noop change, this won't touch the data file"
---echo "Unique index, no change"
---disable_warnings # PBXT: disable keys not supported
-alter table t1 modify a int, disable keys;
---enable_warnings # PBXT: disable keys not supported
-show indexes from t1;
-
---echo "Change the type implying data copy"
---echo "Unique index, no change"
---disable_warnings # PBXT: disable keys not supported
-alter table t1 modify a bigint, disable keys;
---enable_warnings # PBXT: disable keys not supported
-show indexes from t1;
-
-alter table t1 modify a bigint;
-show indexes from t1;
-
-alter table t1 modify a int;
-show indexes from t1;
-
-drop table t1;
-
---echo "Now will test with one unique and one non-unique index"
-create table t1(a int, b char(10), unique(a), key(b));
-show indexes from t1;
---disable_warnings # PBXT: disable keys not supported
-alter table t1 disable keys;
---enable_warnings # PBXT: disable keys not supported
-show indexes from t1;
---disable_warnings # PBXT: disable keys not supported
-alter table t1 enable keys;
---enable_warnings # PBXT: disable keys not supported
-
-
---echo "If no copy on noop change, this won't touch the data file"
---echo "The non-unique index will be disabled"
---disable_warnings # PBXT: disable keys not supported
-alter table t1 modify a int, disable keys;
---enable_warnings # PBXT: disable keys not supported
-show indexes from t1;
---disable_warnings # PBXT: disable keys not supported
-alter table t1 enable keys;
---enable_warnings # PBXT: disable keys not supported
-show indexes from t1;
-
---echo "Change the type implying data copy"
---echo "The non-unique index will be disabled"
---disable_warnings # PBXT: disable keys not supported
-alter table t1 modify a bigint, disable keys;
---enable_warnings # PBXT: disable keys not supported
-show indexes from t1;
-
---echo "Change again the type, but leave the indexes as_is"
-alter table t1 modify a int;
-show indexes from t1;
---echo "Try the same. When data is no copied on similar tables, this is noop"
-alter table t1 modify a int;
-show indexes from t1;
-
-drop table t1;
-
-
-#
-# Bug#11493 - Alter table rename to default database does not work without
-# db name qualifying
-#
-create database mysqltest;
-create table t1 (c1 int);
-# Move table to other database.
-alter table t1 rename mysqltest.t1;
-# Assure that it has moved.
---error ER_BAD_TABLE_ERROR
-drop table t1;
-# Move table back.
-alter table mysqltest.t1 rename t1;
-# Assure that it is back.
-drop table t1;
-# Now test for correct message if no database is selected.
-# Create t1 in 'test'.
-create table t1 (c1 int);
-# Change to other db.
-use mysqltest;
-# Drop the current db. This de-selects any db.
-drop database mysqltest;
-# Now test for correct message.
---error ER_NO_DB_ERROR
-alter table test.t1 rename t1;
-# Check that explicit qualifying works even with no selected db.
-alter table test.t1 rename test.t1;
-# Go back to standard 'test' db.
-use test;
-drop table t1;
-
-#
-# BUG#23404 - ROW_FORMAT=FIXED option is lost is an index is added to the
-# table
-#
-CREATE TABLE t1(a INT) ROW_FORMAT=FIXED;
-CREATE INDEX i1 ON t1(a);
-SHOW CREATE TABLE t1;
-DROP INDEX i1 ON t1;
-SHOW CREATE TABLE t1;
-DROP TABLE t1;
-
-#
-# Bug#24219 - ALTER TABLE ... RENAME TO ... , DISABLE KEYS leads to crash
-#
---disable_warnings
-DROP TABLE IF EXISTS bug24219;
-DROP TABLE IF EXISTS bug24219_2;
---enable_warnings
-
-CREATE TABLE bug24219 (a INT, INDEX(a));
-
-SHOW INDEX FROM bug24219;
-
---disable_warnings # PBXT: disable keys not supported
-ALTER TABLE bug24219 RENAME TO bug24219_2, DISABLE KEYS;
---enable_warnings # PBXT: disable keys not supported
-
-SHOW INDEX FROM bug24219_2;
-
-DROP TABLE bug24219_2;
-
-# End of 4.1 tests
-
-#
-# Bug #14693 (ALTER SET DEFAULT doesn't work)
-#
-
-create table t1 (mycol int(10) not null);
-alter table t1 alter column mycol set default 0;
-desc t1;
-drop table t1;
-
-#
-# Some additional tests for new, faster alter table. Note that most of the
-# whole alter table code is being tested all around the test suite already.
-#
-
-create table t1 (v varchar(32));
-insert into t1 values ('def'),('abc'),('hij'),('3r4f');
-select * from t1;
-# Fast alter, no copy performed
-alter table t1 change v v2 varchar(32);
-select * from t1;
-# Fast alter, no copy performed
-alter table t1 change v2 v varchar(64);
-select * from t1;
-update t1 set v = 'lmn' where v = 'hij';
-select * from t1;
-# Regular alter table
-alter table t1 add i int auto_increment not null primary key first;
-select * from t1;
-update t1 set i=5 where i=3;
-select * from t1;
-alter table t1 change i i bigint;
-select * from t1;
-alter table t1 add unique key (i, v);
-select * from t1 where i between 2 and 4 and v in ('def','3r4f','lmn');
-drop table t1;
-
-#
-# Bug#6073 "ALTER table minor glich": ALTER TABLE complains that an index
-# without # prefix is not allowed for TEXT columns, while index
-# is defined with prefix.
-#
-create table t1 (t varchar(255) default null, key t (t(80)))
-engine=myisam default charset=latin1;
-alter table t1 change t t text;
-drop table t1;
-
-#
-# Bug#18038 MySQL server corrupts binary columns data
-#
-
-CREATE TABLE t1 (s CHAR(8) BINARY);
-INSERT INTO t1 VALUES ('test');
-SELECT LENGTH(s) FROM t1;
-ALTER TABLE t1 MODIFY s CHAR(10) BINARY;
-SELECT LENGTH(s) FROM t1;
-DROP TABLE t1;
-
-CREATE TABLE t1 (s BINARY(8));
-INSERT INTO t1 VALUES ('test');
-SELECT LENGTH(s) FROM t1;
-SELECT HEX(s) FROM t1;
-ALTER TABLE t1 MODIFY s BINARY(10);
-SELECT HEX(s) FROM t1;
-SELECT LENGTH(s) FROM t1;
-DROP TABLE t1;
-
-#
-# Bug#19386: Multiple alter causes crashed table
-# The trailing column would get corrupted data, or server could not even read
-# it.
-#
-
-CREATE TABLE t1 (v VARCHAR(3), b INT);
-INSERT INTO t1 VALUES ('abc', 5);
-SELECT * FROM t1;
-ALTER TABLE t1 MODIFY COLUMN v VARCHAR(4);
-SELECT * FROM t1;
-DROP TABLE t1;
-
-# End of 5.0 tests
-
-#
-# Bug#18775 - Temporary table from alter table visible to other threads
-#
-# Check if special characters work and duplicates are detected.
---disable_warnings
-DROP TABLE IF EXISTS `t+1`, `t+2`;
---enable_warnings
-CREATE TABLE `t+1` (c1 INT);
-ALTER TABLE `t+1` RENAME `t+2`;
-CREATE TABLE `t+1` (c1 INT);
---error ER_TABLE_EXISTS_ERROR
-ALTER TABLE `t+1` RENAME `t+2`;
-DROP TABLE `t+1`, `t+2`;
-#
-# Same for temporary tables though these names do not become file names.
-CREATE TEMPORARY TABLE `tt+1` (c1 INT);
-ALTER TABLE `tt+1` RENAME `tt+2`;
-CREATE TEMPORARY TABLE `tt+1` (c1 INT);
---error ER_TABLE_EXISTS_ERROR
-ALTER TABLE `tt+1` RENAME `tt+2`;
-SHOW CREATE TABLE `tt+1`;
-SHOW CREATE TABLE `tt+2`;
-DROP TABLE `tt+1`, `tt+2`;
-#
-# Check if special characters as in tmp_file_prefix work.
-CREATE TABLE `#sql1` (c1 INT);
-CREATE TABLE `@0023sql2` (c1 INT);
-SHOW TABLES;
-RENAME TABLE `#sql1` TO `@0023sql1`;
-RENAME TABLE `@0023sql2` TO `#sql2`;
-SHOW TABLES;
-ALTER TABLE `@0023sql1` RENAME `#sql-1`;
-ALTER TABLE `#sql2` RENAME `@0023sql-2`;
-SHOW TABLES;
-INSERT INTO `#sql-1` VALUES (1);
-INSERT INTO `@0023sql-2` VALUES (2);
-DROP TABLE `#sql-1`, `@0023sql-2`;
-#
-# Same for temporary tables though these names do not become file names.
-CREATE TEMPORARY TABLE `#sql1` (c1 INT);
-CREATE TEMPORARY TABLE `@0023sql2` (c1 INT);
-SHOW TABLES;
-ALTER TABLE `#sql1` RENAME `@0023sql1`;
-ALTER TABLE `@0023sql2` RENAME `#sql2`;
-SHOW TABLES;
-INSERT INTO `#sql2` VALUES (1);
-INSERT INTO `@0023sql1` VALUES (2);
-SHOW CREATE TABLE `#sql2`;
-SHOW CREATE TABLE `@0023sql1`;
-DROP TABLE `#sql2`, `@0023sql1`;
-
-#
-# Bug #22369: Alter table rename combined with other alterations causes lost tables
-#
-# This problem happens if the data change is compatible.
-# Changing to the same type is compatible for example.
-#
---disable_warnings
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t2;
---enable_warnings
-CREATE TABLE t1 (
- int_field INTEGER UNSIGNED NOT NULL,
- char_field CHAR(10),
- INDEX(`int_field`)
-);
-
-DESCRIBE t1;
-
-SHOW INDEXES FROM t1;
-
-INSERT INTO t1 VALUES (1, "edno"), (1, "edno"), (2, "dve"), (3, "tri"), (5, "pet");
---echo "Non-copy data change - new frm, but old data and index files"
-ALTER TABLE t1
- CHANGE int_field unsigned_int_field INTEGER UNSIGNED NOT NULL,
- RENAME t2;
-
---error ER_NO_SUCH_TABLE
-SELECT * FROM t1 ORDER BY int_field;
-SELECT * FROM t2 ORDER BY unsigned_int_field;
-DESCRIBE t2;
-DESCRIBE t2;
-ALTER TABLE t2 MODIFY unsigned_int_field BIGINT UNSIGNED NOT NULL;
-DESCRIBE t2;
-
-DROP TABLE t2;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/analyze.test b/mysql-test/suite/pbxt/t/analyze.test
deleted file mode 100644
index 1f3ba82dfd1..00000000000
--- a/mysql-test/suite/pbxt/t/analyze.test
+++ /dev/null
@@ -1,78 +0,0 @@
-#
-# Bug #10901 Analyze Table on new table destroys table
-# This is minimal test case to get error
-# The problem was that analyze table wrote the shared state to the
-# file and this didn't include the inserts while locked. A check was
-# needed to ensure that state information was not updated when
-# executing analyze table for a locked table. The analyze table had
-# to be within locks and check table had to be after unlocking since
-# then it brings the wrong state from disk rather than from the
-# currently correct internal state. The insert is needed since it
-# changes the file state, number of records. The fix is to
-# synchronise the state of the shared state and the current state
-# before calling mi_state_info_write
-#
-
-create table t1 (a bigint);
-lock tables t1 write;
-insert into t1 values(0);
-analyze table t1;
-unlock tables;
-check table t1;
-
-drop table t1;
-
-create table t1 (a bigint);
-insert into t1 values(0);
-lock tables t1 write;
-delete from t1;
-analyze table t1;
-unlock tables;
-check table t1;
-
-drop table t1;
-
-create table t1 (a bigint);
-insert into t1 values(0);
-analyze table t1;
-check table t1;
-
-drop table t1;
-
-# Bug #14902 ANALYZE TABLE fails to recognize up-to-date tables
-# minimal test case to get an error.
-# The problem is happening when analysing table with FT index that
-# contains stopwords only. The first execution of analyze table should
-# mark index statistics as up to date so that next execution of this
-# statement will end up with Table is up to date status.
-create table t1 (a mediumtext, fulltext key key1(a)) charset utf8 collate utf8_general_ci engine myisam;
-insert into t1 values ('hello');
-
-analyze table t1;
-analyze table t1;
-
-drop table t1;
-
-#
-# procedure in PS BUG#13673
-#
-CREATE TABLE t1 (a int);
-prepare stmt1 from "SELECT * FROM t1 PROCEDURE ANALYSE()";
-execute stmt1;
-execute stmt1;
-deallocate prepare stmt1;
-drop table t1;
-
-#
-# bug#15225 (ANALYZE temporary has no effect)
-#
-create temporary table t1(a int, index(a));
-insert into t1 values('1'),('2'),('3'),('4'),('5');
-analyze table t1;
-show index from t1;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/ansi.test b/mysql-test/suite/pbxt/t/ansi.test
deleted file mode 100644
index b4ecfeae722..00000000000
--- a/mysql-test/suite/pbxt/t/ansi.test
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# Test of ansi mode
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-set sql_mode="MySQL40";
-select @@sql_mode;
-set @@sql_mode="ANSI";
-select @@sql_mode;
-
-# Test some functions that works different in ansi mode
-
-SELECT 'A' || 'B';
-
-# Test GROUP BY behaviour
-
-CREATE TABLE t1 (id INT, id2 int);
-SELECT id,NULL,1,1.1,'a' FROM t1 GROUP BY id;
-#No --error 1055 error due to temporary fix for BUG#8510:
-#ONLY_FULL_GROUP_BY is overly restrictive, so remove it from ANSI mode.
-SELECT id FROM t1 GROUP BY id2;
-drop table t1;
-
-SET @@SQL_MODE="";
-
-# Bug#14515
-
-CREATE TABLE t1 (i int auto_increment NOT NULL, PRIMARY KEY (i));
-SHOW CREATE TABLE t1;
-SET @@SQL_MODE="MYSQL323";
-SHOW CREATE TABLE t1;
-SET @@SQL_MODE="MYSQL40";
-SHOW CREATE TABLE t1;
-SET @@SQL_MODE="NO_FIELD_OPTIONS";
-SHOW CREATE TABLE t1;
-DROP TABLE t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/auto_increment.test b/mysql-test/suite/pbxt/t/auto_increment.test
deleted file mode 100644
index 453d4d7658d..00000000000
--- a/mysql-test/suite/pbxt/t/auto_increment.test
+++ /dev/null
@@ -1,321 +0,0 @@
-#
-# Test of auto_increment; The test for BDB tables is in bdb.test
-#
---disable_warnings
-drop table if exists t1;
-drop table if exists t2;
---enable_warnings
-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);
-delete from t1 where a=4;
-insert into t1 values (NULL,5),(NULL,6);
-select * from t1;
-delete from t1 where a=6;
-#show table status like "t1";
-replace t1 values (3,1);
-ALTER TABLE t1 add c int;
-replace t1 values (3,3,3);
-insert into t1 values (NULL,7,7);
-update t1 set a=8,b=b+1,c=c+1 where a=7;
-insert into t1 values (NULL,9,9);
-select * from t1;
-drop table t1;
-
-create table t1 (
- skey tinyint unsigned NOT NULL auto_increment PRIMARY KEY,
- sval char(20)
-);
-insert into t1 values (NULL, "hello");
-insert into t1 values (NULL, "hey");
-select * from t1;
-select _rowid,t1._rowid,skey,sval from t1;
-drop table t1;
-
-#
-# Test auto_increment on sub key
-#
-create table t1 (a char(10) not null, b int not null auto_increment, primary key(a,b));
-insert into t1 values ("a",1),("b",2),("a",2),("c",1);
-insert into t1 values ("a",NULL),("b",NULL),("c",NULL),("e",NULL);
-insert into t1 (a) values ("a"),("b"),("c"),("d");
-insert into t1 (a) values ('k'),('d');
-insert into t1 (a) values ("a");
-insert into t1 values ("d",last_insert_id());
-select * from t1;
-drop table t1;
-
-create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ordid), index(ord,ordid));
-insert into t1 (ordid,ord) values (NULL,'sdj'),(NULL,'sdj');
-select * from t1;
-drop table t1;
-
-create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid));
-insert into t1 values (NULL,'sdj'),(NULL,'sdj'),(NULL,"abc"),(NULL,'abc'),(NULL,'zzz'),(NULL,'sdj'),(NULL,'abc');
-select * from t1;
-drop table t1;
-
-create table t1 (sid char(5), id int(2) NOT NULL auto_increment, key(sid, id));
-create table t2 (sid char(20), id int(2));
-insert into t2 values ('skr',NULL),('skr',NULL),('test',NULL);
-insert into t1 select * from t2;
-select * from t1;
-drop table t1,t2;
-
-#
-# Test of auto_increment columns when they are set to 0
-#
-
-create table t1 (a int not null primary key auto_increment);
-insert into t1 values (0);
-update t1 set a=0;
-select * from t1;
-check table t1;
-drop table t1;
-
-#
-# Test negative values (Bug #1366)
-#
-
-create table t1 (a int not null auto_increment primary key);
-insert into t1 values (NULL);
-insert into t1 values (-1);
-select last_insert_id();
-insert into t1 values (NULL);
-select * from t1;
-drop table t1;
-
-create table t1 (a int not null auto_increment primary key) /*!40102 engine=heap */;
-insert into t1 values (NULL);
-insert into t1 values (-1);
-select last_insert_id();
-insert into t1 values (NULL);
-select * from t1;
-drop table t1;
-#
-# last_insert_id() madness
-#
-create table t1 (i tinyint unsigned not null auto_increment primary key);
-insert into t1 set i = 254;
-insert into t1 set i = null;
-select last_insert_id();
-explain extended select last_insert_id();
---error ER_DUP_ENTRY
-insert into t1 set i = 254;
-select last_insert_id();
---error 1467
-insert into t1 set i = null;
-select last_insert_id();
-drop table t1;
-
-create table t1 (i tinyint unsigned not null auto_increment, key (i));
-insert into t1 set i = 254;
-insert into t1 set i = null;
-select last_insert_id();
---error 1467
-insert into t1 set i = null;
-select last_insert_id();
-drop table t1;
-
-create table t1 (i tinyint unsigned not null auto_increment primary key, b int, unique (b));
-insert into t1 values (NULL, 10);
-select last_insert_id();
-insert into t1 values (NULL, 15);
-select last_insert_id();
---error ER_DUP_ENTRY
-insert into t1 values (NULL, 10);
-select last_insert_id();
-
-drop table t1;
-
-create table t1(a int auto_increment,b int null,primary key(a));
-SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
-insert into t1(a,b)values(NULL,1);
-insert into t1(a,b)values(200,2);
-insert into t1(a,b)values(0,3);
-insert into t1(b)values(4);
-insert into t1(b)values(5);
-insert into t1(b)values(6);
-insert into t1(b)values(7);
-select * from t1 order by b;
-alter table t1 modify b mediumint;
-select * from t1 order by b;
-create table t2 (a int);
-insert t2 values (1),(2);
-alter table t2 add b int auto_increment primary key;
-select * from t2;
-drop table t2;
-delete from t1 where a=0;
-update t1 set a=0 where b=5;
-select * from t1 order by b;
-delete from t1 where a=0;
-update t1 set a=NULL where b=6;
-update t1 set a=300 where b=7;
-SET SQL_MODE='';
-insert into t1(a,b)values(NULL,8);
-insert into t1(a,b)values(400,9);
-insert into t1(a,b)values(0,10);
-insert into t1(b)values(11);
-insert into t1(b)values(12);
-insert into t1(b)values(13);
-insert into t1(b)values(14);
-select * from t1 order by b;
-delete from t1 where a=0;
-update t1 set a=0 where b=12;
-select * from t1 order by b;
-delete from t1 where a=0;
-update t1 set a=NULL where b=13;
-update t1 set a=500 where b=14;
-select * from t1 order by b;
-drop table t1;
-
-#
-# Test of behavior of ALTER TABLE when coulmn containing NULL or zeroes is
-# converted to AUTO_INCREMENT column
-#
-create table t1 (a bigint);
-insert into t1 values (1), (2), (3), (NULL), (NULL);
-alter table t1 modify a bigint not null auto_increment primary key;
-select * from t1;
-drop table t1;
-
-create table t1 (a bigint);
-insert into t1 values (1), (2), (3), (0), (0);
-alter table t1 modify a bigint not null auto_increment primary key;
-select * from t1;
-drop table t1;
-
-# We still should be able to preserve zero in NO_AUTO_VALUE_ON_ZERO mode
-create table t1 (a bigint);
-insert into t1 values (0), (1), (2), (3);
-set sql_mode=NO_AUTO_VALUE_ON_ZERO;
-alter table t1 modify a bigint not null auto_increment primary key;
-set sql_mode= '';
-select * from t1;
-drop table t1;
-
-# It also sensible to preserve zeroes if we are converting auto_increment
-# column to auto_increment column (or not touching it at all, which is more
-# common case probably)
-create table t1 (a int auto_increment primary key , b int null);
-set sql_mode=NO_AUTO_VALUE_ON_ZERO;
-insert into t1 values (0,1),(1,2),(2,3);
-select * from t1;
-set sql_mode= '';
-alter table t1 modify b varchar(255);
-insert into t1 values (0,4);
-select * from t1;
-drop table t1;
-
-#
-# BUG #10045: Problem with composite AUTO_INCREMENT + BLOB key
-
-CREATE TABLE t1 ( a INT AUTO_INCREMENT, b BLOB, PRIMARY KEY (a,b(10)));
-INSERT INTO t1 (b) VALUES ('aaaa');
-CHECK TABLE t1;
-INSERT INTO t1 (b) VALUES ('');
-CHECK TABLE t1;
-INSERT INTO t1 (b) VALUES ('bbbb');
-CHECK TABLE t1;
-DROP TABLE IF EXISTS t1;
-
-# BUG #19025:
-
-CREATE TABLE `t1` (
- t1_name VARCHAR(255) DEFAULT NULL,
- t1_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- KEY (t1_name),
- PRIMARY KEY (t1_id)
-) AUTO_INCREMENT = 1000;
-
-INSERT INTO t1 (t1_name) VALUES('MySQL');
-INSERT INTO t1 (t1_name) VALUES('MySQL');
-INSERT INTO t1 (t1_name) VALUES('MySQL');
-
-SELECT * from t1;
-
-SHOW CREATE TABLE `t1`;
-
-DROP TABLE `t1`;
-
-#
-# Bug #6880: LAST_INSERT_ID() within a statement
-#
-
-create table t1(a int not null auto_increment primary key);
-create table t2(a int not null auto_increment primary key, t1a int);
-insert into t1 values(NULL);
-insert into t2 values (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID());
-insert into t1 values (NULL);
-insert into t2 values (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID()),
-(NULL, LAST_INSERT_ID());
-insert into t1 values (NULL);
-insert into t2 values (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID()),
-(NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID());
-select * from t2;
-drop table t1, t2;
-
---echo End of 4.1 tests
-
-#
-# Bug #11080 & #11005 Multi-row REPLACE fails on a duplicate key error
-#
-
-CREATE TABLE t1 ( `a` int(11) NOT NULL auto_increment, `b` int(11) default NULL,PRIMARY KEY (`a`),UNIQUE KEY `b` (`b`));
-insert into t1 (b) values (1);
-replace into t1 (b) values (2), (1), (3);
-select * from t1;
-truncate table t1;
-insert into t1 (b) values (1);
-replace into t1 (b) values (2);
-replace into t1 (b) values (1);
-replace into t1 (b) values (3);
-select * from t1 order by a; # PBXT: Required for consistent result
-drop table t1;
-
-create table t1 (rowid int not null auto_increment, val int not null,primary
-key (rowid), unique(val));
-replace into t1 (val) values ('1'),('2');
-replace into t1 (val) values ('1'),('2');
---error ER_DUP_ENTRY
-insert into t1 (val) values ('1'),('2');
-select * from t1;
-drop table t1;
-
-#
-# Test that update changes internal auto-increment value
-#
-
-create table t1 (a int not null auto_increment primary key, val int);
-insert into t1 (val) values (1);
-update t1 set a=2 where a=1;
-insert into t1 (val) values (1);
-select * from t1 order by a; # PBXT: Required for consistent result
-drop table t1;
-
-#
-# Test key duplications with auto-increment in ALTER TABLE
-# bug #14573
-#
-CREATE TABLE t1 (t1 INT(10) PRIMARY KEY, t2 INT(10));
-INSERT INTO t1 VALUES(0, 0);
-INSERT INTO t1 VALUES(1, 1);
---error ER_DUP_ENTRY
-ALTER TABLE t1 CHANGE t1 t1 INT(10) auto_increment;
-DROP TABLE t1;
-
-# Test of REPLACE when it does INSERT+DELETE and not UPDATE:
-# see if it sets LAST_INSERT_ID() ok
-create table t1 (a int primary key auto_increment, b int, c int, d timestamp default current_timestamp, unique(b),unique(c));
-insert into t1 values(null,1,1,now());
-insert into t1 values(null,0,0,null);
-# this will delete two rows
-replace into t1 values(null,1,0,null);
-select last_insert_id();
-
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/bench_count_distinct.test b/mysql-test/suite/pbxt/t/bench_count_distinct.test
deleted file mode 100644
index a40846c1dec..00000000000
--- a/mysql-test/suite/pbxt/t/bench_count_distinct.test
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# Test of count(distinct ..)
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-create table t1(n int not null, key(n)) delay_key_write = 1;
-let $1=100;
-disable_query_log;
-while ($1)
-{
- eval insert into t1 values($1);
- eval insert into t1 values($1);
- dec $1;
-}
-enable_query_log;
-select count(distinct n) from t1;
-explain extended select count(distinct n) from t1;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/bigint.test b/mysql-test/suite/pbxt/t/bigint.test
deleted file mode 100644
index 093dd5f38c9..00000000000
--- a/mysql-test/suite/pbxt/t/bigint.test
+++ /dev/null
@@ -1,293 +0,0 @@
-#
-# Initialize
-
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
-
-#
-# Test of reading of bigint values
-#
-select 0,256,00000000000000065536,2147483647,-2147483648,2147483648,+4294967296;
-select 9223372036854775807,-009223372036854775808;
-select +9999999999999999999,-9999999999999999999;
-select cast(9223372036854775808 as unsigned)+1;
-select 9223372036854775808+1;
-select -(0-3),round(-(0-3)), round(9999999999999999999);
-select 1,11,101,1001,10001,100001,1000001,10000001,100000001,1000000001,10000000001,100000000001,1000000000001,10000000000001,100000000000001,1000000000000001,10000000000000001,100000000000000001,1000000000000000001,10000000000000000001;
-select -1,-11,-101,-1001,-10001,-100001,-1000001,-10000001,-100000001,-1000000001,-10000000001,-100000000001,-1000000000001,-10000000000001,-100000000000001,-1000000000000001,-10000000000000001,-100000000000000001,-1000000000000000001,-10000000000000000001;
-select conv(1,10,16),conv((1<<2)-1,10,16),conv((1<<10)-2,10,16),conv((1<<16)-3,10,16),conv((1<<25)-4,10,16),conv((1<<31)-5,10,16),conv((1<<36)-6,10,16),conv((1<<47)-7,10,16),conv((1<<48)-8,10,16),conv((1<<55)-9,10,16),conv((1<<56)-10,10,16),conv((1<<63)-11,10,16);
-
-#
-# In 3.23 we have to disable the test of column to bigint as
-# this fails on AIX powerpc (the resolution for double is not good enough)
-# This will work on 4.0 as we then have internal handling of bigint variables.
-#
-
-create table t1 (a bigint unsigned not null, primary key(a));
-insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
-select * from t1;
-select * from t1 where a=18446744073709551615;
-# select * from t1 where a='18446744073709551615';
-delete from t1 where a=18446744073709551615;
-select * from t1;
-drop table t1;
-
-create table t1 ( a int not null default 1, big bigint );
-insert into t1 (big) values (-1),(12345678901234567),(9223372036854775807),(18446744073709551615);
-select * from t1;
-select min(big),max(big),max(big)-1 from t1;
-select min(big),max(big),max(big)-1 from t1 group by a;
-alter table t1 modify big bigint unsigned not null;
-select min(big),max(big),max(big)-1 from t1;
-select min(big),max(big),max(big)-1 from t1 group by a;
-insert into t1 (big) values (18446744073709551615);
-select * from t1;
-select min(big),max(big),max(big)-1 from t1;
-select min(big),max(big),max(big)-1 from t1 group by a;
-alter table t1 add key (big);
-select min(big),max(big),max(big)-1 from t1;
-select min(big),max(big),max(big)-1 from t1 group by a;
-alter table t1 modify big bigint not null;
-select * from t1;
-select min(big),max(big),max(big)-1 from t1;
-select min(big),max(big),max(big)-1 from t1 group by a;
-drop table t1;
-
-#
-# Test problem with big values for auto_increment
-#
-
-create table t1 (id bigint auto_increment primary key, a int) auto_increment=9999999999;
-insert into t1 values (null,1);
-select * from t1;
-select * from t1 limit 9999999999;
-drop table t1;
-
-#
-# Item_uint::save_to_field()
-# BUG#1845
-# This can't be fixed in MySQL 4.0 without loosing precisions for bigints
-#
-
-CREATE TABLE t1 ( quantity decimal(60,0));
-insert into t1 values (10000000000000000000);
-insert into t1 values (10000000000000000000.0);
-insert into t1 values ('10000000000000000000');
-select * from t1;
-drop table t1;
-
-# atof() behaviour is different of different systems. to be fixed in 4.1
-SELECT '0x8000000000000001'+0;
-
-# Test for BUG#8562: joins over BIGINT UNSIGNED value + constant propagation
-create table t1 (
- value64 bigint unsigned not null,
- value32 integer not null,
- primary key(value64, value32)
-);
-
-create table t2 (
- value64 bigint unsigned not null,
- value32 integer not null,
- primary key(value64, value32)
-);
-
-insert into t1 values(17156792991891826145, 1);
-insert into t1 values( 9223372036854775807, 2);
-insert into t2 values(17156792991891826145, 3);
-insert into t2 values( 9223372036854775807, 4);
-
-select * from t1;
-select * from t2;
-
-select * from t1, t2 where t1.value64=17156792991891826145 and
-t2.value64=17156792991891826145;
-select * from t1, t2 where t1.value64=17156792991891826145 and
-t2.value64=t1.value64;
-
-select * from t1, t2 where t1.value64= 9223372036854775807 and
-t2.value64=9223372036854775807;
-select * from t1, t2 where t1.value64= 9223372036854775807 and
-t2.value64=t1.value64;
-
-drop table t1, t2;
-
-# End of 4.1 tests
-
-#
-# Test of CREATE ... SELECT and unsigned integers
-#
-
-create table t1 select 1 as 'a';
-show create table t1;
-drop table t1;
-create table t1 select 9223372036854775809 as 'a';
-show create table t1;
-select * from t1;
-drop table t1;
-DROP DATABASE IF EXISTS `scott`;
-
-
-#
-# Check various conversions from/to unsigned bigint.
-#
-
-create table t1 (a char(100), b varchar(100), c text, d blob);
-insert into t1 values(
- 18446744073709551615,18446744073709551615,
- 18446744073709551615, 18446744073709551615
-);
-
-insert into t1 values (-1 | 0,-1 | 0,-1 | 0 ,-1 | 0);
-select * from t1;
-drop table t1;
-
-create table t1 ( quantity decimal(2) unsigned);
-insert into t1 values (500), (-500), (~0), (-1);
-select * from t1;
-drop table t1;
-
-#
-# Test of storing decimal values in BIGINT range
-# (Bug #12750: Incorrect storage of 9999999999999999999 in DECIMAL(19, 0))
-#
-
-CREATE TABLE t1 (
- `col1` INT(1) NULL,
- `col2` INT(2) NULL,
- `col3` INT(3) NULL,
- `col4` INT(4) NULL,
- `col5` INT(5) NULL,
- `col6` INT(6) NULL,
- `col7` INT(7) NULL,
- `col8` INT(8) NULL,
- `col9` INT(9) NULL,
- `col10` BIGINT(10) NULL,
- `col11` BIGINT(11) NULL,
- `col12` BIGINT(12) NULL,
- `col13` BIGINT(13) NULL,
- `col14` BIGINT(14) NULL,
- `col15` BIGINT(15) NULL,
- `col16` BIGINT(16) NULL,
- `col17` BIGINT(17) NULL,
- `col18` BIGINT(18) NULL,
- `col19` DECIMAL(19, 0) NULL,
- `col20` DECIMAL(20, 0) NULL,
- `col21` DECIMAL(21, 0) NULL,
- `col22` DECIMAL(22, 0) NULL,
- `col23` DECIMAL(23, 0) NULL,
- `col24` DECIMAL(24, 0) NULL,
- `col25` DECIMAL(25, 0) NULL,
- `col26` DECIMAL(26, 0) NULL,
- `col27` DECIMAL(27, 0) NULL,
- `col28` DECIMAL(28, 0) NULL,
- `col29` DECIMAL(29, 0) NULL,
- `col30` DECIMAL(30, 0) NULL,
- `col31` DECIMAL(31, 0) NULL,
- `col32` DECIMAL(32, 0) NULL,
- `col33` DECIMAL(33, 0) NULL,
- `col34` DECIMAL(34, 0) NULL,
- `col35` DECIMAL(35, 0) NULL,
- `col36` DECIMAL(36, 0) NULL,
- `col37` DECIMAL(37, 0) NULL,
- `col38` DECIMAL(38, 0) NULL,
- `fix1` DECIMAL(38, 1) NULL,
- `fix2` DECIMAL(38, 2) NULL,
- `fix3` DECIMAL(38, 3) NULL,
- `fix4` DECIMAL(38, 4) NULL,
- `fix5` DECIMAL(38, 5) NULL,
- `fix6` DECIMAL(38, 6) NULL,
- `fix7` DECIMAL(38, 7) NULL,
- `fix8` DECIMAL(38, 8) NULL,
- `fix9` DECIMAL(38, 9) NULL,
- `fix10` DECIMAL(38, 10) NULL,
- `fix11` DECIMAL(38, 11) NULL,
- `fix12` DECIMAL(38, 12) NULL,
- `fix13` DECIMAL(38, 13) NULL,
- `fix14` DECIMAL(38, 14) NULL,
- `fix15` DECIMAL(38, 15) NULL,
- `fix16` DECIMAL(38, 16) NULL,
- `fix17` DECIMAL(38, 17) NULL,
- `fix18` DECIMAL(38, 18) NULL,
- `fix19` DECIMAL(38, 19) NULL,
- `fix20` DECIMAL(38, 20) NULL,
- `fix21` DECIMAL(38, 21) NULL,
- `fix22` DECIMAL(38, 22) NULL,
- `fix23` DECIMAL(38, 23) NULL,
- `fix24` DECIMAL(38, 24) NULL,
- `fix25` DECIMAL(38, 25) NULL,
- `fix26` DECIMAL(38, 26) NULL,
- `fix27` DECIMAL(38, 27) NULL,
- `fix28` DECIMAL(38, 28) NULL,
- `fix29` DECIMAL(38, 29) NULL,
- `fix30` DECIMAL(38, 30) NULL
-);
-
-INSERT INTO t1(`col1`, `col2`, `col3`, `col4`, `col5`, `col6`, `col7`, `col8`, `col9`, `col10`, `col11`, `col12`, `col13`, `col14`, `col15`, `col16`, `col17`, `col18`, `col19`, `col20`, `col21`, `col22`, `col23`, `col24`, `col25`, `col26`, `col27`, `col28`, `col29`, `col30`, `col31`, `col32`, `col33`, `col34`, `col35`, `col36`, `col37`, `col38`, `fix1`, `fix2`, `fix3`, `fix4`, `fix5`, `fix6`, `fix7`, `fix8`, `fix9`, `fix10`, `fix11`, `fix12`, `fix13`, `fix14`, `fix15`, `fix16`, `fix17`, `fix18`, `fix19`, `fix20`, `fix21`, `fix22`, `fix23`, `fix24`, `fix25`, `fix26`, `fix27`, `fix28`, `fix29`, `fix30`)
-VALUES (9, 99, 999, 9999, 99999, 999999, 9999999, 99999999, 999999999,
-9999999999, 99999999999, 999999999999, 9999999999999, 99999999999999,
-999999999999999, 9999999999999999, 99999999999999999, 999999999999999999,
-9999999999999999999, 99999999999999999999, 999999999999999999999,
-9999999999999999999999, 99999999999999999999999, 999999999999999999999999,
-9999999999999999999999999, 99999999999999999999999999,
-999999999999999999999999999, 9999999999999999999999999999,
-99999999999999999999999999999, 999999999999999999999999999999,
-9999999999999999999999999999999, 99999999999999999999999999999999,
-999999999999999999999999999999999, 9999999999999999999999999999999999,
-99999999999999999999999999999999999, 999999999999999999999999999999999999,
-9999999999999999999999999999999999999, 99999999999999999999999999999999999999,
-9999999999999999999999999999999999999.9,
-999999999999999999999999999999999999.99,
-99999999999999999999999999999999999.999,
-9999999999999999999999999999999999.9999,
-999999999999999999999999999999999.99999,
-99999999999999999999999999999999.999999,
-9999999999999999999999999999999.9999999,
-999999999999999999999999999999.99999999,
-99999999999999999999999999999.999999999,
-9999999999999999999999999999.9999999999,
-999999999999999999999999999.99999999999,
-99999999999999999999999999.999999999999,
-9999999999999999999999999.9999999999999,
-999999999999999999999999.99999999999999,
-99999999999999999999999.999999999999999,
-9999999999999999999999.9999999999999999,
-999999999999999999999.99999999999999999,
-99999999999999999999.999999999999999999,
-9999999999999999999.9999999999999999999,
-999999999999999999.99999999999999999999,
-99999999999999999.999999999999999999999,
-9999999999999999.9999999999999999999999,
-999999999999999.99999999999999999999999,
-99999999999999.999999999999999999999999,
-9999999999999.9999999999999999999999999,
-999999999999.99999999999999999999999999,
-99999999999.999999999999999999999999999,
-9999999999.9999999999999999999999999999,
-999999999.99999999999999999999999999999,
-99999999.999999999999999999999999999999);
-
-SELECT * FROM t1;
-DROP TABLE t1;
-
-#bug #9088 BIGINT WHERE CLAUSE
-create table t1 (bigint_col bigint unsigned);
-insert into t1 values (17666000000000000000);
-select * from t1 where bigint_col=17666000000000000000;
-select * from t1 where bigint_col='17666000000000000000';
-drop table t1;
-
---echo
---echo bug 19955 -- mod is signed with bigint
-
-select cast(10000002383263201056 as unsigned) mod 50 as result;
-
-create table t1 (c1 bigint unsigned);
-insert into t1 values (10000002383263201056);
-select c1 mod 50 as result from t1;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/binary.test b/mysql-test/suite/pbxt/t/binary.test
deleted file mode 100644
index d7879f28294..00000000000
--- a/mysql-test/suite/pbxt/t/binary.test
+++ /dev/null
@@ -1,107 +0,0 @@
-#
-# test sort,min and max on binary fields
-#
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-create table t1 (name char(20) not null, primary key (name));
-create table t2 (name char(20) binary not null, primary key (name));
-insert into t1 values ("");
-insert into t1 values ("");
-insert into t1 values ("");
-insert into t2 select * from t1;
-
-select * from t1 order by name;
-select concat("*",name,"*") from t1 order by 1;
-select min(name),min(concat("*",name,"*")),max(name),max(concat("*",name,"*")) from t1;
-select * from t2 order by name;
-select concat("*",name,"*") from t2 order by 1;
-select min(name),min(concat("*",name,"*")),max(name),max(concat("*",name,"*")) from t2;
-select name from t1 where name between '' and '';
-select name from t2 where name between '' and '';
-select name from t2 where name between '' and '';
-
-drop table t1,t2;
-
-#
-# Test of binary and normal strings
-#
-
-create table t1 (a char(10) not null, b char(10) binary not null,key (a), key(b));
-insert into t1 values ("hello ","hello "),("hello2 ","hello2 ");
-select concat("-",a,"-",b,"-") from t1 where a="hello";
-select concat("-",a,"-",b,"-") from t1 where a="hello ";
-select concat("-",a,"-",b,"-") from t1 ignore index (a) where a="hello ";
-select concat("-",a,"-",b,"-") from t1 where b="hello";
-select concat("-",a,"-",b,"-") from t1 where b="hello ";
-select concat("-",a,"-",b,"-") from t1 ignore index (b) where b="hello ";
-# blob test
-alter table t1 modify b tinytext not null, drop key b, add key (b(100));
-select concat("-",a,"-",b,"-") from t1;
-select concat("-",a,"-",b,"-") from t1 where b="hello ";
-select concat("-",a,"-",b,"-") from t1 ignore index (b) where b="hello ";
-drop table t1;
-
-#
-# Test of binary and NULL
-#
-create table t1 (b char(8));
-insert into t1 values(NULL);
-select b from t1 where binary b like '';
-select b from t1 group by binary b like '';
-select b from t1 having binary b like '';
-drop table t1;
-
-#
-# Test of binary and upper/lower
-#
-create table t1 (a char(3) binary, b binary(3));
-insert into t1 values ('aaa','bbb'),('AAA','BBB');
-select upper(a),upper(b) from t1;
-select lower(a),lower(b) from t1;
-select * from t1 where upper(a)='AAA';
-select * from t1 where lower(a)='aaa';
-select * from t1 where upper(b)='BBB';
-select * from t1 where lower(b)='bbb';
-select charset(a), charset(b), charset(binary 'ccc') from t1 limit 1;
-select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1;
-drop table t1;
-
-#
-# Bug5134: WHERE x = 'bar' AND x LIKE BINARY 'bar' returns wrong results
-#
-
-create table t1( firstname char(20), lastname char(20));
-insert into t1 values ("john","doe"),("John","Doe");
-select * from t1 where firstname='john' and firstname like binary 'john';
-select * from t1 where firstname='john' and binary 'john' = firstname;
-select * from t1 where firstname='john' and firstname = binary 'john';
-select * from t1 where firstname='John' and firstname like binary 'john';
-select * from t1 where firstname='john' and firstname like binary 'John';
-drop table t1;
-
-#
-# Bug #6552 CHAR column w/o length is legal, BINARY w/o length is not
-#
-create table t1 (a binary);
-show create table t1;
-drop table t1;
-
-# End of 4.1 tests
-
-#
-# Bug#16857
-#
-create table t1 (col1 binary(4));
-insert into t1 values ('a'),('a ');
-select hex(col1) from t1;
-alter table t1 modify col1 binary(10);
-select hex(col1) from t1;
-insert into t1 values ('b'),('b ');
-select hex(col1) from t1;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/bool.test b/mysql-test/suite/pbxt/t/bool.test
deleted file mode 100644
index 768c29454f2..00000000000
--- a/mysql-test/suite/pbxt/t/bool.test
+++ /dev/null
@@ -1,65 +0,0 @@
-#
-# Test of boolean operations with NULL
-#
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-SELECT IF(NULL AND 1, 1, 2), IF(1 AND NULL, 1, 2);
-SELECT NULL AND 1, 1 AND NULL, 0 AND NULL, NULL and 0;
-
-create table t1 (a int);
-insert into t1 values (0),(1),(NULL);
-SELECT * FROM t1 WHERE IF(a AND 1, 0, 1);
-SELECT * FROM t1 WHERE IF(1 AND a, 0, 1);
-SELECT * FROM t1 where NOT(a AND 1);
-SELECT * FROM t1 where NOT(1 AND a);
-SELECT * FROM t1 where (a AND 1)=0;
-SELECT * FROM t1 where (1 AND a)=0;
-SELECT * FROM t1 where (1 AND a)=1;
-SELECT * FROM t1 where (1 AND a) IS NULL;
-
-# WL#638 - Behaviour of NOT does not follow SQL specification
-set sql_mode='high_not_precedence';
-select * from t1 where not a between 2 and 3;
-set sql_mode=default;
-select * from t1 where not a between 2 and 3;
-
-# SQL boolean tests
-select a, a is false, a is true, a is unknown from t1;
-select a, a is not false, a is not true, a is not unknown from t1;
-
-# Verify that NULL optimisation works in AND clause:
-SET @a=0, @b=0;
-SELECT * FROM t1 WHERE NULL AND (@a:=@a+1);
-SELECT * FROM t1 WHERE NOT(a>=0 AND NULL AND (@b:=@b+1));
-SELECT * FROM t1 WHERE a=2 OR (NULL AND (@a:=@a+1));
-SELECT * FROM t1 WHERE NOT(a=2 OR (NULL AND (@b:=@b+1)));
-DROP TABLE t1;
-
-
-# Test boolean operators in select part
-# NULLs are represented as N for readability
-# Read nA as !A, AB as A && B, AoB as A || B
-# Result table makes ANSI happy
-
-create table t1 (a int, b int);
-insert into t1 values(null, null), (0, null), (1, null), (null, 0), (null, 1), (0, 0), (0, 1), (1, 0), (1, 1);
-
-# Below test is valid untill we have True/False implemented as 1/0
-# To comply to all rules it must show that: n(AB) = nAonB, n(AoB) = nAnB
-
-select ifnull(A, 'N') as A, ifnull(B, 'N') as B, ifnull(not A, 'N') as nA, ifnull(not B, 'N') as nB, ifnull(A and B, 'N') as AB, ifnull(not (A and B), 'N') as `n(AB)`, ifnull((not A or not B), 'N') as nAonB, ifnull(A or B, 'N') as AoB, ifnull(not(A or B), 'N') as `n(AoB)`, ifnull(not A and not B, 'N') as nAnB from t1;
-
-# This should work with any internal representation of True/False
-# Result must be same as above
-
-select ifnull(A=1, 'N') as A, ifnull(B=1, 'N') as B, ifnull(not (A=1), 'N') as nA, ifnull(not (B=1), 'N') as nB, ifnull((A=1) and (B=1), 'N') as AB, ifnull(not ((A=1) and (B=1)), 'N') as `n(AB)`, ifnull((not (A=1) or not (B=1)), 'N') as nAonB, ifnull((A=1) or (B=1), 'N') as AoB, ifnull(not((A=1) or (B=1)), 'N') as `n(AoB)`, ifnull(not (A=1) and not (B=1), 'N') as nAnB from t1;
-
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/bulk_replace.test b/mysql-test/suite/pbxt/t/bulk_replace.test
deleted file mode 100644
index 8470331266c..00000000000
--- a/mysql-test/suite/pbxt/t/bulk_replace.test
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# this is a test of bulk-insert code
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-CREATE TABLE t1 (a int, unique (a), b int not null, unique(b), c int not null, index(c));
-replace into t1 values (1,1,1),(2,2,2),(3,1,3);
-select * from t1 order by a; # PBXT requires an order by
-check table t1;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/case.test b/mysql-test/suite/pbxt/t/case.test
deleted file mode 100644
index 5c20ebc3d0f..00000000000
--- a/mysql-test/suite/pbxt/t/case.test
+++ /dev/null
@@ -1,159 +0,0 @@
-#
-# Testing of CASE
-#
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-select CASE "b" when "a" then 1 when "b" then 2 END;
-select CASE "c" when "a" then 1 when "b" then 2 END;
-select CASE "c" when "a" then 1 when "b" then 2 ELSE 3 END;
-select CASE BINARY "b" when "a" then 1 when "B" then 2 WHEN "b" then "ok" END;
-select CASE "b" when "a" then 1 when binary "B" then 2 WHEN "b" then "ok" END;
-select CASE concat("a","b") when concat("ab","") then "a" when "b" then "b" end;
-select CASE when 1=0 then "true" else "false" END;
-select CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END;
-explain extended select CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END;
-select CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END;
-select (CASE "two" when "one" then "1" WHEN "two" then "2" END) | 0;
-select (CASE "two" when "one" then 1.00 WHEN "two" then 2.00 END) +0.0;
-select case 1/0 when "a" then "true" else "false" END;
-select case 1/0 when "a" then "true" END;
-select (case 1/0 when "a" then "true" END) | 0;
-select (case 1/0 when "a" then "true" END) + 0.0;
-select case when 1>0 then "TRUE" else "FALSE" END;
-select case when 1<0 then "TRUE" else "FALSE" END;
-
-#
-# Test bug when using GROUP BY on CASE
-#
-create table t1 (a int);
-insert into t1 values(1),(2),(3),(4);
-select case a when 1 then 2 when 2 then 3 else 0 end as fcase, count(*) from t1 group by fcase;
-explain extended select case a when 1 then 2 when 2 then 3 else 0 end as fcase, count(*) from t1 group by fcase;
-select case a when 1 then "one" when 2 then "two" else "nothing" end as fcase, count(*) from t1 group by fcase;
-drop table t1;
-
-#
-# Test MAX(CASE ... ) that can return null
-#
-
-create table t1 (row int not null, col int not null, val varchar(255) not null);
-insert into t1 values (1,1,'orange'),(1,2,'large'),(2,1,'yellow'),(2,2,'medium'),(3,1,'green'),(3,2,'small');
-select max(case col when 1 then val else null end) as color from t1 group by row;
-drop table t1;
-
-SET NAMES latin1;
-
-#
-# CASE and argument types/collations aggregation into result
-#
-CREATE TABLE t1 SELECT
- CASE WHEN 1 THEN _latin1'a' COLLATE latin1_danish_ci ELSE _latin1'a' END AS c1,
- CASE WHEN 1 THEN _latin1'a' ELSE _latin1'a' COLLATE latin1_danish_ci END AS c2,
- CASE WHEN 1 THEN 'a' ELSE 1 END AS c3,
- CASE WHEN 1 THEN 1 ELSE 'a' END AS c4,
- CASE WHEN 1 THEN 'a' ELSE 1.0 END AS c5,
- CASE WHEN 1 THEN 1.0 ELSE 'a' END AS c6,
- CASE WHEN 1 THEN 1 ELSE 1.0 END AS c7,
- CASE WHEN 1 THEN 1.0 ELSE 1 END AS c8,
- CASE WHEN 1 THEN 1.0 END AS c9,
- CASE WHEN 1 THEN 0.1e1 else 0.1 END AS c10,
- CASE WHEN 1 THEN 0.1e1 else 1 END AS c11,
- CASE WHEN 1 THEN 0.1e1 else '1' END AS c12
-;
-SHOW CREATE TABLE t1;
-DROP TABLE t1;
-
---error 1267
-SELECT CASE
- WHEN 1
- THEN _latin1'a' COLLATE latin1_danish_ci
- ELSE _latin1'a' COLLATE latin1_swedish_ci
- END;
-
---error 1270
-SELECT CASE _latin1'a' COLLATE latin1_general_ci
- WHEN _latin1'a' COLLATE latin1_danish_ci THEN 1
- WHEN _latin1'a' COLLATE latin1_swedish_ci THEN 2
- END;
-
-SELECT
-CASE _latin1'a' COLLATE latin1_general_ci WHEN _latin1'A' THEN '1' ELSE 2 END,
-CASE _latin1'a' COLLATE latin1_bin WHEN _latin1'A' THEN '1' ELSE 2 END,
-CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_swedish_ci THEN '1' ELSE 2 END,
-CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_bin THEN '1' ELSE 2 END
-;
-
-#
-# COALESCE is a CASE abbrevation:
-#
-# COALESCE(v1,v2) == CASE WHEN v1 IS NOT NULL THEN v1 ELSE v2 END
-#
-# COALESCE(V1, V2, . . . ,Vn ) =
-# CASE WHEN V1 IS NOT NULL THEN V1 ELSE COALESCE (V2, . . . ,Vn) END
-#
-# Check COALESCE argument types aggregation
-
---error 1267
-CREATE TABLE t1 SELECT COALESCE(_latin1'a',_latin2'a');
---error 1267
-CREATE TABLE t1 SELECT COALESCE('a' COLLATE latin1_swedish_ci,'b' COLLATE latin1_bin);
-CREATE TABLE t1 SELECT
- COALESCE(1), COALESCE(1.0),COALESCE('a'),
- COALESCE(1,1.0), COALESCE(1,'1'),COALESCE(1.1,'1'),
- COALESCE('a' COLLATE latin1_bin,'b');
-explain extended SELECT
- COALESCE(1), COALESCE(1.0),COALESCE('a'),
- COALESCE(1,1.0), COALESCE(1,'1'),COALESCE(1.1,'1'),
- COALESCE('a' COLLATE latin1_bin,'b');
-SHOW CREATE TABLE t1;
-DROP TABLE t1;
-
-# Test for BUG#10151
-SELECT 'case+union+test'
-UNION
-SELECT CASE LOWER('1') WHEN LOWER('2') THEN 'BUG' ELSE 'nobug' END;
-
-SELECT CASE LOWER('1') WHEN LOWER('2') THEN 'BUG' ELSE 'nobug' END;
-
-SELECT 'case+union+test'
-UNION
-SELECT CASE '1' WHEN '2' THEN 'BUG' ELSE 'nobug' END;
-
-#
-# Bug #17896: problem with MIN(CASE...)
-#
-
-create table t1(a float, b int default 3);
-insert into t1 (a) values (2), (11), (8);
-select min(a), min(case when 1=1 then a else NULL end),
- min(case when 1!=1 then NULL else a end)
-from t1 where b=3 group by b;
-drop table t1;
-
-
-#
-# Tests for bug #9939: conversion of the arguments for COALESCE and IFNULL
-#
-
-CREATE TABLE t1 (EMPNUM INT);
-INSERT INTO t1 VALUES (0), (2);
-CREATE TABLE t2 (EMPNUM DECIMAL (4, 2));
-INSERT INTO t2 VALUES (0.0), (9.0);
-
-SELECT COALESCE(t2.EMPNUM,t1.EMPNUM) AS CEMPNUM,
- t1.EMPNUM AS EMPMUM1, t2.EMPNUM AS EMPNUM2
- FROM t1 LEFT JOIN t2 ON t1.EMPNUM=t2.EMPNUM;
-
-SELECT IFNULL(t2.EMPNUM,t1.EMPNUM) AS CEMPNUM,
- t1.EMPNUM AS EMPMUM1, t2.EMPNUM AS EMPNUM2
- FROM t1 LEFT JOIN t2 ON t1.EMPNUM=t2.EMPNUM;
-
-DROP TABLE t1,t2;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/cast.test b/mysql-test/suite/pbxt/t/cast.test
deleted file mode 100644
index e8f7bcfeeb4..00000000000
--- a/mysql-test/suite/pbxt/t/cast.test
+++ /dev/null
@@ -1,225 +0,0 @@
-#
-# Test of cast function
-#
-
-select CAST(1-2 AS UNSIGNED);
-select CAST(CAST(1-2 AS UNSIGNED) AS SIGNED INTEGER);
-select CAST('10 ' as unsigned integer);
-select cast(-5 as unsigned) | 1, cast(-5 as unsigned) & -1;
-select cast(-5 as unsigned) -1, cast(-5 as unsigned) + 1;
-select ~5, cast(~5 as signed);
-explain extended select ~5, cast(~5 as signed);
-select cast(5 as unsigned) -6.0;
-select cast(NULL as signed), cast(1/0 as signed);
-select cast(NULL as unsigned), cast(1/0 as unsigned);
-select cast("A" as binary) = "a", cast(BINARY "a" as CHAR) = "A";
-select cast("2001-1-1" as DATE), cast("2001-1-1" as DATETIME);
-select cast("1:2:3" as TIME);
-select CONVERT("2004-01-22 21:45:33",DATE);
-select 10+'10';
-select 10.0+'10';
-select 10E+0+'10';
-
-# The following cast creates warnings
-
-select CONVERT(DATE "2004-01-22 21:45:33" USING latin1);
-select CONVERT(DATE "2004-01-22 21:45:33",CHAR);
-select CONVERT(DATE "2004-01-22 21:45:33",CHAR(4));
-select CONVERT(DATE "2004-01-22 21:45:33",BINARY(4));
-select CAST(DATE "2004-01-22 21:45:33" AS BINARY(4));
-select CAST(0xb3 as signed);
-select CAST(0x8fffffffffffffff as signed);
-select CAST(0xffffffffffffffff as unsigned);
-select CAST(0xfffffffffffffffe as signed);
-select cast('-10a' as signed integer);
-select cast('a10' as unsigned integer);
-select 10+'a';
-select 10.0+cast('a' as decimal);
-select 10E+0+'a';
-
-# out-of-range cases
-select cast('18446744073709551616' as unsigned);
-select cast('18446744073709551616' as signed);
-select cast('9223372036854775809' as signed);
-select cast('-1' as unsigned);
-select cast('abc' as signed);
-select cast('1a' as signed);
-select cast('' as signed);
-
-#
-# Character set conversion
-#
-set names binary;
-select cast(_latin1'test' as char character set latin2);
-select cast(_koi8r'' as char character set cp1251);
-create table t1 select cast(_koi8r'' as char character set cp1251) as t;
-show create table t1;
-drop table t1;
-
-#
-# CAST to CHAR with/without length
-#
-select
- cast(_latin1'ab' AS char) as c1,
- cast(_latin1'a ' AS char) as c2,
- cast(_latin1'abc' AS char(2)) as c3,
- cast(_latin1'a ' AS char(2)) as c4,
- hex(cast(_latin1'a' AS char(2))) as c5;
-select cast(1000 as CHAR(3));
-
-create table t1 select
- cast(_latin1'ab' AS char) as c1,
- cast(_latin1'a ' AS char) as c2,
- cast(_latin1'abc' AS char(2)) as c3,
- cast(_latin1'a ' AS char(2)) as c4,
- cast(_latin1'a' AS char(2)) as c5;
-select c1,c2,c3,c4,hex(c5) from t1;
-show create table t1;
-drop table t1;
-
-#
-# CAST to NCHAR with/without length
-#
-select
- cast(_koi8r'' AS nchar) as c1,
- cast(_koi8r' ' AS nchar) as c2,
- cast(_koi8r'' AS nchar(2)) as c3,
- cast(_koi8r' ' AS nchar(2)) as c4,
- cast(_koi8r'' AS nchar(2)) as c5;
-
-create table t1 select
- cast(_koi8r'' AS nchar) as c1,
- cast(_koi8r' ' AS nchar) as c2,
- cast(_koi8r'' AS nchar(2)) as c3,
- cast(_koi8r' ' AS nchar(2)) as c4,
- cast(_koi8r'' AS nchar(2)) as c5;
-select * from t1;
-show create table t1;
-drop table t1;
-
-#
-# Bug 2202
-# CAST from BINARY to non-BINARY and from non-BINARY to BINARY
-#
-create table t1 (a binary(4), b char(4) character set koi8r);
-insert into t1 values (_binary'',_binary'');
-select a,b,cast(a as char character set cp1251),cast(b as binary) from t1;
-set names koi8r;
-select a,b,cast(a as char character set cp1251),cast(b as binary) from t1;
-set names cp1251;
-select a,b,cast(a as char character set cp1251),cast(b as binary) from t1;
-drop table t1;
-set names binary;
-
-#
-# The following should be fixed in 4.1
-#
-
-select cast("2001-1-1" as date) = "2001-01-01";
-select cast("2001-1-1" as datetime) = "2001-01-01 00:00:00";
-select cast("1:2:3" as TIME) = "1:02:03";
-select cast(NULL as DATE);
-select cast(NULL as BINARY);
-
-#
-# Bug #5228 ORDER BY CAST(enumcol) sorts incorrectly under certain conditions
-#
-CREATE TABLE t1 (a enum ('aac','aab','aaa') not null);
-INSERT INTO t1 VALUES ('aaa'),('aab'),('aac');
-# these two should be in enum order
-SELECT a, CAST(a AS CHAR) FROM t1 ORDER BY CAST(a AS UNSIGNED) ;
-SELECT a, CAST(a AS CHAR(3)) FROM t1 ORDER BY CAST(a AS CHAR(2)), a;
-# these two should be in alphabetic order
-SELECT a, CAST(a AS UNSIGNED) FROM t1 ORDER BY CAST(a AS CHAR) ;
-SELECT a, CAST(a AS CHAR(2)) FROM t1 ORDER BY CAST(a AS CHAR(3)), a;
-DROP TABLE t1;
-
-#
-# Test for bug #6914 "Problems using time()/date() output in expressions".
-# When we are casting datetime value to DATE/TIME we should throw away
-# time/date parts (correspondingly).
-#
-select date_add(cast('2004-12-30 12:00:00' as date), interval 0 hour);
-select timediff(cast('2004-12-30 12:00:00' as time), '12:00:00');
-# Still we should not throw away "days" part of time value
-select timediff(cast('1 12:00:00' as time), '12:00:00');
-
-#
-# Bug #7036: Casting from string to unsigned would cap value of result at
-# maximum signed value instead of maximum unsigned value
-#
-select cast(18446744073709551615 as unsigned);
-select cast(18446744073709551615 as signed);
-select cast('18446744073709551615' as unsigned);
-select cast('18446744073709551615' as signed);
-select cast('9223372036854775807' as signed);
-
-select cast(concat('184467440','73709551615') as unsigned);
-select cast(concat('184467440','73709551615') as signed);
-
-select cast(repeat('1',20) as unsigned);
-select cast(repeat('1',20) as signed);
-
-#
-# Bug #13344: cast of large decimal to signed int not handled correctly
-#
-select cast(1.0e+300 as signed int);
-
-#
-# Bugs: #15098: CAST(column double TO signed int), wrong result
-#
-CREATE TABLE t1 (f1 double);
-INSERT INTO t1 SET f1 = -1.0e+30 ;
-INSERT INTO t1 SET f1 = +1.0e+30 ;
-# Expected result is +-1e+30, but Windows returns +-1e+030.
---replace_result 1e+030 1e+30
-SELECT f1 AS double_val, CAST(f1 AS SIGNED INT) AS cast_val FROM t1;
-DROP TABLE t1;
-
-# End of 4.1 tests
-
-
-#decimal-related additions
-select cast('1.2' as decimal(3,2));
-select 1e18 * cast('1.2' as decimal(3,2));
-select cast(cast('1.2' as decimal(3,2)) as signed);
-set @v1=1e18;
-select cast(@v1 as decimal(22, 2));
-select cast(-1e18 as decimal(22,2));
-
-create table t1(s1 time);
-insert into t1 values ('11:11:11');
-select cast(s1 as decimal(7,2)) from t1;
-drop table t1;
-
-#
-# Test for bug #11283: field conversion from varchar, and text types to decimal
-#
-
-CREATE TABLE t1 (v varchar(10), tt tinytext, t text,
- mt mediumtext, lt longtext);
-INSERT INTO t1 VALUES ('1.01', '2.02', '3.03', '4.04', '5.05');
-
-SELECT CAST(v AS DECIMAL), CAST(tt AS DECIMAL), CAST(t AS DECIMAL),
- CAST(mt AS DECIMAL), CAST(lt AS DECIMAL) from t1;
-
-DROP TABLE t1;
-
-#
-# Bug #10237 (CAST(NULL DECIMAL) crashes server)
-#
-select cast(NULL as decimal(6)) as t1;
-
-
-#
-# Bug #17903: cast to char results in binary
-#
-set names latin1;
-select hex(cast('a' as char(2) binary));
-select hex(cast('a' as binary(2)));
-select hex(cast('a' as char(2) binary));
-
---disable_query_log
-drop database pbxt;
---enable_query_log
---echo End of 5.0 tests
diff --git a/mysql-test/suite/pbxt/t/check.test b/mysql-test/suite/pbxt/t/check.test
deleted file mode 100644
index e25c5217e48..00000000000
--- a/mysql-test/suite/pbxt/t/check.test
+++ /dev/null
@@ -1,44 +0,0 @@
-connect (con1,localhost,root,,);
-connect (con2,localhost,root,,);
-connection con1;
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-# Add a lot of keys to slow down check
-create table t1(n int not null, key(n), key(n), key(n), key(n));
-let $1=10000;
-disable_query_log;
-begin;
-while ($1)
-{
- eval insert into t1 values ($1);
- dec $1;
-}
-commit;
-enable_query_log;
-send check table t1 extended;
-connection con2;
-insert into t1 values (200000);
-connection con1;
-reap;
-drop table t1;
-
-# End of 4.1 tests
-
-#
-# Bug #9897 Views: 'Check Table' crashes MySQL, with a view and a table
-# in the statement
-#
-
-connection default;
-Create table t1(f1 int);
-Create table t2(f1 int);
-Create view v1 as Select * from t1;
-Check Table v1,t2;
-drop view v1;
-drop table t1, t2;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/client_xml.test b/mysql-test/suite/pbxt/t/client_xml.test
deleted file mode 100644
index 447903ebf18..00000000000
--- a/mysql-test/suite/pbxt/t/client_xml.test
+++ /dev/null
@@ -1,25 +0,0 @@
-# Can't run with embedded server
--- source include/not_embedded.inc
-
-# Test of the xml output of the 'mysql' and 'mysqldump' clients -- makes
-# sure that basic encoding issues are handled properly
-create table t1 (
- `a&b` int,
- `a<b` int,
- `a>b` text
-);
-insert into t1 values (1, 2, 'a&b a<b a>b');
---exec $MYSQL --xml test -e "select * from t1"
---exec $MYSQL_DUMP --xml --skip-create test
-
---exec $MYSQL --xml test -e "select count(*) from t1"
---exec $MYSQL --xml test -e "select 1 < 2 from dual"
---exec $MYSQL --xml test -e "select 1 > 2 from dual"
---exec $MYSQL --xml test -e "select 1 & 3 from dual"
---exec $MYSQL --xml test -e "select null from dual"
-
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/comments.test b/mysql-test/suite/pbxt/t/comments.test
deleted file mode 100644
index 52273ec9523..00000000000
--- a/mysql-test/suite/pbxt/t/comments.test
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# Testing of comments
-#
-
-select 1+2/*hello*/+3;
-select 1 /* long
-multi line comment */;
---error 1065
- ;
-select 1 /*!32301 +1 */;
-select 1 /*!52301 +1 */;
-select 1--1;
-# Note that the following returns 4 while it should return 2
-# This is because the mysqld server doesn't parse -- comments
-select 1 --2
-+1;
-select 1 # The rest of the row will be ignored
-;
-/* line with only comment */;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/compare.test b/mysql-test/suite/pbxt/t/compare.test
deleted file mode 100644
index ec70dd5e587..00000000000
--- a/mysql-test/suite/pbxt/t/compare.test
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# Bug when using comparions of strings and integers.
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-CREATE TABLE t1 (id CHAR(12) not null, PRIMARY KEY (id));
-insert into t1 values ('000000000001'),('000000000002');
-explain select * from t1 where id=000000000001;
-select * from t1 where id=000000000001;
-delete from t1 where id=000000000002;
-select * from t1;
-drop table t1;
-
-#
-# Check the following:
-# "a" == "a "
-# "a\0" < "a"
-# "a\0" < "a "
-
-SELECT 'a' = 'a ';
-SELECT 'a\0' < 'a';
-SELECT 'a\0' < 'a ';
-SELECT 'a\t' < 'a';
-SELECT 'a\t' < 'a ';
-
-CREATE TABLE t1 (a char(10) not null);
-INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a ');
-SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
-DROP TABLE t1;
-
-# Bug #8134: Comparison against CHAR(31) at end of string
-SELECT CHAR(31) = '', '' = CHAR(31);
-# Extra test
-SELECT CHAR(30) = '', '' = CHAR(30);
-
-# End of 4.1 tests
-
-#
-#Bug #21159: Optimizer: wrong result after AND with different data types
-#
-create table t1 (a tinyint(1),b binary(1));
-insert into t1 values (0x01,0x01);
-select * from t1 where a=b;
-select * from t1 where a=b and b=0x01;
-drop table if exists t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/connect.test b/mysql-test/suite/pbxt/t/connect.test
deleted file mode 100644
index 0f1107d9556..00000000000
--- a/mysql-test/suite/pbxt/t/connect.test
+++ /dev/null
@@ -1,108 +0,0 @@
-# This test is to check various cases of connections
-# with right and wrong password, with and without database
-# Unfortunately the check is incomplete as we can't connect without database
-
-# This test makes no sense with the embedded server
---source include/not_embedded.inc
-
-# check that CSV engine was compiled in, as the test relies on the presence
-# of the log tables (which are CSV-based). By connect mysql; show tables;
---source include/have_csv.inc
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-
-#connect (con1,localhost,root,,"");
-#show tables;
-connect (con1,localhost,root,,mysql);
-show tables;
-connect (con2,localhost,root,,test);
-show tables;
-
---replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
---error 1045
-connect (fail_con,localhost,root,z,test2);
---replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
---error 1045
-connect (fail_con,localhost,root,z,);
-
-grant ALL on *.* to test@localhost identified by "gambling";
-grant ALL on *.* to test@127.0.0.1 identified by "gambling";
-
-# Now check this user with different databases
-#connect (con1,localhost,test,gambling,"");
-#show tables;
-connect (con3,localhost,test,gambling,mysql);
-show tables;
-connect (con4,localhost,test,gambling,test);
-show tables;
-
---replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
---error 1045
-connect (fail_con,localhost,test,,test2);
---replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT test ""
---error 1045
-connect (fail_con,localhost,test,,"");
---replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
---error 1045
-connect (fail_con,localhost,test,zorro,test2);
---replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
---error 1045
-connect (fail_con,localhost,test,zorro,);
-
-
-# check if old password version also works
-update mysql.user set password=old_password("gambling2") where user=_binary"test";
-flush privileges;
-
-connect (con10,localhost,test,gambling2,);
-connect (con5,localhost,test,gambling2,mysql);
-connection con5;
-set password="";
---error 1372
-set password='gambling3';
-set password=old_password('gambling3');
-show tables;
-connect (con6,localhost,test,gambling3,test);
-show tables;
-
---replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
---error 1045
-connect (fail_con,localhost,test,,test2);
---replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
---error 1045
-connect (fail_con,localhost,test,,);
---replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
---error 1045
-connect (fail_con,localhost,test,zorro,test2);
---replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
---error 1045
-connect (fail_con,localhost,test,zorro,);
-
-
-# remove user 'test' so that other tests which may use 'test'
-# do not depend on this test.
-
-delete from mysql.user where user=_binary"test";
-flush privileges;
-
-#
-# Bug#12517: Clear user variables and replication events before
-# closing temp tables in thread cleanup.
-connect (con7,localhost,root,,test);
-connection con7;
-create table t1 (id integer not null auto_increment primary key);
-create temporary table t2(id integer not null auto_increment primary key);
-set @id := 1;
-delete from t1 where id like @id;
-disconnect con7;
---sleep 5
-connection default;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/consistent_snapshot.test b/mysql-test/suite/pbxt/t/consistent_snapshot.test
deleted file mode 100644
index e2ed9cb5453..00000000000
--- a/mysql-test/suite/pbxt/t/consistent_snapshot.test
+++ /dev/null
@@ -1,53 +0,0 @@
--- source include/have_innodb.inc
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-#
-# workaround for lp:811438
-# remove when fixed.
-#
-create table t1 (a int);
-insert t1 values (1);
-drop table t1;
-
-connect (con1,localhost,root,,);
-connect (con2,localhost,root,,);
-
-### Test 1:
-### - While a consistent snapshot transaction is executed,
-### no external inserts should be visible to the transaction.
-
-connection con1;
-create table t1 (a int) engine=innodb;
-start transaction with consistent snapshot;
-
-connection con2;
-insert into t1 values(1);
-
-connection con1;
-select * from t1; # if consistent snapshot was set as expected, we
-# should see nothing.
-commit;
-
-### Test 2:
-### - For any non-consistent snapshot transaction, external
-### committed inserts should be visible to the transaction.
-
-delete from t1;
-start transaction; # Now we omit WITH CONSISTENT SNAPSHOT
-
-connection con2;
-insert into t1 values(1);
-
-connection con1;
-select * from t1; # if consistent snapshot was not set, as expected, we
-# should see 1.
-commit;
-
-drop table t1;
-
-# End of 4.1 tests
-drop database pbxt;
-
diff --git a/mysql-test/suite/pbxt/t/constraints.test b/mysql-test/suite/pbxt/t/constraints.test
deleted file mode 100644
index 520af3e5a96..00000000000
--- a/mysql-test/suite/pbxt/t/constraints.test
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# Testing of constraints
-# Currently MySQL only ignores the syntax.
-#
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (a int check (a>0));
-insert into t1 values (1);
-insert into t1 values (0);
-drop table t1;
-create table t1 (a int, b int, check (a>b));
-insert into t1 values (1,0);
-insert into t1 values (0,1);
-drop table t1;
-create table t1 (a int ,b int, constraint abc check (a>b));
-insert into t1 values (1,0);
-insert into t1 values (0,1);
-drop table t1;
-create table t1 (a int null);
-insert into t1 values (1),(NULL);
-drop table t1;
-create table t1 (a int null);
-alter table t1 add constraint constraint_1 unique (a);
-alter table t1 add constraint unique key_1(a);
-alter table t1 add constraint constraint_2 unique key_2(a);
-show create table t1;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/contributors.test b/mysql-test/suite/pbxt/t/contributors.test
deleted file mode 100644
index e463c4a888b..00000000000
--- a/mysql-test/suite/pbxt/t/contributors.test
+++ /dev/null
@@ -1 +0,0 @@
-SHOW CONTRIBUTORS;
diff --git a/mysql-test/suite/pbxt/t/count_distinct.test b/mysql-test/suite/pbxt/t/count_distinct.test
deleted file mode 100644
index 1d4f4f22603..00000000000
--- a/mysql-test/suite/pbxt/t/count_distinct.test
+++ /dev/null
@@ -1,82 +0,0 @@
-#
-# Problem with count(distinct)
-#
-
---disable_warnings
-drop table if exists t1,t2,t3;
---enable_warnings
-
-create table t1 (libname varchar(21) not null, city text, primary key (libname));
-create table t2 (isbn varchar(21) not null, author text, title text, primary key (isbn));
-create table t3 (isbn varchar(21) not null, libname varchar(21) not null, quantity int ,primary key (isbn,libname));
-insert into t2 values ('001','Daffy','A duck''s life');
-insert into t2 values ('002','Bugs','A rabbit\'s life');
-insert into t2 values ('003','Cowboy','Life on the range');
-insert into t2 values ('000','Anonymous','Wanna buy this book?');
-insert into t2 values ('004','Best Seller','One Heckuva book');
-insert into t2 values ('005','EveryoneBuys','This very book');
-insert into t2 values ('006','San Fran','It is a san fran lifestyle');
-insert into t2 values ('007','BerkAuthor','Cool.Berkley.the.book');
-insert into t3 values('000','New York Public Libra','1');
-insert into t3 values('001','New York Public Libra','2');
-insert into t3 values('002','New York Public Libra','3');
-insert into t3 values('003','New York Public Libra','4');
-insert into t3 values('004','New York Public Libra','5');
-insert into t3 values('005','New York Public Libra','6');
-insert into t3 values('006','San Fransisco Public','5');
-insert into t3 values('007','Berkeley Public1','3');
-insert into t3 values('007','Berkeley Public2','3');
-insert into t3 values('001','NYC Lib','8');
-insert into t1 values ('New York Public Libra','New York');
-insert into t1 values ('San Fransisco Public','San Fran');
-insert into t1 values ('Berkeley Public1','Berkeley');
-insert into t1 values ('Berkeley Public2','Berkeley');
-insert into t1 values ('NYC Lib','New York');
-select t2.isbn,city,t1.libname,count(t1.libname) as a from t3 left join t1 on t3.libname=t1.libname left join t2 on t3.isbn=t2.isbn group by city,t1.libname;
-select t2.isbn,city,t1.libname,count(distinct t1.libname) as a from t3 left join t1 on t3.libname=t1.libname left join t2 on t3.isbn=t2.isbn group by city having count(distinct t1.libname) > 1;
-select t2.isbn,city,t1.libname,count(distinct t1.libname) as a from t3 left join t1 on t3.libname=t1.libname left join t2 on t3.isbn=t2.isbn group by city having count(distinct concat(t1.libname,'a')) > 1;
-drop table t1, t2, t3;
-
-#
-# Problem with LEFT JOIN
-#
-
-create table t1 (f1 int);
-insert into t1 values (1);
-create table t2 (f1 int,f2 int);
-select t1.f1,count(distinct t2.f2),count(distinct 1,NULL) from t1 left join t2 on t1.f1=t2.f1 group by t1.f1;
-drop table t1,t2;
-
-
-#
-# Empty tables
-#
-create table t1 (f int);
-select count(distinct f) from t1;
-drop table t1;
-
-# End of 4.1 tests
-
-#
-# Bug #6515
-#
-
-create table t1 (a char(3), b char(20), primary key (a, b));
-insert into t1 values ('ABW', 'Dutch'), ('ABW', 'English');
-select count(distinct a) from t1 group by b;
-drop table t1;
-
-#
-# Bug #9593 "The combination of COUNT, DISTINCT and CONCAT
-# seems to lock the server"
-# Bug appears only on Windows system
-#
-
-create table t1 (f1 int, f2 int);
-insert into t1 values (0,1),(1,2);
-select count(distinct if(f1,3,f2)) from t1;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/count_distinct2.test b/mysql-test/suite/pbxt/t/count_distinct2.test
deleted file mode 100644
index 8e2b33f1704..00000000000
--- a/mysql-test/suite/pbxt/t/count_distinct2.test
+++ /dev/null
@@ -1,89 +0,0 @@
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1(n1 int, n2 int, s char(20), vs varchar(20), t text);
-insert into t1 values (1,11, 'one','eleven', 'eleven'),
- (1,11, 'one','eleven', 'eleven'),
- (2,11, 'two','eleven', 'eleven'),
- (2,12, 'two','twevle', 'twelve'),
- (2,13, 'two','thirteen', 'foo'),
- (2,13, 'two','thirteen', 'foo'),
- (2,13, 'two','thirteen', 'bar'),
- (NULL,13, 'two','thirteen', 'bar'),
- (2,NULL, 'two','thirteen', 'bar'),
- (2,13, NULL,'thirteen', 'bar'),
- (2,13, 'two',NULL, 'bar'),
- (2,13, 'two','thirteen', NULL);
-
-select distinct n1 from t1;
-select count(distinct n1) from t1;
-
-select distinct n2 from t1;
-select count(distinct n2) from t1;
-
-select distinct s from t1;
-select count(distinct s) from t1;
-
-select distinct vs from t1;
-select count(distinct vs) from t1;
-
-select distinct t from t1;
-select count(distinct t) from t1;
-
-select distinct n1,n2 from t1;
-select count(distinct n1,n2) from t1;
-
-select distinct n1,s from t1;
-select count(distinct n1,s) from t1;
-
-select distinct s,n1,vs from t1;
-select count(distinct s,n1,vs) from t1;
-
-select distinct s,t from t1;
-select count(distinct s,t) from t1;
-
-select count(distinct n1), count(distinct n2) from t1;
-
-select count(distinct n2), n1 from t1 group by n1;
-drop table t1;
-
-# test the conversion from tree to MyISAM
-create table t1 (n int default NULL);
-let $1=5000;
-disable_query_log;
-begin;
-while ($1)
-{
- eval insert into t1 values($1);
- dec $1;
-}
-commit;
-enable_query_log;
-
-flush status;
-select count(distinct n) from t1;
-show status like 'Created_tmp_disk_tables';
-drop table t1;
-
-# Test use of MyISAM tmp tables
-create table t1 (s text);
-let $1=5000;
-disable_query_log;
-begin;
-while ($1)
-{
- eval insert into t1 values('$1');
- dec $1;
-}
-commit;
-enable_query_log;
-flush status;
-select count(distinct s) from t1;
-show status like 'Created_tmp_disk_tables';
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/count_distinct3.test b/mysql-test/suite/pbxt/t/count_distinct3.test
deleted file mode 100644
index dc2d57af2f5..00000000000
--- a/mysql-test/suite/pbxt/t/count_distinct3.test
+++ /dev/null
@@ -1,65 +0,0 @@
-#
-# this is a test for error 1032 in count(distinct) + group by, introduced in
-# mysql-4.1
-#
-
---disable_warnings
-DROP TABLE IF EXISTS t1, t2;
---enable_warnings
-
-CREATE TABLE t1 (id INTEGER, grp TINYINT, id_rev INTEGER);
-
---disable_query_log
-SET @rnd_max= 2147483647;
-begin;
-let $1 = 1000;
-while ($1)
-{
- SET @rnd= RAND();
- SET @id = CAST(@rnd * @rnd_max AS UNSIGNED);
- SET @id_rev= @rnd_max - @id;
- SET @grp= CAST(127.0 * @rnd AS UNSIGNED);
- INSERT INTO t1 (id, grp, id_rev) VALUES (@id, @grp, @id_rev);
- dec $1;
-}
-commit;
-set @@read_buffer_size=2*1024*1024;
-CREATE TABLE t2 SELECT * FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-DROP TABLE t2;
---enable_query_log
-
-SELECT COUNT(*) FROM t1;
-
-# As t1 contains random numbers, results are different from test to test.
-# That's okay, because we test only that select doesn't yield an
-# error. Note, that --disable_result_log doesn't suppress error output.
-
---disable_result_log
-SELECT COUNT(DISTINCT id) FROM t1 GROUP BY grp;
---enable_result_log
-DROP TABLE t1;
-
-set @@read_buffer_size=default;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/create.test b/mysql-test/suite/pbxt/t/create.test
deleted file mode 100644
index e5271515cfc..00000000000
--- a/mysql-test/suite/pbxt/t/create.test
+++ /dev/null
@@ -1,1305 +0,0 @@
-#
-# Check some special create statements.
-#
-
---disable_warnings
-drop table if exists t1,t2,t3,t4,t5;
-drop database if exists mysqltest;
-drop view if exists v1;
---enable_warnings
-
-create table t1 (b char(0));
-insert into t1 values (""),(null);
-select * from t1;
-drop table if exists t1;
-
-create table t1 (b char(0) not null);
-create table if not exists t1 (b char(0) not null);
-insert into t1 values (""),(null);
-select * from t1;
-drop table t1;
-
-create table t1 (a int not null auto_increment,primary key (a)) engine=heap;
-drop table t1;
-
-#
-# Test of some CREATE TABLE'S that should fail
-#
-
---error 1146
-create table t2 engine=heap select * from t1;
---error 1146
-create table t2 select auto+1 from t1;
-drop table if exists t1,t2;
---error 1167
-create table t1 (b char(0) not null, index(b));
---error 1163
-create table t1 (a int not null,b text) engine=heap;
-drop table if exists t1;
-
---error 1075
-create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=heap;
-
--- error 1049
-create table not_existing_database.test (a int);
-create table `a/a` (a int);
-show create table `a/a`;
-create table t1 like `a/a`;
-drop table `a/a`;
-drop table `t1`;
---error 1103
-create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa int);
---error 1059
-create table a (`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` int);
-
-#
-# Some wrong defaults, so these creates should fail too (Bug #5902)
-#
---error 1067
-create table t1 (a datetime default now());
---error 1294
-create table t1 (a datetime on update now());
---error 1067
-create table t1 (a int default 100 auto_increment);
---error 1067
-create table t1 (a tinyint default 1000);
---error 1067
-create table t1 (a varchar(5) default 'abcdef');
-
-create table t1 (a varchar(5) default 'abcde');
-insert into t1 values();
-select * from t1;
---error 1067
-alter table t1 alter column a set default 'abcdef';
-drop table t1;
-
-#
-# test of dummy table names
-#
-
-create table 1ea10 (1a20 int,1e int);
-insert into 1ea10 values(1,1);
-select 1ea10.1a20,1e+ 1e+10 from 1ea10;
-drop table 1ea10;
-create table t1 (t1.index int);
-drop table t1;
-# Test that we get warning for this
-drop database if exists mysqltest;
-create database mysqltest;
-create table mysqltest.$test1 (a$1 int, $b int, c$ int);
-insert into mysqltest.$test1 values (1,2,3);
-select a$1, $b, c$ from mysqltest.$test1;
-create table mysqltest.test2$ (a int);
-drop table mysqltest.test2$;
-drop database mysqltest;
-
---error 1103
-create table `` (a int);
---error 1103
-drop table if exists ``;
---error 1166
-create table t1 (`` int);
---error 1280
-create table t1 (i int, index `` (i));
-
-#
-# CREATE TABLE under LOCK TABLES
-#
-# We don't allow creation of non-temporary tables under LOCK TABLES
-# as following meta-data locking protocol in this case can lead to
-# deadlock.
-create table t1 (i int);
-lock tables t1 read;
---error ER_TABLE_NOT_LOCKED
-create table t2 (j int);
-# OTOH creating of temporary table should be OK
-create temporary table t2 (j int);
-drop temporary table t2;
-unlock tables;
-drop table t1;
-
-#
-# Test of CREATE ... SELECT with indexes
-#
-
-create table t1 (a int auto_increment not null primary key, B CHAR(20));
-insert into t1 (b) values ("hello"),("my"),("world");
-create table t2 (key (b)) select * from t1;
-explain select * from t2 where b="world";
-select * from t2 where b="world";
-drop table t1,t2;
-
-#
-# Test types after CREATE ... SELECT
-#
-
-create table t1(x varchar(50) );
-create table t2 select x from t1 where 1=2;
-describe t1;
-describe t2;
-drop table t2;
-create table t2 select now() as a , curtime() as b, curdate() as c , 1+1 as d , 1.0 + 1 as e , 33333333333333333 + 3 as f;
-describe t2;
-drop table t2;
-create table t2 select CAST("2001-12-29" AS DATE) as d, CAST("20:45:11" AS TIME) as t, CAST("2001-12-29 20:45:11" AS DATETIME) as dt;
-describe t2;
-drop table t1,t2;
-
-#
-# Test of CREATE ... SELECT with duplicate fields
-#
-
-create table t1 (a tinyint);
-create table t2 (a int) select * from t1;
-describe t1;
-describe t2;
-drop table if exists t2;
---error 1060
-create table t2 (a int, a float) select * from t1;
-drop table if exists t2;
---error 1060
-create table t2 (a int) select a as b, a+1 as b from t1;
-drop table if exists t2;
---error 1060
-create table t2 (b int) select a as b, a+1 as b from t1;
-drop table if exists t1,t2;
-
-#
-# Test CREATE ... SELECT when insert fails
-#
-
-CREATE TABLE t1 (a int not null);
-INSERT INTO t1 values (1),(2),(1);
---error ER_DUP_ENTRY
-CREATE TABLE t2 (primary key(a)) SELECT * FROM t1;
---error 1146
-SELECT * from t2;
-DROP TABLE t1;
-DROP TABLE IF EXISTS t2;
-
-#
-# Test of primary key with 32 index
-#
-
-create table t1 (a int not null, b int, primary key(a), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b));
-show create table t1;
-drop table t1;
-create table t1 select if(1,'1','0'), month("2002-08-02");
-drop table t1;
-create table t1 select if('2002'='2002','Y','N');
-select * from t1;
-drop table if exists t1;
-
-#
-# Test default table type
-#
-SET SESSION storage_engine="heap";
-SELECT @@storage_engine;
-CREATE TABLE t1 (a int not null);
-show create table t1;
-drop table t1;
---error 1286
-SET SESSION storage_engine="gemini";
-SELECT @@storage_engine;
-CREATE TABLE t1 (a int not null);
-show create table t1;
-SET SESSION storage_engine=default;
-drop table t1;
-
-
-#
-# ISO requires that primary keys are implicitly NOT NULL
-#
-create table t1 ( k1 varchar(2), k2 int, primary key(k1,k2));
-insert into t1 values ("a", 1), ("b", 2);
---error 1048
-insert into t1 values ("c", NULL);
---error 1048
-insert into t1 values (NULL, 3);
---error 1048
-insert into t1 values (NULL, NULL);
-drop table t1;
-
-#
-# Bug # 801
-#
-
-create table t1 select x'4132';
-drop table t1;
-
-#
-# bug #1434
-#
-
-create table t1 select 1,2,3;
-create table if not exists t1 select 1,2;
-create table if not exists t1 select 1,2,3,4;
-create table if not exists t1 select 1;
-select * from t1;
-drop table t1;
-
-#
-# Test create table if not exists with duplicate key error
-#
-
-flush status;
-create table t1 (a int not null, b int, primary key (a));
-insert into t1 values (1,1);
-create table if not exists t1 select 2;
-select * from t1;
-create table if not exists t1 select 3 as 'a',4 as 'b';
-show warnings;
-show status like "Opened_tables";
-select * from t1;
-drop table t1;
-
-#
-# Test for Bug #2985
-# "Table truncated when creating another table name with Spaces"
-#
-
---error 1103
-create table `t1 `(a int);
---error 1102
-create database `db1 `;
---error 1166
-create table t1(`a ` int);
-
-#
-# Test for Bug #3481
-# "Parser permits multiple commas without syntax error"
-#
-
---error 1064
-create table t1 (a int,);
---error 1064
-create table t1 (a int,,b int);
---error 1064
-create table t1 (,b int);
-
-#
-# Test create with foreign keys
-#
-
-create table t1 (a int, key(a));
-create table t2 (b int, foreign key(b) references t1(a), key(b));
-drop table if exists t2,t1;
-
-#
-# Test for CREATE TABLE .. LIKE ..
-#
-
-create table t1(id int not null, name char(20));
-insert into t1 values(10,'mysql'),(20,'monty- the creator');
-create table t2(id int not null);
-insert into t2 values(10),(20);
-create table t3 like t1;
-show create table t3;
-select * from t3;
-# Disable PS becasue of @@warning_count
-create table if not exists t3 like t1;
---disable_ps_protocol
-select @@warning_count;
---enable_ps_protocol
-create temporary table t3 like t2;
-show create table t3;
-select * from t3;
-drop table t3;
-show create table t3;
-select * from t3;
-drop table t2, t3;
-create database mysqltest;
-create table mysqltest.t3 like t1;
-create temporary table t3 like mysqltest.t3;
-show create table t3;
-create table t2 like t3;
-show create table t2;
-select * from t2;
-create table t3 like t1;
---error 1050
-create table t3 like mysqltest.t3;
---error 1049
-create table non_existing_database.t1 like t1;
---error ER_NO_SUCH_TABLE
-create table t3 like non_existing_table;
---error 1050
-create temporary table t3 like t1;
-drop table t1, t2, t3;
-drop table t3;
-drop database mysqltest;
-
-#
-# CREATE TABLE LIKE under LOCK TABLES
-#
-# Similarly to ordinary CREATE TABLE we don't allow creation of
-# non-temporary tables under LOCK TABLES. Also we require source
-# table to be locked.
-create table t1 (i int);
-create table t2 (j int);
-lock tables t1 read;
---error ER_TABLE_NOT_LOCKED
-create table t3 like t1;
-# OTOH creating of temporary table should be OK
-create temporary table t3 like t1;
-drop temporary table t3;
-# Source table should be locked
---error ER_TABLE_NOT_LOCKED
-create temporary table t3 like t2;
-unlock tables;
-drop tables t1, t2;
-
-#
-# Test default table type
-#
-SET SESSION storage_engine="heap";
-SELECT @@storage_engine;
-CREATE TABLE t1 (a int not null);
-show create table t1;
-drop table t1;
---error 1286
-SET SESSION storage_engine="gemini";
-SELECT @@storage_engine;
-CREATE TABLE t1 (a int not null);
-show create table t1;
-SET SESSION storage_engine=default;
-drop table t1;
-
-#
-# Test types of data for create select with functions
-#
-
-create table t1(a int,b int,c int unsigned,d date,e char,f datetime,g time,h blob);
-insert into t1(a)values(1);
-insert into t1(a,b,c,d,e,f,g,h)
-values(2,-2,2,'1825-12-14','a','2003-1-1 3:2:1','4:3:2','binary data');
-select * from t1;
-select a,
- ifnull(b,cast(-7 as signed)) as b,
- ifnull(c,cast(7 as unsigned)) as c,
- ifnull(d,cast('2000-01-01' as date)) as d,
- ifnull(e,cast('b' as char)) as e,
- ifnull(f,cast('2000-01-01' as datetime)) as f,
- ifnull(g,cast('5:4:3' as time)) as g,
- ifnull(h,cast('yet another binary data' as binary)) as h,
- addtime(cast('1:0:0' as time),cast('1:0:0' as time)) as dd
-from t1;
-
-create table t2
-select
- a,
- ifnull(b,cast(-7 as signed)) as b,
- ifnull(c,cast(7 as unsigned)) as c,
- ifnull(d,cast('2000-01-01' as date)) as d,
- ifnull(e,cast('b' as char)) as e,
- ifnull(f,cast('2000-01-01' as datetime)) as f,
- ifnull(g,cast('5:4:3' as time)) as g,
- ifnull(h,cast('yet another binary data' as binary)) as h,
- addtime(cast('1:0:0' as time),cast('1:0:0' as time)) as dd
-from t1;
-explain t2;
-select * from t2;
-drop table t1, t2;
-
-create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp, l datetime, m enum('a','b'), n set('a','b'), o char(10));
-create table t2 select ifnull(a,a), ifnull(b,b), ifnull(c,c), ifnull(d,d), ifnull(e,e), ifnull(f,f), ifnull(g,g), ifnull(h,h), ifnull(i,i), ifnull(j,j), ifnull(k,k), ifnull(l,l), ifnull(m,m), ifnull(n,n), ifnull(o,o) from t1;
-show create table t2;
-drop table t1,t2;
-
-#
-# Test of default()
-#
-create table t1(str varchar(10) default 'def',strnull varchar(10),intg int default '10',rel double default '3.14');
-insert into t1 values ('','',0,0.0);
-describe t1;
-create table t2 select default(str) as str, default(strnull) as strnull, default(intg) as intg, default(rel) as rel from t1;
-describe t2;
-drop table t1, t2;
-
-#
-# Bug #2075
-#
-
-create table t1(name varchar(10), age smallint default -1);
-describe t1;
-create table t2(name varchar(10), age smallint default - 1);
-describe t2;
-drop table t1, t2;
-
-#
-# test for bug #1427 "enum allows duplicate values in the list"
-#
-
-create table t1(cenum enum('a'), cset set('b'));
-create table t2(cenum enum('a','a'), cset set('b','b'));
-create table t3(cenum enum('a','A','a','c','c'), cset set('b','B','b','d','d'));
-drop table t1, t2, t3;
-
-#
-# Bug #1209
-#
-
-create database mysqltest;
-use mysqltest;
-select database();
-drop database mysqltest;
-select database();
-
-# Connect without a database as user mysqltest_1
-create user mysqltest_1;
-connect (user1,localhost,mysqltest_1,,*NO-ONE*);
-connection user1;
-select database(), user();
-connection default;
-disconnect user1;
-drop user mysqltest_1;
-use test;
-
-#
-# Test for Bug 856 'Naming a key "Primary" causes trouble'
-#
-
---error 1280
-create table t1 (a int, index `primary` (a));
---error 1280
-create table t1 (a int, index `PRIMARY` (a));
-
-create table t1 (`primary` int, index(`primary`));
-show create table t1;
-create table t2 (`PRIMARY` int, index(`PRIMARY`));
-show create table t2;
-
-create table t3 (a int);
---error 1280
-alter table t3 add index `primary` (a);
---error 1280
-alter table t3 add index `PRIMARY` (a);
-
-create table t4 (`primary` int);
-alter table t4 add index(`primary`);
-show create table t4;
-create table t5 (`PRIMARY` int);
-alter table t5 add index(`PRIMARY`);
-show create table t5;
-
-drop table t1, t2, t3, t4, t5;
-
-#
-# bug #3266 TEXT in CREATE TABLE SELECT
-#
-
-CREATE TABLE t1(id varchar(10) NOT NULL PRIMARY KEY, dsc longtext);
-INSERT INTO t1 VALUES ('5000000001', NULL),('5000000003', 'Test'),('5000000004', NULL);
-CREATE TABLE t2(id varchar(15) NOT NULL, proc varchar(100) NOT NULL, runID varchar(16) NOT NULL, start datetime NOT NULL, PRIMARY KEY (id,proc,runID,start));
-
-INSERT INTO t2 VALUES ('5000000001', 'proc01', '20031029090650', '2003-10-29 13:38:40'),('5000000001', 'proc02', '20031029090650', '2003-10-29 13:38:51'),('5000000001', 'proc03', '20031029090650', '2003-10-29 13:38:11'),('5000000002', 'proc09', '20031024013310', '2003-10-24 01:33:11'),('5000000002', 'proc09', '20031024153537', '2003-10-24 15:36:04'),('5000000004', 'proc01', '20031024013641', '2003-10-24 01:37:29'),('5000000004', 'proc02', '20031024013641', '2003-10-24 01:37:39');
-
-CREATE TABLE t3 SELECT t1.dsc,COUNT(DISTINCT t2.id) AS countOfRuns FROM t1 LEFT JOIN t2 ON (t1.id=t2.id) GROUP BY t1.id;
-SELECT * FROM t3;
-drop table t1, t2, t3;
-
-#
-# Bug#9666: Can't use 'DEFAULT FALSE' for column of type bool
-#
-create table t1 (b bool not null default false);
-create table t2 (b bool not null default true);
-insert into t1 values ();
-insert into t2 values ();
-select * from t1;
-select * from t2;
-drop table t1,t2;
-
-#
-# Bug#10224 - ANALYZE TABLE crashing with simultaneous
-# CREATE ... SELECT statement.
-# This tests two additional possible errors and a hang if
-# an improper fix is present.
-#
-create table t1 (a int);
---error ER_TABLE_EXISTS_ERROR
-create table t1 select * from t1;
---error ER_WRONG_OBJECT
-create table t2 union = (t1) select * from t1;
-flush tables with read lock;
-unlock tables;
-drop table t1;
-
-#
-# Bug#10413: Invalid column name is not rejected
-#
---error 1103
-create table t1(column.name int);
---error 1103
-create table t1(test.column.name int);
---error 1102
-create table t1(xyz.t1.name int);
-create table t1(t1.name int);
-create table t2(test.t2.name int);
-drop table t1,t2;
-
-#
-# Bug #12537: UNION produces longtext instead of varchar
-#
-CREATE TABLE t1 (f1 VARCHAR(255) CHARACTER SET utf8);
-CREATE TABLE t2 AS SELECT LEFT(f1,171) AS f2 FROM t1 UNION SELECT LEFT(f1,171) AS f2 FROM t1;
-DESC t2;
-DROP TABLE t1,t2;
-
-#
-# Bug#12913 Simple SQL can crash server or connection
-#
-CREATE TABLE t12913 (f1 ENUM ('a','b')) AS SELECT 'a' AS f1;
-SELECT * FROM t12913;
-DROP TABLE t12913;
-
-#
-# Bug#11028: Crash on create table like
-#
-create database mysqltest;
-use mysqltest;
-drop database mysqltest;
---error ER_NO_DB_ERROR
-create table test.t1 like x;
---disable_warnings
-drop table if exists test.t1;
---enable_warnings
-
-#
-# Bug #6859: Bogus error message on attempt to CREATE TABLE t LIKE view
-#
-create database mysqltest;
-use mysqltest;
-create view v1 as select 'foo' from dual;
---error 1347
-create table t1 like v1;
-drop view v1;
-drop database mysqltest;
-# Bug #6008 MySQL does not create warnings when
-# creating database and using IF NOT EXISTS
-#
-create database mysqltest;
-create database if not exists mysqltest character set latin2;
-show create database mysqltest;
-drop database mysqltest;
-use test;
-create table t1 (a int);
-create table if not exists t1 (a int);
-drop table t1;
-
-# BUG#14139
-create table t1 (
- a varchar(112) charset utf8 collate utf8_bin not null,
- primary key (a)
-) select 'test' as a ;
-#--warning 1364
-show create table t1;
-drop table t1;
-
-#
-# BUG#14480: assert failure in CREATE ... SELECT because of wrong
-# calculation of number of NULLs.
-#
-CREATE TABLE t2 (
- a int(11) default NULL
-);
-insert into t2 values(111);
-
-#--warning 1364
-create table t1 (
- a varchar(12) charset utf8 collate utf8_bin not null,
- b int not null, primary key (a)
-) select a, 1 as b from t2 ;
-show create table t1;
-drop table t1;
-
-#--warning 1364
-create table t1 (
- a varchar(12) charset utf8 collate utf8_bin not null,
- b int not null, primary key (a)
-) select a, 1 as c from t2 ;
-show create table t1;
-drop table t1;
-
-#--warning 1364
-create table t1 (
- a varchar(12) charset utf8 collate utf8_bin not null,
- b int null, primary key (a)
-) select a, 1 as c from t2 ;
-show create table t1;
-drop table t1;
-
-#--warning 1364
-create table t1 (
- a varchar(12) charset utf8 collate utf8_bin not null,
- b int not null, primary key (a)
-) select 'a' as a , 1 as b from t2 ;
-show create table t1;
-drop table t1;
-
-#--warning 1364
-create table t1 (
- a varchar(12) charset utf8 collate utf8_bin,
- b int not null, primary key (a)
-) select 'a' as a , 1 as b from t2 ;
-show create table t1;
-drop table t1, t2;
-
-create table t1 (
- a1 int not null,
- a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int
-);
-insert into t1 values (1,1,1, 1,1,1, 1,1,1);
-
-#--warning 1364
-create table t2 (
- a1 varchar(12) charset utf8 collate utf8_bin not null,
- a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int,
- primary key (a1)
-) select a1,a2,a3,a4,a5,a6,a7,a8,a9 from t1 ;
-drop table t2;
-
-#--warning 1364
-create table t2 (
- a1 varchar(12) charset utf8 collate utf8_bin,
- a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int
-) select a1,a2,a3,a4,a5,a6,a7,a8,a9 from t1;
-
-drop table t1, t2;
-#--warning 1364
-create table t1 (
- a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int
-);
-insert into t1 values (1,1,1, 1,1,1, 1,1,1);
-
-#--warning 1364
-create table t2 (
- a1 varchar(12) charset utf8 collate utf8_bin not null,
- a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int,
- primary key (a1)
-) select a1,a2,a3,a4,a5,a6,a7,a8,a9 from t1 ;
-
-# Test the default value
-drop table t2;
-
-create table t2 ( a int default 3, b int default 3)
- select a1,a2 from t1;
-show create table t2;
-
-drop table t1, t2;
-
-#
-# Bug #15316 SET value having comma not correctly handled
-#
---error 1367
-create table t1(a set("a,b","c,d") not null);
-
-# End of 4.1 tests
-
-
-#
-# Bug #14155: Maximum value of MAX_ROWS handled incorrectly on 64-bit
-# platforms
-#
-create table t1 (i int) engine=myisam max_rows=100000000000;
-show create table t1;
-alter table t1 max_rows=100;
-show create table t1;
-alter table t1 max_rows=100000000000;
-show create table t1;
-drop table t1;
-
-
-#
-# Tests for errors happening at various stages of CREATE TABLES ... SELECT
-#
-# (Also checks that it behaves atomically in the sense that in case
-# of error it is automatically dropped if it has not existed before.)
-#
-# Error during open_and_lock_tables() of tables
---error ER_NO_SUCH_TABLE
-create table t1 select * from t2;
-# A special case which is also caught during open tables pahse
---error ER_NO_SUCH_TABLE
-create table t1 select * from t1;
-# Error which happens before select_create::prepare()
---error ER_CANT_AGGREGATE_2COLLATIONS
-create table t1 select coalesce('a' collate latin1_swedish_ci,'b' collate latin1_bin);
-# Error during table creation
---error ER_KEY_COLUMN_DOES_NOT_EXITS
-create table t1 (primary key(a)) select "b" as b;
-# Error in select_create::prepare() which is not related to table creation
-create table t1 (a int);
-create table if not exists t1 select 1 as a, 2 as b;
-drop table t1;
-# Finally error which happens during insert
---error ER_DUP_ENTRY
-create table t1 (primary key (a)) (select 1 as a) union all (select 1 as a);
-# What happens if table already exists ?
-create table t1 (i int);
---error ER_TABLE_EXISTS_ERROR
-create table t1 select 1 as i;
-create table if not exists t1 select 1 as i;
-select * from t1;
-# After WL#5370, it just generates a warning that the table already exists.
-create table if not exists t1 select * from t1;
-select * from t1;
-drop table t1;
-# Error before select_create::prepare()
---error ER_CANT_AGGREGATE_2COLLATIONS
-create table t1 select coalesce('a' collate latin1_swedish_ci,'b' collate latin1_bin);
-
-
-# Base vs temporary tables dillema (a.k.a. bug#24508 "Inconsistent
-# results of CREATE TABLE ... SELECT when temporary table exists").
-# In this situation we either have to create non-temporary table and
-# insert data in it or insert data in temporary table without creation of
-# permanent table. After patch for Bug#47418, we create the base table and
-# instert data into it, even though a temporary table exists with the same
-# name.
-create temporary table t1 (j int);
-create table if not exists t1 select 1;
-select * from t1;
-drop temporary table t1;
-select * from t1;
-drop table t1;
-
-
-#
-# CREATE TABLE ... SELECT and LOCK TABLES
-#
-# There is little sense in using CREATE TABLE ... SELECT under
-# LOCK TABLES as it mostly does not work. At least we check that
-# the server doesn't crash, hang and produces sensible errors.
-# Includes test for bug #20662 "Infinite loop in CREATE TABLE
-# IF NOT EXISTS ... SELECT with locked tables".
-create table t1 (i int);
-insert into t1 values (1), (2);
-lock tables t1 read;
---error ER_TABLE_NOT_LOCKED
-create table t2 select * from t1;
---error ER_TABLE_NOT_LOCKED
-create table if not exists t2 select * from t1;
-unlock tables;
-create table t2 (j int);
-lock tables t1 read;
---error ER_TABLE_NOT_LOCKED
-create table t2 select * from t1;
-# This should not be ever allowed as it will undermine
-# lock-all-at-once approach
---error ER_TABLE_NOT_LOCKED
-create table if not exists t2 select * from t1;
-unlock tables;
-lock table t1 read, t2 read;
---error ER_TABLE_NOT_LOCKED_FOR_WRITE
-create table t2 select * from t1;
---error ER_TABLE_NOT_LOCKED_FOR_WRITE
-create table if not exists t2 select * from t1;
-unlock tables;
-lock table t1 read, t2 write;
---error ER_TABLE_EXISTS_ERROR
-create table t2 select * from t1;
-# This is the only case which really works.
-create table if not exists t2 select * from t1;
-select * from t1;
-unlock tables;
-drop table t2;
-
-# OTOH CREATE TEMPORARY TABLE ... SELECT should work
-# well under LOCK TABLES.
-lock tables t1 read;
-create temporary table t2 select * from t1;
-create temporary table if not exists t2 select * from t1;
-select * from t2;
-unlock tables;
-drop table t1, t2;
-
-
-#
-# Bug#21772: can not name a column 'upgrade' when create a table
-#
-create table t1 (upgrade int);
-drop table t1;
-
-
-#
-# Bug #26642: create index corrupts table definition in .frm
-#
-# Problem with creating keys with maximum key-parts and maximum name length
-# This test is made for a mysql server supporting names up to 64 bytes
-# and a maximum of 16 key segements per Key
-#
-
-create table t1 (
- c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, c8 int,
- c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int,
-
- key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16)
-);
-
-# Check that the table is not corrupted
-show create table t1;
-flush tables;
-show create table t1;
-
-# Repeat test using ALTER to add indexes
-
-drop table t1;
-create table t1 (c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int,
-c8 int, c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int);
-
-alter table t1
-
- add key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- add key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- add key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- add key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- add key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- add key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
-
- add key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
- add key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
-
-show create table t1;
-flush tables;
-show create table t1;
-
-# Test the server limits; if any of these pass, all above tests need
-# to be rewritten to hit the limit
-#
-# Ensure limit is really 64 keys
---error 1069
-alter table t1 add key
- a065_long_123456789_123456789_123456789_123456789_123456789_1234 (
- c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
-
-drop table t1;
-
-# Ensure limit is really 16 key parts per key
-
-create table t1 (c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int,
-c8 int, c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int,
-c16 int, c17 int, c18 int,c19 int,c20 int,c21 int,c22 int,c23 int,c24 int,c25 int,c26 int,c27 int,c28 int,c29 int,c30 int,c31 int,c32 int, c33 int);
-
-# Get error for max key parts
---error 1070
-alter table t1 add key i1 (
- 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,c33);
-
-# Get error for max key-name length
---error 1059
-alter table t1 add key
- a001_long_123456789_123456789_123456789_123456789_123456789_12345 (c1);
-
-show create table t1;
-
-drop table t1;
-
---echo
---echo Bug #26104 Bug on foreign key class constructor
---echo
---echo Check that ref_columns is initalized correctly in the constructor
---echo and semantic checks in mysql_prepare_table work.
---echo
---echo We do not need a storage engine that supports foreign keys
---echo for this test, as the checks are purely syntax-based, and the
---echo syntax is supported for all engines.
---echo
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-create table t1(a int not null, b int not null, primary key (a, b));
---error ER_WRONG_FK_DEF
-create table t2(a int not null, b int not null, c int not null, primary key (a),
-foreign key fk_bug26104 (b,c) references t1(a));
-drop table t1;
-
-#
-# Bug#15130:CREATE .. SELECT was denied to use advantages of the SQL_BIG_RESULT.
-#
-create table t1(f1 int,f2 int);
-insert into t1 value(1,1),(1,2),(1,3),(2,1),(2,2),(2,3);
-flush status;
-create table t2 select sql_big_result f1,count(f2) from t1 group by f1;
-show status like 'handler_read%';
-drop table t1,t2;
-
-#
-# Bug #25162: Backing up DB from 5.1 adds 'USING BTREE' to KEYs on table creates
-#
-
-# Show that the old syntax for index type is supported
-CREATE TABLE t1(c1 VARCHAR(33), KEY USING BTREE (c1));
-DROP TABLE t1;
-
-# Show that the new syntax for index type is supported
-CREATE TABLE t1(c1 VARCHAR(33), KEY (c1) USING BTREE);
-DROP TABLE t1;
-
-# Show that in case of multiple index type definitions, the last one takes
-# precedence
-
-CREATE TABLE t1(c1 VARCHAR(33), KEY USING BTREE (c1) USING HASH) ENGINE=MEMORY;
-SHOW INDEX FROM t1;
-DROP TABLE t1;
-
-CREATE TABLE t1(c1 VARCHAR(33), KEY USING HASH (c1) USING BTREE) ENGINE=MEMORY;
-SHOW INDEX FROM t1;
-DROP TABLE t1;
-
-#
-# Bug#35924 DEFINER should be stored 'quoted' in I_S
-#
---error ER_UNKNOWN_ERROR
-create user mysqltest_1@'test@test';
-
-#
-# Bug#38821: Assert table->auto_increment_field_not_null failed in open_table()
-#
-CREATE TABLE t1 (a INTEGER AUTO_INCREMENT PRIMARY KEY, b INTEGER NOT NULL);
-INSERT IGNORE INTO t1 (b) VALUES (5);
-
-CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)
- SELECT a FROM t1;
---error 1062
-INSERT INTO t2 SELECT a FROM t1;
---error 1062
-INSERT INTO t2 SELECT a FROM t1;
-
-DROP TABLE t1, t2;
-
---echo #
---echo # BUG#46384 - mysqld segfault when trying to create table with same
---echo # name as existing view
---echo #
-
-CREATE TABLE t1 (a INT);
-CREATE TABLE t2 (a INT);
-
-INSERT INTO t1 VALUES (1),(2),(3);
-INSERT INTO t2 VALUES (1),(2),(3);
-
-CREATE VIEW v1 AS SELECT t1.a FROM t1, t2;
---error ER_TABLE_EXISTS_ERROR
-CREATE TABLE v1 AS SELECT * FROM t1;
-
-DROP VIEW v1;
-DROP TABLE t1,t2;
-
---echo End of 5.0 tests
-
-#
-# Test of behaviour with CREATE ... SELECT
-#
-
-CREATE TABLE t1 (a int, b int);
-insert into t1 values (1,1),(1,2);
---error ER_DUP_ENTRY
-CREATE TABLE t2 (primary key (a)) select * from t1;
-# This should give warning
-drop table if exists t2;
---error ER_DUP_ENTRY
-CREATE TEMPORARY TABLE t2 (primary key (a)) select * from t1;
-# This should give warning
-drop table if exists t2;
-CREATE TABLE t2 (a int, b int, primary key (a));
---error ER_DUP_ENTRY
-INSERT INTO t2 select * from t1;
-SELECT * from t2;
-TRUNCATE table t2;
---error ER_DUP_ENTRY
-INSERT INTO t2 select * from t1;
-SELECT * from t2;
-drop table t2;
-
-CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a));
---error ER_DUP_ENTRY
-INSERT INTO t2 SELECT * FROM t1;
-SELECT * from t2;
-drop table t1,t2;
-
-
-#
-# Test incorrect database names
-#
-
---error 1102
-CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
---error 1102
-DROP DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
-
-# TODO: enable these tests when RENAME DATABASE is implemented.
-# --error 1049
-# RENAME DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa TO a;
-# --error 1102
-# RENAME DATABASE mysqltest TO aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
-# create database mysqltest;
-# --error 1102
-# RENAME DATABASE mysqltest TO aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
-# drop database mysqltest;
-
---error 1102
-USE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
---error 1102
-SHOW CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/date_formats.test b/mysql-test/suite/pbxt/t/date_formats.test
deleted file mode 100644
index f09ce295659..00000000000
--- a/mysql-test/suite/pbxt/t/date_formats.test
+++ /dev/null
@@ -1,347 +0,0 @@
-#
-# Test of date format functions
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-SELECT variable_name, variable_value
-FROM information_schema.global_variables
-WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
-ORDER BY variable_name;
-
-SELECT variable_name, variable_value
-FROM information_schema.session_variables
-WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
-ORDER BY variable_name;
-
-#
-# The following tests will work only when we at some point will enable
-# dynamic changing of formats
-#
-
-# SET time_format='%H%i%s';
-# SET time_format='%H:%i:%s.%f';
-# SET time_format='%h-%i-%s.%f%p';
-# SET time_format='%h:%i:%s.%f %p';
-# SET time_format='%h:%i:%s%p';
-#
-# SET date_format='%Y%m%d';
-# SET date_format='%Y.%m.%d';
-# SET date_format='%d.%m.%Y';
-# SET date_format='%m-%d-%Y';
-#
-# set datetime_format= '%Y%m%d%H%i%s';
-# set datetime_format= '%Y-%m-%d %H:%i:%s';
-# set datetime_format= '%m-%d-%y %H:%i:%s.%f';
-# set datetime_format= '%d-%m-%Y %h:%i:%s%p';
-# set datetime_format= '%H:%i:%s %Y-%m-%d';
-# set datetime_format= '%H:%i:%s.%f %m-%d-%Y';
-# set datetime_format= '%h:%i:%s %p %Y-%m-%d';
-# set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d';
-#
-# SELECT variable_name, variable_value
-# FROM information_schema.session_variables
-# WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
-# ORDER BY variable_name;
-#
-# --error 1231
-# SET time_format='%h:%i:%s';
-# --error 1231
-# SET time_format='%H %i:%s';
-# --error 1231
-# SET time_format='%H::%i:%s';
-# --error 1231
-# SET time_format='%H:%i:%s%f';
-# --error 1231
-# SET time_format='%H:%i.%f:%s';
-# --error 1231
-# SET time_format='%H:%i:%s%p';
-# --error 1231
-# SET time_format='%h:%i:%s.%f %p %Y-%m-%d';
-# --error 1231
-# SET time_format='%H%i%s.%f';
-# --error 1231
-# SET time_format='%H:%i-%s.%f';
-# --error 1231
-# SET date_format='%d.%m.%d';
-# --error 1231
-# SET datetime_format='%h.%m.%y %d.%i.%s';
-# --error 1231
-# set datetime_format= '%H:%i:%s.%f %p %Y-%m-%d';
-#
-# #
-# # Test GLOBAL values
-#
-# set GLOBAL datetime_format= '%H:%i:%s %Y-%m-%d';
-# SET SESSION datetime_format=default;
-# select @@global.datetime_format, @@session.datetime_format;
-# SET GLOBAL datetime_format=default;
-# SET SESSION datetime_format=default;
-# select @@global.datetime_format, @@session.datetime_format;
-#
-# SET GLOBAL date_format=default;
-# SET GLOBAL time_format=default;
-# SET GLOBAL datetime_format=default;
-# SET time_format=default;
-# SET date_format=default;
-# SET datetime_format=default;
-
-# SET date_format='%d.%m.%Y';
-# select CAST('01.01.2001' as DATE) as a;
-# SET datetime_format='%d.%m.%Y %H.%i.%s';
-# select CAST('01.01.2001 05.12.06' as DATETIME) as a;
-# SET time_format='%H.%i.%s';
-# select CAST('05.12.06' as TIME) as a;
-#
-# SET datetime_format='%d.%m.%Y %h:%i:%s %p';
-# select CAST('01.01.2001 05:12:06AM' as DATETIME) as a;
-# select CAST('01.01.2001 05:12:06 PM' as DATETIME) as a;
-#
-# SET time_format='%h:%i:%s %p';
-# select CAST('05:12:06 AM' as TIME) as a;
-# select CAST('05:12:06.1234PM' as TIME) as a;
-#
-# SET time_format='%h.%i.%s %p';
-# SET date_format='%d.%m.%y';
-# SET datetime_format='%d.%m.%y %h.%i.%s %p';
-# select CAST('12-12-06' as DATE) as a;
-#
-# select adddate('01.01.97 11.59.59.000001 PM', 10);
-# select datediff('31.12.97 11.59:59.000001 PM','01.01.98');
-# select weekofyear('31.11.97 11:59:59.000001 PM');
-# select makedate(1997,1);
-# select addtime('31.12.97 11.59.59.999999 PM', '1 1.1.1.000002');
-# select maketime(23,11,12);
-# select timediff('01.01.97 11:59:59.000001 PM','31.12.95 11:59:59.000002 PM');
-#
-# SET time_format='%i:%s:%H';
-# select cast(str_to_date('15-01-2001 12:59:59', '%d-%m-%Y %H:%i:%S') as TIME);
-
-#
-# Test of str_to_date
-#
-
-# PS doesn't support fractions of a second
---disable_ps_protocol
-select str_to_date(concat('15-01-2001',' 2:59:58.999'),
- concat('%d-%m-%Y',' ','%H:%i:%s.%f'));
-select STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T');
---enable_ps_protocol
-
-create table t1 (date char(30), format char(30) not null);
-insert into t1 values
-('2003-01-02 10:11:12', '%Y-%m-%d %H:%i:%S'),
-('03-01-02 8:11:2.123456', '%y-%m-%d %H:%i:%S.%#'),
-('0003-01-02 8:11:2.123456', '%Y-%m-%d %H:%i:%S.%#'),
-('03-01-02 8:11:2.123456', '%Y-%m-%d %H:%i:%S.%#'),
-('2003-01-02 10:11:12 PM', '%Y-%m-%d %h:%i:%S %p'),
-('2003-01-02 01:11:12.12345AM', '%Y-%m-%d %h:%i:%S.%f%p'),
-('2003-01-02 02:11:12.12345AM', '%Y-%m-%d %h:%i:%S.%f %p'),
-('2003-01-02 12:11:12.12345 am', '%Y-%m-%d %h:%i:%S.%f%p'),
-('2003-01-02 11:11:12Pm', '%Y-%m-%d %h:%i:%S%p'),
-('10:20:10', '%H:%i:%s'),
-('10:20:10', '%h:%i:%s.%f'),
-('10:20:10', '%T'),
-('10:20:10AM', '%h:%i:%s%p'),
-('10:20:10AM', '%r'),
-('10:20:10.44AM', '%h:%i:%s.%f%p'),
-('15-01-2001 12:59:58', '%d-%m-%Y %H:%i:%S'),
-('15 September 2001', '%d %M %Y'),
-('15 SEPTEMB 2001', '%d %M %Y'),
-('15 MAY 2001', '%d %b %Y'),
-('15th May 2001', '%D %b %Y'),
-('Sunday 15 MAY 2001', '%W %d %b %Y'),
-('Sund 15 MAY 2001', '%W %d %b %Y'),
-('Tuesday 00 2002', '%W %U %Y'),
-('Thursday 53 1998', '%W %u %Y'),
-('Sunday 01 2001', '%W %v %x'),
-('Tuesday 52 2001', '%W %V %X'),
-('060 2004', '%j %Y'),
-('4 53 1998', '%w %u %Y'),
-('15-01-2001', '%d-%m-%Y %H:%i:%S'),
-('15-01-20', '%d-%m-%y'),
-('15-2001-1', '%d-%Y-%c');
-
-# PS doesn't support fractional seconds
---disable_ps_protocol
-select date,format,str_to_date(date, format) as str_to_date from t1;
-# Use as a string
-select date,format,concat('',str_to_date(date, format)) as con from t1;
-# Use as datetime
-select date,format,cast(str_to_date(date, format) as datetime) as datetime from t1;
-select date,format,DATE(str_to_date(date, format)) as date2 from t1;
-select date,format,TIME(str_to_date(date, format)) as time from t1;
-select date,format,concat(TIME(str_to_date(date, format))) as time2 from t1;
-# Test small bug in %f handling
-select concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d'));
-
-# Test wrong dates or converion specifiers
-
-truncate table t1;
-insert into t1 values
-('2003-01-02 10:11:12 PM', '%Y-%m-%d %H:%i:%S %p'),
-('2003-01-02 10:11:12.123456', '%Y-%m-%d %h:%i:%S %p'),
-('2003-01-02 10:11:12AM', '%Y-%m-%d %h:%i:%S.%f %p'),
-('2003-01-02 10:11:12AN', '%Y-%m-%d %h:%i:%S%p'),
-('2003-01-02 10:11:12 PM', '%y-%m-%d %H:%i:%S %p'),
-('10:20:10AM', '%H:%i:%s%p'),
-('15 Septembei 2001', '%d %M %Y'),
-('15 Ju 2001', '%d %M %Y'),
-('Sund 15 MA', '%W %d %b %Y'),
-('Thursdai 12 1998', '%W %u %Y'),
-('Sunday 01 2001', '%W %v %X'),
-('Tuesday 52 2001', '%W %V %x'),
-('Tuesday 52 2001', '%W %V %Y'),
-('Tuesday 52 2001', '%W %u %x'),
-('7 53 1998', '%w %u %Y'),
-(NULL, get_format(DATE,'USA'));
-select date,format,str_to_date(date, format) as str_to_date from t1;
-select date,format,concat(str_to_date(date, format),'') as con from t1;
-
-# Test 'maybe' date formats and 'strange but correct' results
-
-truncate table t1;
-insert into t1 values
-('10:20:10AM', '%h:%i:%s'),
-('2003-01-02 10:11:12', '%Y-%m-%d %h:%i:%S'),
-('03-01-02 10:11:12 PM', '%Y-%m-%d %h:%i:%S %p');
-
-select date,format,str_to_date(date, format) as str_to_date from t1;
-select date,format,concat(str_to_date(date, format),'') as con from t1;
-
-drop table t1;
---enable_ps_protocol
-
-#
-# Test of get_format
-#
-
-select get_format(DATE, 'USA') as a;
-select get_format(TIME, 'internal') as a;
-select get_format(DATETIME, 'eur') as a;
-select get_format(TIMESTAMP, 'eur') as a;
-select get_format(DATE, 'TEST') as a;
-select str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA'));
-
-explain extended select makedate(1997,1), addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM"),cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME), maketime(23,11,12),microsecond("1997-12-31 23:59:59.000001");
-
-#
-# Test of date_format()
-#
-
-create table t1 (d date);
-insert into t1 values ('2004-07-14'),('2005-07-14');
-select date_format(d,"%d") from t1 order by 1;
-drop table t1;
-
-# PS doesn't support fractional seconds
---disable_ps_protocol
-select str_to_date("2003-....01ABCD-02 10:11:12.0012", "%Y-%.%m%@-%d %H:%i:%S.%f") as a;
-
-
-create table t1 select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f") as f1,
- str_to_date("10:11:12.0012", "%H:%i:%S.%f") as f2,
- str_to_date("2003-01-02", "%Y-%m-%d") as f3,
- str_to_date("02", "%d") as f4, str_to_date("02 10", "%d %H") as f5;
-describe t1;
-select * from t1;
-drop table t1;
-
-create table t1 select "02 10" as a, "%d %H" as b;
-select str_to_date(a,b) from t1;
-create table t2 select str_to_date(a,b) from t1;
-describe t2;
-select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f") as f1,
- str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S") as f2,
- str_to_date("2003-01-02", "%Y-%m-%d") as f3,
- str_to_date("02 10:11:12", "%d %H:%i:%S.%f") as f4,
- str_to_date("02 10:11:12", "%d %H:%i:%S") as f5,
- str_to_date("02 10", "%d %f") as f6;
-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,
- microsecond("1997-12-31 23:59:59.01XXXX") as f3;
-
-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;
---enable_ps_protocol
-
-#
-# Test of locale dependent date format (WL#2928 Date Translation NRE)
-#
-set names latin1;
-select date_format('2004-01-01','%W (%a), %e %M (%b) %Y');
-set lc_time_names=ru_RU;
-set names koi8r;
-select date_format('2004-01-01','%W (%a), %e %M (%b) %Y');
-set lc_time_names=de_DE;
-set names latin1;
-select date_format('2004-01-01','%W (%a), %e %M (%b) %Y');
-set names latin1;
-set lc_time_names=en_US;
-
-#
-# Bug #14016
-#
-create table t1 (f1 datetime);
-insert into t1 (f1) values ("2005-01-01");
-insert into t1 (f1) values ("2005-02-01");
-select date_format(f1, "%m") as d1, date_format(f1, "%M") as d2 from t1 order by date_format(f1, "%M");
-drop table t1;
-
-#
-# Bug #15828
-#
-select str_to_date( 1, NULL );
-select str_to_date( NULL, 1 );
-select str_to_date( 1, IF(1=1,NULL,NULL) );
-
-#
-# Bug#11326
-# TIME_FORMAT using "%r" returns wrong hour using 24:00:00 in TIME column
-#
-# This tests that 24:00:00 does not return PM, when it should be AM.
-# Some other values are being tested same time.
-#
-
-SELECT TIME_FORMAT("24:00:00", '%r');
-SELECT TIME_FORMAT("00:00:00", '%r');
-SELECT TIME_FORMAT("12:00:00", '%r');
-SELECT TIME_FORMAT("15:00:00", '%r');
-SELECT TIME_FORMAT("01:00:00", '%r');
-SELECT TIME_FORMAT("25:00:00", '%r');
-
-#
-# Bug#11324
-# TIME_FORMAT using "%l:%i" returns 36:00 with 24:00:00 in TIME column
-#
-# This tests that 24:00:00 does not change to "36:00 AM". Testing
-# some other values same time.
-#
-
-SELECT TIME_FORMAT("00:00:00", '%l %p');
-SELECT TIME_FORMAT("01:00:00", '%l %p');
-SELECT TIME_FORMAT("12:00:00", '%l %p');
-SELECT TIME_FORMAT("23:00:00", '%l %p');
-SELECT TIME_FORMAT("24:00:00", '%l %p');
-SELECT TIME_FORMAT("25:00:00", '%l %p');
-
-#
-# Bug#20729: Bad date_format() call makes mysql server crash
-#
-SELECT DATE_FORMAT('%Y-%m-%d %H:%i:%s', 1151414896);
-
-#
-# Bug #22029: str_to_date returning NULL
-#
-
-select str_to_date('04 /30/2004', '%m /%d/%Y');
-select str_to_date('04/30 /2004', '%m /%d /%Y');
-select str_to_date('04/30/2004 ', '%m/%d/%Y ');
-
---disable_query_log
-drop database pbxt;
---enable_query_log
---echo "End of 4.1 tests"
diff --git a/mysql-test/suite/pbxt/t/default.test b/mysql-test/suite/pbxt/t/default.test
deleted file mode 100644
index ea3786c7d3b..00000000000
--- a/mysql-test/suite/pbxt/t/default.test
+++ /dev/null
@@ -1,145 +0,0 @@
-#
-# test of already fixed bugs
-#
---disable_warnings
-drop table if exists t1,t2,t3,t4,t5,t6;
-drop database if exists mysqltest;
-
-#
-# Bug 10838
-# Insert causes warnings for no default values and corrupts tables
-#
-CREATE TABLE t1 (a varchar(30) binary NOT NULL DEFAULT ' ',
- b varchar(1) binary NOT NULL DEFAULT ' ',
- c varchar(4) binary NOT NULL DEFAULT '0000',
- d tinyblob NULL,
- e tinyblob NULL,
- f tinyblob NULL,
- g tinyblob NULL,
- h tinyblob NULL,
- i tinyblob NULL,
- j tinyblob NULL,
- k tinyblob NULL,
- l tinyblob NULL,
- m tinyblob NULL,
- n tinyblob NULL,
- o tinyblob NULL,
- p tinyblob NULL,
- q varchar(30) binary NOT NULL DEFAULT ' ',
- r varchar(30) binary NOT NULL DEFAULT ' ',
- s tinyblob NULL,
- t varchar(4) binary NOT NULL DEFAULT ' ',
- u varchar(1) binary NOT NULL DEFAULT ' ',
- v varchar(30) binary NOT NULL DEFAULT ' ',
- w varchar(30) binary NOT NULL DEFAULT ' ',
- x tinyblob NULL,
- y varchar(5) binary NOT NULL DEFAULT ' ',
- z varchar(20) binary NOT NULL DEFAULT ' ',
- a1 varchar(30) binary NOT NULL DEFAULT ' ',
- b1 tinyblob NULL)
-ENGINE=InnoDB DEFAULT CHARACTER SET = latin1 COLLATE latin1_bin;
---enable_warnings
-
-INSERT into t1 (b) values ('1');
-SHOW WARNINGS;
-SELECT * from t1;
-
-CREATE TABLE t2 (a varchar(30) binary NOT NULL DEFAULT ' ',
- b varchar(1) binary NOT NULL DEFAULT ' ',
- c varchar(4) binary NOT NULL DEFAULT '0000',
- d tinyblob NULL,
- e tinyblob NULL,
- f tinyblob NULL,
- g tinyblob NULL,
- h tinyblob NULL,
- i tinyblob NULL,
- j tinyblob NULL,
- k tinyblob NULL,
- l tinyblob NULL,
- m tinyblob NULL,
- n tinyblob NULL,
- o tinyblob NULL,
- p tinyblob NULL,
- q varchar(30) binary NOT NULL DEFAULT ' ',
- r varchar(30) binary NOT NULL DEFAULT ' ',
- s tinyblob NULL,
- t varchar(4) binary NOT NULL DEFAULT ' ',
- u varchar(1) binary NOT NULL DEFAULT ' ',
- v varchar(30) binary NOT NULL DEFAULT ' ',
- w varchar(30) binary NOT NULL DEFAULT ' ',
- x tinyblob NULL,
- y varchar(5) binary NOT NULL DEFAULT ' ',
- z varchar(20) binary NOT NULL DEFAULT ' ',
- a1 varchar(30) binary NOT NULL DEFAULT ' ',
- b1 tinyblob NULL)
-ENGINE=MyISAM DEFAULT CHARACTER SET = latin1 COLLATE latin1_bin;
-
-SHOW CREATE TABLE t2;
-INSERT into t2 (b) values ('1');
-SHOW WARNINGS;
-SELECT * from t2;
-
-drop table t1;
-drop table t2;
-
-
-#
-# Bug#20691: DATETIME col (NOT NULL, NO DEFAULT) may insert garbage when specifying DEFAULT
-#
-# From the docs:
-# If the column can take NULL as a value, the column is defined with an
-# explicit DEFAULT NULL clause. This is the same as before 5.0.2.
-#
-# If the column cannot take NULL as the value, MySQL defines the column with
-# no explicit DEFAULT clause. For data entry, if an INSERT or REPLACE
-# statement includes no value for the column, MySQL handles the column
-# according to the SQL mode in effect at the time:
-#
-# * If strict SQL mode is not enabled, MySQL sets the column to the
-# implicit default value for the column data type.
-#
-# * If strict mode is enabled, an error occurs for transactional tables and
-# the statement is rolled back. For non-transactional tables, an error
-# occurs, but if this happens for the second or subsequent row of a
-# multiple-row statement, the preceding rows will have been inserted.
-#
-create table bug20691 (i int, d datetime NOT NULL, dn datetime not null default '0000-00-00 00:00:00');
-insert into bug20691 values (1, DEFAULT, DEFAULT), (1, '1975-07-10 07:10:03', '1978-01-13 14:08:51'), (1, DEFAULT, DEFAULT);
-insert into bug20691 (i) values (2);
-desc bug20691;
-insert into bug20691 values (3, DEFAULT, DEFAULT), (3, '1975-07-10 07:10:03', '1978-01-13 14:08:51'), (3, DEFAULT, DEFAULT);
-insert into bug20691 (i) values (4);
-insert into bug20691 values (5, DEFAULT, DEFAULT), (5, '1975-07-10 07:10:03', '1978-01-13 14:08:51'), (5, DEFAULT, DEFAULT);
-SET sql_mode = 'ALLOW_INVALID_DATES';
-insert into bug20691 values (6, DEFAULT, DEFAULT), (6, '1975-07-10 07:10:03', '1978-01-13 14:08:51'), (6, DEFAULT, DEFAULT);
-SET sql_mode = 'STRICT_ALL_TABLES';
---error 1364
-insert into bug20691 values (7, DEFAULT, DEFAULT), (7, '1975-07-10 07:10:03', '1978-01-13 14:08:51'), (7, DEFAULT, DEFAULT);
-select * from bug20691 order by i asc;
-drop table bug20691;
-
-SET sql_mode = '';
-create table bug20691 (
- a set('one', 'two', 'three') not null,
- b enum('small', 'medium', 'large', 'enormous', 'ellisonego') not null,
- c time not null,
- d date not null,
- e int not null,
- f long not null,
- g blob not null,
- h datetime not null,
- i decimal not null,
- x int);
-insert into bug20691 values (2, 3, 5, '0007-01-01', 11, 13, 17, '0019-01-01 00:00:00', 23, 1);
-insert into bug20691 (x) values (2);
-insert into bug20691 values (2, 3, 5, '0007-01-01', 11, 13, 17, '0019-01-01 00:00:00', 23, 3);
-insert into bug20691 values (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, 4);
-select * from bug20691 order by x asc;
-drop table bug20691;
-
-###
---disable_query_log
-drop database pbxt;
---enable_query_log
---echo End of 5.0 tests.
-
diff --git a/mysql-test/suite/pbxt/t/delete.test b/mysql-test/suite/pbxt/t/delete.test
deleted file mode 100644
index 913e7df3d3a..00000000000
--- a/mysql-test/suite/pbxt/t/delete.test
+++ /dev/null
@@ -1,201 +0,0 @@
-#
-# Check for problems with delete
-#
-
---disable_warnings
-drop table if exists t1,t2,t3,t11,t12;
---enable_warnings
-CREATE TABLE t1 (a tinyint(3), b tinyint(5));
-INSERT INTO t1 VALUES (1,1);
-INSERT LOW_PRIORITY INTO t1 VALUES (1,2);
-INSERT INTO t1 VALUES (1,3);
-DELETE from t1 where a=1 limit 1;
-DELETE LOW_PRIORITY from t1 where a=1;
-
-INSERT INTO t1 VALUES (1,1);
-DELETE from t1;
-LOCK TABLE t1 write;
-INSERT INTO t1 VALUES (1,2);
-DELETE from t1;
-UNLOCK TABLES;
-INSERT INTO t1 VALUES (1,2);
-SET AUTOCOMMIT=0;
-DELETE from t1;
-SET AUTOCOMMIT=1;
-drop table t1;
-
-#
-# Test of delete when the delete will cause a node to disappear and reappear
-# (This assumes a block size of 1024)
-#
-
-create table t1 (
- a bigint not null,
- b bigint not null default 0,
- c bigint not null default 0,
- d bigint not null default 0,
- e bigint not null default 0,
- f bigint not null default 0,
- g bigint not null default 0,
- h bigint not null default 0,
- i bigint not null default 0,
- j bigint not null default 0,
- primary key (a,b,c,d,e,f,g,h,i,j));
-insert into t1 (a) values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23);
-delete from t1 where a=26;
-drop table t1;
-create table t1 (
- a bigint not null,
- b bigint not null default 0,
- c bigint not null default 0,
- d bigint not null default 0,
- e bigint not null default 0,
- f bigint not null default 0,
- g bigint not null default 0,
- h bigint not null default 0,
- i bigint not null default 0,
- j bigint not null default 0,
- primary key (a,b,c,d,e,f,g,h,i,j));
-insert into t1 (a) values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27);
-delete from t1 where a=27;
-drop table t1;
-
-CREATE TABLE `t1` (
- `i` int(10) NOT NULL default '0',
- `i2` int(10) NOT NULL default '0',
- PRIMARY KEY (`i`)
-);
--- error 1054
-DELETE FROM t1 USING t1 WHERE post='1';
-drop table t1;
-
-#
-# CHAR(0) bug - not actually DELETE bug, but anyway...
-#
-
-CREATE TABLE t1 (
- bool char(0) default NULL,
- not_null varchar(20) binary NOT NULL default '',
- misc integer not null,
- PRIMARY KEY (not_null)
-) ENGINE=MyISAM;
-
-INSERT INTO t1 VALUES (NULL,'a',4), (NULL,'b',5), (NULL,'c',6), (NULL,'d',7);
-
-select * from t1 where misc > 5 and bool is null;
-delete from t1 where misc > 5 and bool is null;
-select * from t1 where misc > 5 and bool is null;
-
-select count(*) from t1;
-delete from t1 where 1 > 2;
-select count(*) from t1;
-delete from t1 where 3 > 2;
-select count(*) from t1;
-
-drop table t1;
-#
-# Bug #5733: Table handler error with self-join multi-table DELETE
-#
-
-create table t1 (a int not null auto_increment primary key, b char(32));
-insert into t1 (b) values ('apple'), ('apple');
-select * from t1;
-delete t1 from t1, t1 as t2 where t1.b = t2.b and t1.a > t2.a;
-select * from t1;
-drop table t1;
-
-#
-# IGNORE option
-#
-create table t11 (a int NOT NULL, b int, primary key (a));
-create table t12 (a int NOT NULL, b int, primary key (a));
-create table t2 (a int NOT NULL, b int, primary key (a));
-insert into t11 values (0, 10),(1, 11),(2, 12);
-insert into t12 values (33, 10),(0, 11),(2, 12);
-insert into t2 values (1, 21),(2, 12),(3, 23);
-select * from t11;
-select * from t12;
-select * from t2;
--- error 1242
-delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select b from t2 where t11.a < t2.a);
-select * from t11;
-select * from t12;
---error 1242
-delete ignore t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select b from t2 where t11.a < t2.a);
-select * from t11;
-select * from t12;
---error 1062
-insert into t11 values (2, 12);
--- error 1242
-delete from t11 where t11.b <> (select b from t2 where t11.a < t2.a);
-select * from t11;
---error 1242
-delete ignore from t11 where t11.b <> (select b from t2 where t11.a < t2.a);
-select * from t11;
-drop table t11, t12, t2;
-
-#
-# Bug #4198: deletion and KEYREAD
-#
-
-create table t1 (a int, b int, unique key (a), key (b));
-insert into t1 values (3, 3), (7, 7);
-delete t1 from t1 where a = 3;
-check table t1;
-select * from t1;
-drop table t1;
-
-#
-# Bug #8392: delete with ORDER BY containing a direct reference to the table
-#
-
-CREATE TABLE t1 ( a int PRIMARY KEY );
-DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a;
-INSERT INTO t1 VALUES (0),(1),(2);
-DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a LIMIT 1;
-SELECT * FROM t1;
-DROP TABLE t1;
-
-#
-# Bug #21392: multi-table delete with alias table name fails with
-# 1003: Incorrect table name
-#
-
-create table t1 (a int);
-delete `4.t1` from t1 as `4.t1` where `4.t1`.a = 5;
-delete FROM `4.t1` USING t1 as `4.t1` where `4.t1`.a = 5;
-drop table t1;
-
-# End of 4.1 tests
-
-#
-# Test of multi-delete where we are not scanning the first table
-#
-
-CREATE TABLE t1 (a int not null,b int not null);
-CREATE TABLE t2 (a int not null, b int not null, primary key (a,b));
-CREATE TABLE t3 (a int not null, b int not null, primary key (a,b));
-insert into t1 values (1,1),(2,1),(1,3);
-insert into t2 values (1,1),(2,2),(3,3);
-insert into t3 values (1,1),(2,1),(1,3);
-select * from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
-explain select * from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
-delete t2.*,t3.* from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
-# This should be empty
-select * from t3;
-drop table t1,t2,t3;
-
-#
-# Bug #8143: deleting '0000-00-00' values using IS NULL
-#
-
-create table t1(a date not null);
-insert into t1 values (0);
-select * from t1 where a is null;
-delete from t1 where a is null;
-select count(*) from t1;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/derived.test b/mysql-test/suite/pbxt/t/derived.test
deleted file mode 100644
index aefdd72ae24..00000000000
--- a/mysql-test/suite/pbxt/t/derived.test
+++ /dev/null
@@ -1,294 +0,0 @@
-# Initialize
---disable_warnings
-drop table if exists t1,t2,t3;
---enable_warnings
-
-set @save_derived_optimizer_switch=@@optimizer_switch;
-set optimizer_switch='derived_merge=off,derived_with_keys=off';
-
-select * from (select 2 from DUAL) b;
--- error 1054
-SELECT 1 as a FROM (SELECT 1 UNION SELECT a) b;
--- error 1054
-SELECT 1 as a FROM (SELECT a UNION SELECT 1) b;
-CREATE TABLE t1 (a int not null, b char (10) not null);
-insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
-CREATE TABLE t2 (a int not null, b char (10) not null);
-insert into t2 values (3,'c'),(4,'d'),(5,'f'),(6,'e');
-select t1.a,t3.y from t1,(select a as y from t2 where b='c') as t3 where t1.a = t3.y;
-select t1.a,t3.a from t1,(select * from t2 where b='c') as t3 where t1.a = t3.a;
-CREATE TABLE t3 (a int not null, b char (10) not null);
-insert into t3 values (3,'f'),(4,'y'),(5,'z'),(6,'c');
-select t1.a,t4.y from t1,(select t2.a as y from t2,(select t3.b from t3 where t3.a>3) as t5 where t2.b=t5.b) as t4 where t1.a = t4.y;
---error 1054
-SELECT a FROM (SELECT 1 FROM (SELECT 1) a HAVING a=1) b;
---error 1052
-SELECT a,b as a FROM (SELECT '1' as a,'2' as b) b HAVING a=1;
-SELECT a,2 as a FROM (SELECT '1' as a) b HAVING a=2;
-SELECT a,2 as a FROM (SELECT '1' as a) b HAVING a=1;
---error 1054
-SELECT 1 FROM (SELECT 1) a WHERE a=2;
---error 1054
-SELECT (SELECT 1) as a FROM (SELECT 1 FROM t1 HAVING a=1) as a;
-select * from t1 as x1, (select * from t1) as x2;
-explain select * from t1 as x1, (select * from t1) as x2;
-drop table if exists t2,t3;
-select * from (select 1) as a;
-select a from (select 1 as a) as b;
-select 1 from (select 1) as a;
-select * from (select * from t1 union select * from t1) a;
-select * from (select * from t1 union all select * from t1) a;
-select * from (select * from t1 union all select * from t1 limit 2) a;
-explain select * from (select * from t1 union select * from t1) a;
-explain select * from (select * from t1 union all select * from t1) a;
-CREATE TABLE t2 (a int not null);
-insert into t2 values(1);
-select * from (select * from t1 where t1.a=(select a from t2 where t2.a=t1.a)) a;
-select * from (select * from t1 where t1.a=(select t2.a from t2 where t2.a=t1.a) union select t1.a, t1.b from t1) a;
-explain select * from (select t1.*, t2.a as t2a from t1,t2 where t1.a=t2.a) t1;
-drop table t1, t2;
-create table t1(a int not null, t char(8), index(a));
---disable_query_log
-begin;
-let $1 = 10000;
-while ($1)
- {
- eval insert into t1 values ($1,'$1');
- dec $1;
- }
-commit;
---enable_query_log
-SELECT * FROM (SELECT * FROM t1) as b ORDER BY a ASC LIMIT 0,20;
-explain select count(*) from t1 as tt1, (select * from t1) as tt2;
-drop table t1;
-SELECT * FROM (SELECT (SELECT * FROM (SELECT 1 as a) as a )) as b;
-select * from (select 1 as a) b left join (select 2 as a) c using(a);
---error 1054
-SELECT * FROM (SELECT 1 UNION SELECT a) b;
---error 1054
-SELECT 1 as a FROM (SELECT a UNION SELECT 1) b;
---error 1054
-SELECT 1 as a FROM (SELECT 1 UNION SELECT a) b;
---error 1054
-select 1 from (select 2) a order by 0;
-
-#
-# Test of explain (bug #251)
-#
-
-create table t1 (id int);
-insert into t1 values (1),(2),(3);
-describe select * from (select * from t1 group by id) bar;
-drop table t1;
-
-#
-# test->used_keys test for derived tables
-#
-create table t1 (mat_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, matintnum CHAR(6) NOT NULL, test MEDIUMINT UNSIGNED NULL);
-create table t2 (mat_id MEDIUMINT UNSIGNED NOT NULL, pla_id MEDIUMINT UNSIGNED NOT NULL);
-insert into t1 values (NULL, 'a', 1), (NULL, 'b', 2), (NULL, 'c', 3), (NULL, 'd', 4), (NULL, 'e', 5), (NULL, 'f', 6), (NULL, 'g', 7), (NULL, 'h', 8), (NULL, 'i', 9);
-insert into t2 values (1, 100), (1, 101), (1, 102), (2, 100), (2, 103), (2, 104), (3, 101), (3, 102), (3, 105);
-
-SELECT STRAIGHT_JOIN d.pla_id, m2.mat_id FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum;
-SELECT STRAIGHT_JOIN d.pla_id, m2.test FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum;
-
-explain SELECT STRAIGHT_JOIN d.pla_id, m2.mat_id FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum;
-explain SELECT STRAIGHT_JOIN d.pla_id, m2.test FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum;
-drop table t1,t2;
-
-#
-# derived table reference
-#
-SELECT a.x FROM (SELECT 1 AS x) AS a HAVING a.x = 1;
-
-#
-# Test for select if database is not selected.
-#
-# Connect without a database as user mysqltest_1
-create user mysqltest_1;
-create table t1 select 1 as a;
-analyze table t1; # PBXT: Required to get a consitent result
-connect (con1,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,$MASTER_MYSOCK);
-connection con1;
-set optimizer_switch='derived_merge=off,derived_with_keys=off';
---error 1046
-select 2 as a from (select * from t1) b;
-use test;
-select 2 as a from (select * from t1) b;
-drop table t1;
---error 1064
-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;
-
-#
-# UPDATE/DELETE/INSERT of derived tables
-#
-create table t1 (a int);
-insert into t1 values (1),(2),(3);
--- error 1288
-update (select * from t1) as t1 set a = 5;
--- error 1064
-delete from (select * from t1);
--- error 1064
-insert into (select * from t1) values (5);
-drop table t1;
-
-#
-# deived tables with subquery inside all by one table
-#
-create table t1 (E1 INTEGER UNSIGNED NOT NULL, E2 INTEGER UNSIGNED NOT NULL, E3 INTEGER UNSIGNED NOT NULL, PRIMARY KEY(E1)
-);
-insert into t1 VALUES(1,1,1), (2,2,1);
-select count(*) from t1 INNER JOIN (SELECT A.E1, A.E2, A.E3 FROM t1 AS A WHERE A.E3 = (SELECT MAX(B.E3) FROM t1 AS B WHERE A.E2 = B.E2)) AS THEMAX ON t1.E1 = THEMAX.E2 AND t1.E1 = t1.E2;
-explain select count(*) from t1 INNER JOIN (SELECT A.E1, A.E2, A.E3 FROM t1 AS A WHERE A.E3 = (SELECT MAX(B.E3) FROM t1 AS B WHERE A.E2 = B.E2)) AS THEMAX ON t1.E1 = THEMAX.E2 AND t1.E1 = t1.E2;
-drop table t1;
-
-create table t1 (a int);
-insert into t1 values (1),(2);
-select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b;
-explain select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b;
-drop table t1;
-
-#
-# multi-update & multi-delete with derived tables
-#
-CREATE TABLE `t1` (
- `N` int(11) unsigned NOT NULL default '0',
- `M` tinyint(1) default '0'
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-INSERT INTO `t1` (N, M) VALUES (1, 0),(1, 0),(1, 0),(2, 0),(2, 0),(3, 0);
-UPDATE `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2;
-select * from t1;
--- error 1288
-UPDATE `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2, P2.N = 2;
--- error 1054
-UPDATE `t1` AS P1 INNER JOIN (SELECT aaaa FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2;
-delete P1.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
-select * from t1;
---replace_result P2 p2
---error ER_NON_UPDATABLE_TABLE
-delete P1.*,P2.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
--- error 1054
-delete P1.* from `t1` AS P1 INNER JOIN (SELECT aaa FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
-drop table t1;
-
-#
-# correct lex->current_select
-#
-CREATE TABLE t1 (
- OBJECTID int(11) NOT NULL default '0',
- SORTORDER int(11) NOT NULL auto_increment,
- KEY t1_SortIndex (SORTORDER),
- KEY t1_IdIndex (OBJECTID)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-CREATE TABLE t2 (
- ID int(11) default NULL,
- PARID int(11) default NULL,
- UNIQUE KEY t2_ID_IDX (ID),
- KEY t2_PARID_IDX (PARID)
-) engine=MyISAM DEFAULT CHARSET=latin1;
-INSERT INTO t2 VALUES (1000,0),(1001,0),(1002,0),(1003,0),(1008,1),(1009,1),(1010,1),(1011,1),(1016,2);
-CREATE TABLE t3 (
- ID int(11) default NULL,
- DATA decimal(10,2) default NULL,
- UNIQUE KEY t3_ID_IDX (ID)
-) engine=MyISAM DEFAULT CHARSET=latin1;
-INSERT INTO t3 VALUES (1000,0.00),(1001,0.25),(1002,0.50),(1003,0.75),(1008,1.00),(1009,1.25),(1010,1.50),(1011,1.75);
-select 497, TMP.ID, NULL from (select 497 as ID, MAX(t3.DATA) as DATA from t1 join t2 on (t1.ObjectID = t2.ID) join t3 on (t1.ObjectID = t3.ID) group by t2.ParID order by DATA DESC) as TMP;
-drop table t1, t2, t3;
-
-#
-# explain derived
-#
-CREATE TABLE t1 (name char(1) default NULL, val int(5) default NULL);
-INSERT INTO t1 VALUES ('a',1), ('a',2), ('a',2), ('a',2), ('a',3), ('a',6), ('a',7), ('a',11), ('a',11), ('a',12), ('a',13), ('a',13), ('a',20), ('b',2), ('b',3), ('b',4), ('b',5);
-SELECT s.name, AVG(s.val) AS median FROM (SELECT x.name, x.val FROM t1 x, t1 y WHERE x.name=y.name GROUP BY x.name, x.val HAVING SUM(y.val <= x.val) >= COUNT(*)/2 AND SUM(y.val >= x.val) >= COUNT(*)/2) AS s GROUP BY s.name;
-explain SELECT s.name, AVG(s.val) AS median FROM (SELECT x.name, x.val FROM t1 x, t1 y WHERE x.name=y.name GROUP BY x.name, x.val HAVING SUM(y.val <= x.val) >= COUNT(*)/2 AND SUM(y.val >= x.val) >= COUNT(*)/2) AS s GROUP BY s.name;
-drop table t1;
-
-#
-# "Using index" in explain
-#
-create table t2 (a int, b int, primary key (a));
-insert into t2 values (1,7),(2,7);
-explain select a from t2 where a>1;
-explain select a from (select a from t2 where a>1) tt;
-drop table t2;
-
-#
-# select list counter
-#
-CREATE TABLE `t1` ( `itemid` int(11) NOT NULL default '0', `grpid` varchar(15) NOT NULL default '', `vendor` int(11) NOT NULL default '0', `date_` date NOT NULL default '0000-00-00', `price` decimal(12,2) NOT NULL default '0.00', PRIMARY KEY (`itemid`,`grpid`,`vendor`,`date_`), KEY `itemid` (`itemid`,`vendor`), KEY `itemid_2` (`itemid`,`date_`));
-insert into t1 values (128, 'rozn', 2, curdate(), 10),
- (128, 'rozn', 1, curdate(), 10);
-SELECT MIN(price) min, MAX(price) max, AVG(price) avg FROM (SELECT SUBSTRING( MAX(concat(date_,";",price)), 12) price FROM t1 WHERE itemid=128 AND grpid='rozn' GROUP BY itemid, grpid, vendor) lastprices;
-DROP TABLE t1;
-
-#
-# DISTINCT over grouped select on subquery in the FROM clause
-#
-create table t1 (a integer, b integer);
-insert into t1 values (1,4), (2,2),(2,2), (4,1),(4,1),(4,1),(4,1);
-select distinct sum(b) from t1 group by a;
-select distinct sum(b) from (select a,b from t1) y group by a;
-drop table t1;
-
-
-#
-# Test for bug #7413 "Subquery with non-scalar results participating in
-# select list of derived table crashes server" aka "VIEW with sub query can
-# cause the MySQL server to crash". If we have encountered problem during
-# filling of derived table we should report error and perform cleanup
-# properly.
-#
-CREATE TABLE t1 (a char(10), b char(10));
-INSERT INTO t1 VALUES ('root','localhost'), ('root','%');
---error 1242
-SELECT * FROM (SELECT (SELECT a.a FROM t1 AS a WHERE a.a = b.a) FROM t1 AS b) AS c;
-DROP TABLE t1;
-#
-# test of union subquery in the FROM clause with complex distinct/all (BUG#6565)
-#
-create table t1(a int);
-create table t2(a int);
-create table t3(a int);
-insert into t1 values(1),(1);
-insert into t2 values(2),(2);
-insert into t3 values(3),(3);
-select * from t1 union distinct select * from t2 union all select * from t3;
-select * from (select * from t1 union distinct select * from t2 union all select * from t3) X;
-drop table t1, t2, t3;
-
-#
-# Bug #11864 non unique names are allowed in subquery
-#
-create table t1 (a int);
-create table t2 (a int);
---error 1060
-select * from (select * from t1,t2) foo;
-drop table t1,t2;
-
-#
-# Bug#10586 - query works with 4.1.8, but not with 4.1.11
-#
-create table t1 (ID int unsigned not null auto_increment,
- DATA varchar(5) not null, primary key (ID));
-create table t2 (ID int unsigned not null auto_increment,
- DATA varchar(5) not null, FID int unsigned not null,
- primary key (ID));
-select A.* from (t1 inner join (select * from t2) as A on t1.ID = A.FID);
-select t2.* from ((select * from t1) as A inner join t2 on A.ID = t2.FID);
-select t2.* from (select * from t1) as A inner join t2 on A.ID = t2.FID;
-drop table t1, t2;
-
-connection con1;
-disconnect con1;
---source include/wait_until_disconnected.inc
-connection default;
-drop user mysqltest_1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
-
-set optimizer_switch=@save_derived_optimizer_switch;
diff --git a/mysql-test/suite/pbxt/t/dirty_close.test b/mysql-test/suite/pbxt/t/dirty_close.test
deleted file mode 100644
index d2c2d60af23..00000000000
--- a/mysql-test/suite/pbxt/t/dirty_close.test
+++ /dev/null
@@ -1,19 +0,0 @@
-connect (con1,localhost,root,,);
-connect (con2,localhost,root,,);
-connection con1;
-dirty_close con1;
-connection con2;
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (n int);
-insert into t1 values (1),(2),(3);
-select * from t1;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/distinct.test b/mysql-test/suite/pbxt/t/distinct.test
deleted file mode 100644
index 854d7fc838e..00000000000
--- a/mysql-test/suite/pbxt/t/distinct.test
+++ /dev/null
@@ -1,537 +0,0 @@
-#
-# Bug with distinct and INSERT INTO
-# Bug with group by and not used fields
-#
-
---disable_warnings
-drop table if exists t1,t2,t3;
---enable_warnings
-
-CREATE TABLE t1 (id int,facility char(20));
-CREATE TABLE t2 (facility char(20));
-INSERT INTO t1 VALUES (NULL,NULL);
-INSERT INTO t1 VALUES (-1,'');
-INSERT INTO t1 VALUES (0,'');
-INSERT INTO t1 VALUES (1,'/L');
-INSERT INTO t1 VALUES (2,'A01');
-INSERT INTO t1 VALUES (3,'ANC');
-INSERT INTO t1 VALUES (4,'F01');
-INSERT INTO t1 VALUES (5,'FBX');
-INSERT INTO t1 VALUES (6,'MT');
-INSERT INTO t1 VALUES (7,'P');
-INSERT INTO t1 VALUES (8,'RV');
-INSERT INTO t1 VALUES (9,'SRV');
-INSERT INTO t1 VALUES (10,'VMT');
-INSERT INTO t2 SELECT DISTINCT FACILITY FROM t1;
-
-select id from t1 group by id;
-select * from t1 order by id;
-select id-5,facility from t1 order by "id-5";
-select id,concat(facility) from t1 group by id ;
-select id+0 as a,max(id),concat(facility) as b from t1 group by a order by b desc,a;
-select id >= 0 and id <= 5 as grp,count(*) from t1 group by grp;
-
-SELECT DISTINCT FACILITY FROM t1;
-SELECT FACILITY FROM t2;
-SELECT count(*) from t1,t2 where t1.facility=t2.facility;
-select count(facility) from t1;
-select count(*) from t1;
-select count(*) from t1 where facility IS NULL;
-select count(*) from t1 where facility = NULL;
-select count(*) from t1 where facility IS NOT NULL;
-select count(*) from t1 where id IS NULL;
-select count(*) from t1 where id IS NOT NULL;
-
-drop table t1,t2;
-
-#
-# Problem with distinct without results
-#
-CREATE TABLE t1 (UserId int(11) DEFAULT '0' NOT NULL);
-INSERT INTO t1 VALUES (20);
-INSERT INTO t1 VALUES (27);
-
-SELECT UserId FROM t1 WHERE Userid=22;
-SELECT UserId FROM t1 WHERE UserId=22 group by Userid;
-SELECT DISTINCT UserId FROM t1 WHERE UserId=22 group by Userid;
-SELECT DISTINCT UserId FROM t1 WHERE UserId=22;
-drop table t1;
-
-#
-# Test of distinct
-#
-
-CREATE TABLE t1 (a int(10) unsigned not null primary key,b int(10) unsigned);
-INSERT INTO t1 VALUES (1,1),(2,1),(3,1),(4,1);
-CREATE TABLE t2 (a int(10) unsigned not null, key (A));
-INSERT INTO t2 VALUES (1),(2);
-CREATE TABLE t3 (a int(10) unsigned, key(A), b text);
-INSERT INTO t3 VALUES (1,'1'),(2,'2');
-SELECT DISTINCT t3.b FROM t3,t2,t1 WHERE t3.a=t1.b AND t1.a=t2.a;
-INSERT INTO t2 values (1),(2),(3);
-INSERT INTO t3 VALUES (1,'1'),(2,'2'),(1,'1'),(2,'2');
-explain SELECT distinct t3.a FROM t3,t2,t1 WHERE t3.a=t1.b AND t1.a=t2.a;
-SELECT distinct t3.a FROM t3,t2,t1 WHERE t3.a=t1.b AND t1.a=t2.a;
-
-# Create a lot of data into t3;
-create temporary table t4 select * from t3;
-insert into t3 select * from t4;
-insert into t4 select * from t3;
-insert into t3 select * from t4;
-insert into t4 select * from t3;
-insert into t3 select * from t4;
-insert into t4 select * from t3;
-insert into t3 select * from t4;
-
-explain select distinct t1.a from t1,t3 where t1.a=t3.a;
-#flush status;
-select distinct t1.a from t1,t3 where t1.a=t3.a;
-#show status like 'Handler%';
-#flush status;
-select distinct 1 from t1,t3 where t1.a=t3.a;
-#show status like 'Handler%';
-
-explain SELECT distinct t1.a from t1;
-explain SELECT distinct t1.a from t1 order by a desc;
-explain SELECT t1.a from t1 group by a order by a desc;
-explain SELECT distinct t1.a from t1 order by a desc limit 1;
-explain SELECT distinct a from t3 order by a desc limit 2;
-explain SELECT distinct a,b from t3 order by a+1;
-explain SELECT distinct a,b from t3 order by a limit 10;
-explain SELECT a,b from t3 group by a,b order by a+1;
-
-drop table t1,t2,t3,t4;
-
-CREATE TABLE t1 (name varchar(255));
-INSERT INTO t1 VALUES ('aa'),('ab'),('ac'),('ad'),('ae');
-SELECT DISTINCT * FROM t1 LIMIT 2;
-SELECT DISTINCT name FROM t1 LIMIT 2;
-SELECT DISTINCT 1 FROM t1 LIMIT 2;
-drop table t1;
-
-CREATE TABLE t1 (
- ID int(11) NOT NULL auto_increment,
- NAME varchar(75) DEFAULT '' NOT NULL,
- LINK_ID int(11) DEFAULT '0' NOT NULL,
- PRIMARY KEY (ID),
- KEY NAME (NAME),
- KEY LINK_ID (LINK_ID)
-);
-
-INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (1,'Mike',0),(2,'Jack',0),(3,'Bill',0);
-
-CREATE TABLE t2 (
- ID int(11) NOT NULL auto_increment,
- NAME varchar(150) DEFAULT '' NOT NULL,
- PRIMARY KEY (ID),
- KEY NAME (NAME)
-);
-
-SELECT DISTINCT
- t2.id AS key_link_id,
- t2.name AS link
-FROM t1
-LEFT JOIN t2 ON t1.link_id=t2.id
-GROUP BY t1.id
-ORDER BY link;
-drop table t1,t2;
-
-#
-# Problem with table dependencies
-#
-
-create table t1 (
- id int not null,
- name tinytext not null,
- unique (id)
-);
-create table t2 (
- id int not null,
- idx int not null,
- unique (id, idx)
-);
-create table t3 (
- id int not null,
- idx int not null,
- unique (id, idx)
-);
-insert into t1 values (1,'yes'), (2,'no');
-insert into t2 values (1,1);
-insert into t3 values (1,1);
-
-set @save_join_cache_level=@@join_cache_level;
-set join_cache_level=1;
-
-EXPLAIN
-SELECT DISTINCT
- t1.id
-from
- t1
- straight_join
- t2
- straight_join
- t3
- straight_join
- t1 as j_lj_t2 left join t2 as t2_lj
- on j_lj_t2.id=t2_lj.id
- straight_join
- t1 as j_lj_t3 left join t3 as t3_lj
- on j_lj_t3.id=t3_lj.id
-WHERE
- ((t1.id=j_lj_t2.id AND t2_lj.id IS NULL) OR (t1.id=t2.id AND t2.idx=2))
- AND ((t1.id=j_lj_t3.id AND t3_lj.id IS NULL) OR (t1.id=t3.id AND t3.idx=2));
-SELECT DISTINCT
- t1.id
-from
- t1
- straight_join
- t2
- straight_join
- t3
- straight_join
- t1 as j_lj_t2 left join t2 as t2_lj
- on j_lj_t2.id=t2_lj.id
- straight_join
- t1 as j_lj_t3 left join t3 as t3_lj
- on j_lj_t3.id=t3_lj.id
-WHERE
- ((t1.id=j_lj_t2.id AND t2_lj.id IS NULL) OR (t1.id=t2.id AND t2.idx=2))
- AND ((t1.id=j_lj_t3.id AND t3_lj.id IS NULL) OR (t1.id=t3.id AND t3.idx=2));
-drop table t1,t2,t3;
-
-set join_cache_level=@save_join_cache_level;
-
-#
-# Test using DISTINCT on a function that contains a group function
-# This also test the case when one doesn't use all fields in GROUP BY.
-#
-
-create table t1 (a int not null, b int not null, t time);
-insert into t1 values (1,1,"00:06:15"),(1,2,"00:06:15"),(1,2,"00:30:15"),(1,3,"00:06:15"),(1,3,"00:30:15");
-select a,sec_to_time(sum(time_to_sec(t))) from t1 group by a,b;
-select distinct a,sec_to_time(sum(time_to_sec(t))) from t1 group by a,b;
-create table t2 (a int not null primary key, b int);
-insert into t2 values (1,1),(2,2),(3,3);
-select t1.a,sec_to_time(sum(time_to_sec(t))) from t1 left join t2 on (t1.b=t2.a) group by t1.a,t2.b;
-select distinct t1.a,sec_to_time(sum(time_to_sec(t))) from t1 left join t2 on (t1.b=t2.a) group by t1.a,t2.b;
-drop table t1,t2;
-
-#
-# Test problem with DISTINCT and HAVING
-#
-create table t1 (a int not null,b char(5), c text);
-insert into t1 (a) values (1),(2),(3),(4),(1),(2),(3),(4);
-select distinct a from t1 group by b,a having a > 2 order by a desc;
-select distinct a,c from t1 group by b,c,a having a > 2 order by a desc;
-drop table t1;
-
-#
-# Test problem with DISTINCT and ORDER BY DESC
-#
-
-create table t1 (a char(1), key(a)) engine=myisam;
-insert into t1 values('1'),('1');
-select * from t1 where a >= '1';
-select distinct a from t1 order by a desc;
-select distinct a from t1 where a >= '1' order by a desc;
-drop table t1;
-
-#
-# Test when using a not previously used column in ORDER BY
-#
-
-CREATE TABLE t1 (email varchar(50), infoID BIGINT, dateentered DATETIME);
-CREATE TABLE t2 (infoID BIGINT, shipcode varchar(10));
-
-INSERT INTO t1 (email, infoID, dateentered) VALUES
- ('test1@testdomain.com', 1, '2002-07-30 22:56:38'),
- ('test1@testdomain.com', 1, '2002-07-27 22:58:16'),
- ('test2@testdomain.com', 1, '2002-06-19 15:22:19'),
- ('test2@testdomain.com', 2, '2002-06-18 14:23:47'),
- ('test3@testdomain.com', 1, '2002-05-19 22:17:32');
-
-INSERT INTO t2(infoID, shipcode) VALUES
- (1, 'Z001'),
- (2, 'R002');
-
-SELECT DISTINCTROW email, shipcode FROM t1, t2 WHERE t1.infoID=t2.infoID;
-SELECT DISTINCTROW email FROM t1 ORDER BY dateentered DESC;
-SELECT DISTINCTROW email, shipcode FROM t1, t2 WHERE t1.infoID=t2.infoID ORDER BY dateentered DESC;
-drop table t1,t2;
-
-#
-# test with table.* in DISTINCT
-#
-
-CREATE TABLE t1 (privatemessageid int(10) unsigned NOT NULL auto_increment, folderid smallint(6) NOT NULL default '0', userid int(10) unsigned NOT NULL default '0', touserid int(10) unsigned NOT NULL default '0', fromuserid int(10) unsigned NOT NULL default '0', title varchar(250) NOT NULL default '', message mediumtext NOT NULL, dateline int(10) unsigned NOT NULL default '0', showsignature smallint(6) NOT NULL default '0', iconid smallint(5) unsigned NOT NULL default '0', messageread smallint(6) NOT NULL default '0', readtime int(10) unsigned NOT NULL default '0', receipt smallint(6) unsigned NOT NULL default '0', deleteprompt smallint(6) unsigned NOT NULL default '0', multiplerecipients smallint(6) unsigned NOT NULL default '0', PRIMARY KEY (privatemessageid), KEY userid (userid)) ENGINE=MyISAM;
-INSERT INTO t1 VALUES (128,0,33,33,8,':D','',996121863,1,0,2,996122850,2,0,0);
-CREATE TABLE t2 (userid int(10) unsigned NOT NULL auto_increment, usergroupid smallint(5) unsigned NOT NULL default '0', username varchar(50) NOT NULL default '', password varchar(50) NOT NULL default '', email varchar(50) NOT NULL default '', styleid smallint(5) unsigned NOT NULL default '0', parentemail varchar(50) NOT NULL default '', coppauser smallint(6) NOT NULL default '0', homepage varchar(100) NOT NULL default '', icq varchar(20) NOT NULL default '', aim varchar(20) NOT NULL default '', yahoo varchar(20) NOT NULL default '', signature mediumtext NOT NULL, adminemail smallint(6) NOT NULL default '0', showemail smallint(6) NOT NULL default '0', invisible smallint(6) NOT NULL default '0', usertitle varchar(250) NOT NULL default '', customtitle smallint(6) NOT NULL default '0', joindate int(10) unsigned NOT NULL default '0', cookieuser smallint(6) NOT NULL default '0', daysprune smallint(6) NOT NULL default '0', lastvisit int(10) unsigned NOT NULL default '0', lastactivity int(10) unsigned NOT NULL default '0', lastpost int(10) unsigned NOT NULL default '0', posts smallint(5) unsigned NOT NULL default '0', timezoneoffset varchar(4) NOT NULL default '', emailnotification smallint(6) NOT NULL default '0', buddylist mediumtext NOT NULL, ignorelist mediumtext NOT NULL, pmfolders mediumtext NOT NULL, receivepm smallint(6) NOT NULL default '0', emailonpm smallint(6) NOT NULL default '0', pmpopup smallint(6) NOT NULL default '0', avatarid smallint(6) NOT NULL default '0', avatarrevision int(6) unsigned NOT NULL default '0', options smallint(6) NOT NULL default '15', birthday date NOT NULL default '0000-00-00', maxposts smallint(6) NOT NULL default '-1', startofweek smallint(6) NOT NULL default '1', ipaddress varchar(20) NOT NULL default '', referrerid int(10) unsigned NOT NULL default '0', nosessionhash smallint(6) NOT NULL default '0', autorefresh smallint(6) NOT NULL default '-1', messagepopup tinyint(2) NOT NULL default '0', inforum smallint(5) unsigned NOT NULL default '0', ratenum smallint(5) unsigned NOT NULL default '0', ratetotal smallint(5) unsigned NOT NULL default '0', allowrate smallint(5) unsigned NOT NULL default '1', PRIMARY KEY (userid), KEY usergroupid (usergroupid), KEY username (username), KEY inforum (inforum)) ENGINE=MyISAM;
-INSERT INTO t2 VALUES (33,6,'Kevin','0','kevin@stileproject.com',1,'',0,'http://www.stileproject.com','','','','',1,1,0,'Administrator',0,996120694,1,-1,1030996168,1031027028,1030599436,36,'-6',0,'','','',1,0,1,0,0,15,'0000-00-00',-1,1,'64.0.0.0',0,1,-1,0,0,4,19,1);
-SELECT DISTINCT t1.*, t2.* FROM t1 LEFT JOIN t2 ON (t2.userid = t1.touserid);
-DROP TABLE t1,t2;
-
-#
-# test with const_item in ORDER BY
-#
-
-CREATE TABLE t1 (a int primary key, b int, c int);
-INSERT t1 VALUES (1,2,3);
-CREATE TABLE t2 (a int primary key, b int, c int);
-INSERT t2 VALUES (3,4,5);
-SELECT DISTINCT t1.a, t2.b FROM t1, t2 WHERE t1.a=1 ORDER BY t2.c;
-DROP TABLE t1,t2;
-
-#
-# Test of LEFT() with distinct
-#
-
-CREATE table t1 ( `id` int(11) NOT NULL auto_increment, `name` varchar(50) NOT NULL default '', PRIMARY KEY (`id`)) ENGINE=MyISAM AUTO_INCREMENT=3 ;
-INSERT INTO t1 VALUES (1, 'aaaaa');
-INSERT INTO t1 VALUES (3, 'aaaaa');
-INSERT INTO t1 VALUES (2, 'eeeeeee');
-select distinct left(name,1) as name from t1;
-drop table t1;
-
-#
-# Test case from sel000100
-#
-
-CREATE TABLE t1 (
- ID int(11) NOT NULL auto_increment,
- NAME varchar(75) DEFAULT '' NOT NULL,
- LINK_ID int(11) DEFAULT '0' NOT NULL,
- PRIMARY KEY (ID),
- KEY NAME (NAME),
- KEY LINK_ID (LINK_ID)
-);
-
-INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (1,'Mike',0);
-INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (2,'Jack',0);
-INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (3,'Bill',0);
-
-CREATE TABLE t2 (
- ID int(11) NOT NULL auto_increment,
- NAME varchar(150) DEFAULT '' NOT NULL,
- PRIMARY KEY (ID),
- KEY NAME (NAME)
-);
-
-SELECT DISTINCT
- t2.id AS key_link_id,
- t2.name AS link
-FROM t1
-LEFT JOIN t2 ON t1.link_id=t2.id
-GROUP BY t1.id
-ORDER BY link;
-drop table t1,t2;
-
-#
-# test case for #674
-#
-
-CREATE TABLE t1 (
- html varchar(5) default NULL,
- rin int(11) default '0',
- rout int(11) default '0'
-) ENGINE=MyISAM;
-
-INSERT INTO t1 VALUES ('1',1,0);
-SELECT DISTINCT html,SUM(rout)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin;
-drop table t1;
-
-#
-# Test cases for #12625: DISTINCT for a list with constants
-#
-
-CREATE TABLE t1 (a int);
-INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
-SELECT DISTINCT a, 1 FROM t1;
-SELECT DISTINCT 1, a FROM t1;
-
-CREATE TABLE t2 (a int, b int);
-INSERT INTO t2 VALUES (1,1),(2,2),(2,3),(2,4),(3,5);
-SELECT DISTINCT a, b, 2 FROM t2;
-SELECT DISTINCT 2, a, b FROM t2;
-SELECT DISTINCT a, 2, b FROM t2;
-
-DROP TABLE t1,t2;
-#
-# Bug#16458: Simple SELECT FOR UPDATE causes "Result Set not updatable"
-# error.
-#
-CREATE TABLE t1(a INT PRIMARY KEY, b INT);
-INSERT INTO t1 VALUES (1,1), (2,1), (3,1);
-EXPLAIN SELECT DISTINCT a FROM t1;
-EXPLAIN SELECT DISTINCT a,b FROM t1;
-EXPLAIN SELECT DISTINCT t1_1.a, t1_1.b FROM t1 t1_1, t1 t1_2;
-EXPLAIN SELECT DISTINCT t1_1.a, t1_1.b FROM t1 t1_1, t1 t1_2
- WHERE t1_1.a = t1_2.a;
-EXPLAIN SELECT a FROM t1 GROUP BY a;
-EXPLAIN SELECT a,b FROM t1 GROUP BY a,b;
-EXPLAIN SELECT DISTINCT a,b FROM t1 GROUP BY a,b;
-
-CREATE TABLE t2(a INT, b INT, c INT, d INT, PRIMARY KEY (a,b));
-INSERT INTO t2 VALUES (1,1,1,50), (1,2,3,40), (2,1,3,4);
-EXPLAIN SELECT DISTINCT a FROM t2;
-EXPLAIN SELECT DISTINCT a,a FROM t2;
-EXPLAIN SELECT DISTINCT b,a FROM t2;
-EXPLAIN SELECT DISTINCT a,c FROM t2;
-EXPLAIN SELECT DISTINCT c,a,b FROM t2;
-
-EXPLAIN SELECT DISTINCT a,b,d FROM t2 GROUP BY c,b,d;
-CREATE UNIQUE INDEX c_b_unq ON t2 (c,b);
-EXPLAIN SELECT DISTINCT a,b,d FROM t2 GROUP BY c,b,d;
-
-DROP TABLE t1,t2;
-
-# Bug 9784 DISTINCT IFNULL truncates data
-#
-create table t1 (id int, dsc varchar(50));
-insert into t1 values (1, "line number one"), (2, "line number two"), (3, "line number three");
-select distinct id, IFNULL(dsc, '-') from t1;
-drop table t1;
-
-#
-# Bug 21456: SELECT DISTINCT(x) produces incorrect results when using order by
-#
-CREATE TABLE t1 (a int primary key, b int);
-
-INSERT INTO t1 (a,b) values (1,1), (2,3), (3,2);
-
-explain SELECT DISTINCT a, b FROM t1 ORDER BY b;
-SELECT DISTINCT a, b FROM t1 ORDER BY b;
-DROP TABLE t1;
-
-# End of 4.1 tests
-
-
-#
-# Bug #15745 ( COUNT(DISTINCT CONCAT(x,y)) returns wrong result)
-#
-CREATE TABLE t1 (
- ID int(11) NOT NULL auto_increment,
- x varchar(20) default NULL,
- y decimal(10,0) default NULL,
- PRIMARY KEY (ID),
- KEY (y)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-
-INSERT INTO t1 VALUES
-(1,'ba','-1'),
-(2,'ba','1150'),
-(306,'ba','-1'),
-(307,'ba','1150'),
-(611,'ba','-1'),
-(612,'ba','1150');
-
-select count(distinct x,y) from t1;
-select count(distinct concat(x,y)) from t1;
-drop table t1;
-
-#
-# Bug #18068: SELECT DISTINCT
-#
-CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b));
-
-INSERT INTO t1 VALUES (1, 101);
-INSERT INTO t1 SELECT a + 1, a + 101 FROM t1;
-INSERT INTO t1 SELECT a + 2, a + 102 FROM t1;
-INSERT INTO t1 SELECT a + 4, a + 104 FROM t1;
-INSERT INTO t1 SELECT a + 8, a + 108 FROM t1;
-
-EXPLAIN SELECT DISTINCT a,a FROM t1 WHERE b < 12 ORDER BY a;
-SELECT DISTINCT a,a FROM t1 WHERE b < 12 ORDER BY a;
-
-DROP TABLE t1;
-# The test case for bug#20836 should be re-enabled when bug#16861 is resolved
-# The results for the test should be the same as in 4.1.
-#
-#Bug #20836: Selecting into variables results in wrong results being returned
-#
-#--disable_warnings
-#DROP TABLE IF EXISTS t1;
-#--enable_warnings
-#
-#CREATE TABLE t1 (id INT NOT NULL, fruit_id INT NOT NULL, fruit_name varchar(20)
-#default NULL);
-#
-#INSERT INTO t1 VALUES (1,1,'ORANGE');
-#INSERT INTO t1 VALUES (2,2,'APPLE');
-#INSERT INTO t1 VALUES (3,2,'APPLE');
-#INSERT INTO t1 VALUES (4,3,'PEAR');
-#
-#SELECT DISTINCT fruit_id, fruit_name INTO @v1, @v2 FROM t1 WHERE fruit_name =
-#'APPLE';
-#SELECT @v1, @v2;
-#
-#SELECT DISTINCT fruit_id, fruit_name INTO @v3, @v4 FROM t1 GROUP BY fruit_id,
-#fruit_name HAVING fruit_name = 'APPLE';
-#SELECT @v3, @v4;
-#
-#SELECT DISTINCT @v5:= fruit_id, @v6:= fruit_name INTO @v7, @v8 FROM t1 WHERE
-#fruit_name = 'APPLE';
-#SELECT @v5, @v6, @v7, @v8;
-#
-#SELECT DISTINCT @v5 + fruit_id, CONCAT(@v6, fruit_name) INTO @v9, @v10 FROM t1
-#WHERE fruit_name = 'APPLE';
-#SELECT @v5, @v6, @v7, @v8, @v9, @v10;
-#
-#SELECT DISTINCT @v11:= @v5 + fruit_id, @v12:= CONCAT(@v6, fruit_name) INTO
-#@v13, @v14 FROM t1 WHERE fruit_name = 'APPLE';
-#SELECT @v11, @v12, @v13, @v14;
-#
-#SELECT DISTINCT @v13, @v14 INTO @v15, @v16 FROM t1 WHERE fruit_name = 'APPLE';
-#SELECT @v15, @v16;
-#
-#SELECT DISTINCT 2 + 2, 'Bob' INTO @v17, @v18 FROM t1 WHERE fruit_name =
-#'APPLE';
-#SELECT @v17, @v18;
-#
-#--disable_warnings
-#DROP TABLE IF EXISTS t2;
-#--enable_warnings
-#
-#CREATE TABLE t2 (fruit_id INT NOT NULL, fruit_name varchar(20)
-#default NULL);
-#
-#SELECT DISTINCT fruit_id, fruit_name INTO OUTFILE
-#'../tmp/data1.tmp' FROM t1 WHERE fruit_name = 'APPLE';
-#LOAD DATA INFILE '../tmp/data1.tmp' INTO TABLE t2;
-#--exec rm $MYSQL_TEST_DIR/var/tmp/data1.tmp
-#
-#SELECT DISTINCT @v19:= fruit_id, @v20:= fruit_name INTO OUTFILE
-#'../tmp/data2.tmp' FROM t1 WHERE fruit_name = 'APPLE';
-#LOAD DATA INFILE '../tmp/data2.tmp' INTO TABLE t2;
-#--exec rm $MYSQL_TEST_DIR/var/tmp/data2.tmp
-#
-#SELECT @v19, @v20;
-#SELECT * FROM t2;
-#
-#DROP TABLE t1;
-#DROP TABLE t2;
-
-#
-# Bug #15881: cast problems
-#
-CREATE TABLE t1 (a CHAR(1)); INSERT INTO t1 VALUES('A'), (0);
-SELECT a FROM t1 WHERE a=0;
-SELECT DISTINCT a FROM t1 WHERE a=0;
-DROP TABLE t1;
-CREATE TABLE t1 (a DATE);
-INSERT INTO t1 VALUES ('1972-07-29'), ('1972-02-06');
-EXPLAIN SELECT (SELECT DISTINCT a FROM t1 WHERE a = '2002-08-03');
-EXPLAIN SELECT (SELECT DISTINCT ADDDATE(a,1) FROM t1
- WHERE ADDDATE(a,1) = '2002-08-03');
-CREATE TABLE t2 (a CHAR(5) CHARACTER SET latin1 COLLATE latin1_general_ci);
-INSERT INTO t2 VALUES (0xf6);
-INSERT INTO t2 VALUES ('oe');
-
-SELECT COUNT(*) FROM (SELECT DISTINCT a FROM t2) dt;
-SELECT COUNT(*) FROM
- (SELECT DISTINCT a FROM t2 WHERE a='oe' COLLATE latin1_german2_ci) dt;
-
-DROP TABLE t1, t2;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/drop.test b/mysql-test/suite/pbxt/t/drop.test
deleted file mode 100644
index e7101f616a8..00000000000
--- a/mysql-test/suite/pbxt/t/drop.test
+++ /dev/null
@@ -1,130 +0,0 @@
-# Initialise
---disable_warnings
-drop table if exists t1;
-drop database if exists mysqltest;
-# If earlier test failed
-drop database if exists client_test_db;
---enable_warnings
-
---error 1051
-drop table t1;
-create table t1(n int);
-insert into t1 values(1);
-create temporary table t1( n int);
-insert into t1 values(2);
---error 1050
-create table t1(n int);
-drop table t1;
-select * from t1;
-
-# now test for a bug in drop database - it is important that the name
-# of the table is the same as the name of the database - in the original
-# code this triggered a bug
-create database mysqltest;
-drop database if exists mysqltest;
-create database mysqltest;
-create table mysqltest.mysqltest (n int);
-insert into mysqltest.mysqltest values (4);
-select * from mysqltest.mysqltest;
---enable_info
-drop database if exists mysqltest;
---disable_info
-create database mysqltest;
-
-#
-# drop many tables - bug#3891
-# we'll do it in mysqltest db, to be able to use longer table names
-# (tableN instead on tN)
-#
-use mysqltest;
---error 1051
-drop table table1, table2, table3, table4, table5, table6,
-table7, table8, table9, table10, table11, table12, table13,
-table14, table15, table16, table17, table18, table19, table20,
-table21, table22, table23, table24, table25, table26, table27,
-table28;
-
---error 1051
-drop table table1, table2, table3, table4, table5, table6,
-table7, table8, table9, table10, table11, table12, table13,
-table14, table15, table16, table17, table18, table19, table20,
-table21, table22, table23, table24, table25, table26, table27,
-table28, table29, table30;
-
-use test;
-drop database mysqltest;
-
-# test drop/create database and FLUSH TABLES WITH READ LOCK
-flush tables with read lock;
---error 1209,1223
-create database mysqltest;
-unlock tables;
-create database mysqltest;
-show databases;
-flush tables with read lock;
---error 1208,1223
-drop database mysqltest;
-unlock tables;
-drop database mysqltest;
-show databases;
---error 1008
-drop database mysqltest;
-
-# test create table and FLUSH TABLES WITH READ LOCK
-drop table t1;
-flush tables with read lock;
---error 1223
-create table t1(n int);
-unlock tables;
-create table t1(n int);
-show tables;
-drop table t1;
-
-# End of 4.1 tests
-
-
-#
-# Test for bug#21216 "Simultaneous DROP TABLE and SHOW OPEN TABLES causes
-# server to crash". Crash (caused by failed assertion in 5.0 or by null
-# pointer dereference in 5.1) happened when one ran SHOW OPEN TABLES
-# while concurrently doing DROP TABLE (or RENAME TABLE, CREATE TABLE LIKE
-# or any other command that takes name-lock) in other connection.
-#
-# Also includes test for similar bug#12212 "Crash that happens during
-# removing of database name from cache" reappeared in 5.1 as bug#19403
-# In its case crash happened when one concurrently executed DROP DATABASE
-# and one of name-locking command.
-#
---disable_warnings
-drop database if exists mysqltest;
-drop table if exists t1;
---enable_warnings
-create table t1 (i int);
-create database mysqltest;
-lock tables t1 read;
-connect (addconroot1, localhost, root,,);
---send drop table t1
-connect (addconroot2, localhost, root,,);
-# Server should not crash in any of the following statements
---disable_result_log
-show open tables;
---enable_result_log
---send drop database mysqltest
-connection default;
-select 1;
-unlock tables;
-connection addconroot1;
---reap
-connection addconroot2;
---reap
-disconnect addconroot2;
---source include/wait_until_disconnected.inc
-connection addconroot1;
-disconnect addconroot1;
---source include/wait_until_disconnected.inc
-connection default;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
---echo End of 5.0 tests
diff --git a/mysql-test/suite/pbxt/t/empty_table.test b/mysql-test/suite/pbxt/t/empty_table.test
deleted file mode 100644
index 5f8a0c527ca..00000000000
--- a/mysql-test/suite/pbxt/t/empty_table.test
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Some special cases with empty tables
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (nr int(5) not null auto_increment,b blob,str char(10), primary key (nr));
-select count(*) from t1;
-select * from t1;
-select * from t1 limit 0;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/endspace.test b/mysql-test/suite/pbxt/t/endspace.test
deleted file mode 100644
index a2962544a43..00000000000
--- a/mysql-test/suite/pbxt/t/endspace.test
+++ /dev/null
@@ -1,106 +0,0 @@
-#
-# Test problem with characters < ' ' at end of strings (Bug #3152)
-#
-
--- source include/have_innodb.inc
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
--- source include/endspace.inc
-
-#
-# Test MyISAM tables.
-#
-
-create table t1 (text1 varchar(32) not NULL, KEY key1 (text1));
-insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
-check table t1;
-select * from t1 ignore key (key1) where text1='teststring' or
- text1 like 'teststring_%' ORDER BY text1;
-select * from t1 where text1='teststring' or text1 like 'teststring_%';
-select * from t1 where text1='teststring' or text1 > 'teststring\t';
-select * from t1 order by text1;
-explain select * from t1 order by text1;
-
-alter table t1 modify text1 char(32) binary not null;
-check table t1;
-select * from t1 ignore key (key1) where text1='teststring' or
- text1 like 'teststring_%' ORDER BY text1;
-select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%';
-select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
-select text1, length(text1) from t1 order by text1;
-select text1, length(text1) from t1 order by binary text1;
-
-alter table t1 modify text1 blob not null, drop key key1, add key key1 (text1(20));
-insert into t1 values ('teststring ');
-select concat('|', text1, '|') from t1 order by text1;
-select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
-select concat('|', text1, '|') from t1 where text1='teststring';
-select concat('|', text1, '|') from t1 where text1='teststring ';
-
-alter table t1 modify text1 text not null, pack_keys=1;
-select concat('|', text1, '|') from t1 where text1='teststring';
-select concat('|', text1, '|') from t1 where text1='teststring ';
-explain select concat('|', text1, '|') from t1 where text1='teststring ';
-select concat('|', text1, '|') from t1 where text1 like 'teststring_%';
-select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%';
-select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
-select concat('|', text1, '|') from t1 order by text1;
-drop table t1;
-
-create table t1 (text1 varchar(32) not NULL, KEY key1 (text1)) pack_keys=0;
-insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
-select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%';
-select concat('|', text1, '|') from t1 where text1='teststring' or text1 >= 'teststring\t';
-drop table t1;
-
-# Test HEAP tables (with BTREE keys)
-
-create table t1 (text1 varchar(32) not NULL, KEY key1 using BTREE (text1)) engine=heap;
-insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
-select * from t1 ignore key (key1) where text1='teststring' or
- text1 like 'teststring_%' ORDER BY text1;
-select * from t1 where text1='teststring' or text1 like 'teststring_%';
-select * from t1 where text1='teststring' or text1 >= 'teststring\t';
-select * from t1 order by text1;
-explain select * from t1 order by text1;
-
-alter table t1 modify text1 char(32) binary not null;
-select * from t1 order by text1;
-drop table t1;
-
-#
-# Test InnoDB tables
-#
-
-create table t1 (text1 varchar(32) not NULL, KEY key1 (text1)) engine=innodb;
-insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
-check table t1;
-select * from t1 where text1='teststring' or text1 like 'teststring_%';
-select * from t1 where text1='teststring' or text1 > 'teststring\t';
-select * from t1 order by text1;
-explain select * from t1 order by text1;
-
-alter table t1 modify text1 char(32) binary not null;
-select * from t1 order by text1;
-
-alter table t1 modify text1 blob not null, drop key key1, add key key1 (text1(20));
-insert into t1 values ('teststring ');
-select concat('|', text1, '|') from t1 order by text1;
-
-alter table t1 modify text1 text not null, pack_keys=1;
-select * from t1 where text1 like 'teststring_%';
-
-# The following gives wrong result in InnoDB
---sorted_result
-select text1, length(text1) from t1 where text1='teststring' or text1 like 'teststring_%';
---sorted_result
-select text1, length(text1) from t1 where text1='teststring' or text1 >= 'teststring\t';
-select concat('|', text1, '|') from t1 order by text1;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/errors.test b/mysql-test/suite/pbxt/t/errors.test
deleted file mode 100644
index d19e0799c50..00000000000
--- a/mysql-test/suite/pbxt/t/errors.test
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# Test some error conditions
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
---error 1146
-insert into t1 values(1);
---error 1146
-delete from t1;
---error 1146
-update t1 set a=1;
-create table t1 (a int);
---error 1054
-select count(test.t1.b) from t1;
---error 1054
-select count(not_existing_database.t1) from t1;
---error 1054
-select count(not_existing_database.t1.a) from t1;
---error 1044,1146
-select count(not_existing_database.t1.a) from not_existing_database.t1;
---error 1054
-select 1 from t1 order by 2;
---error 1054
-select 1 from t1 group by 2;
---error 1054
-select 1 from t1 order by t1.b;
---error 1054
-select count(*),b from t1;
-drop table t1;
-
-# End of 4.1 tests
-
-#
-# Bug #6080: Error message for a field with a display width that is too long
-#
---error 1439
-create table t1 (a int(256));
-set sql_mode='traditional';
---error 1074
-create table t1 (a varchar(66000));
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 5.0 tests
diff --git a/mysql-test/suite/pbxt/t/explain.test b/mysql-test/suite/pbxt/t/explain.test
deleted file mode 100644
index fb9f3507d01..00000000000
--- a/mysql-test/suite/pbxt/t/explain.test
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# Test of different EXPLAIN's
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-create table t1 (id int not null, str char(10), unique(str));
-explain select * from t1;
-insert into t1 values (1, null),(2, null),(3, "foo"),(4, "bar");
-select * from t1 where str is null;
-select * from t1 where str="foo";
-explain select * from t1 where str is null;
-explain select * from t1 where str="foo";
-explain select * from t1 ignore key (str) where str="foo";
-explain select * from t1 use key (str,str) where str="foo";
-
-#The following should give errors
---error 1176
-explain select * from t1 use key (str,str,foo) where str="foo";
---error 1176
-explain select * from t1 ignore key (str,str,foo) where str="foo";
-drop table t1;
-
-explain select 1;
-
-create table t1 (a int not null);
-explain select count(*) from t1;
-insert into t1 values(1);
-explain select count(*) from t1;
-insert into t1 values(1);
-explain select count(*) from t1;
-drop table t1;
-
-#
-# Bug #3403 Wrong encoding in EXPLAIN SELECT output
-#
-set names koi8r;
-create table (0 int, 1 int, key 0 (0), key 01 (0,1));
-insert into (0) values (1);
-insert into (0) values (2);
-explain select 0 from where 0=1;
-drop table ;
-set names latin1;
-
-# End of 4.1 tests
-
-
-#
-# Bug#15463: EXPLAIN SELECT..INTO hangs the client (QB, command line)
-#
-select 3 into @v1;
-explain select 3 into @v1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 5.0 tests.
diff --git a/mysql-test/suite/pbxt/t/flush.test b/mysql-test/suite/pbxt/t/flush.test
deleted file mode 100644
index c2656909989..00000000000
--- a/mysql-test/suite/pbxt/t/flush.test
+++ /dev/null
@@ -1,142 +0,0 @@
-connect (con1,localhost,root,,);
-connect (con2,localhost,root,,);
-connection con1;
-
---disable_warnings
-drop table if exists t1,t2;
-drop database if exists mysqltest;
---enable_warnings
-
-create temporary table t1(n int not null primary key);
-create table t2(n int);
-insert into t2 values(3);
-let $1=100;
-disable_query_log;
-while ($1)
-{
- connection con1;
- send replace into t1 select n from t2;
- connection con2;
- send flush tables;
- connection con1;
- reap;
- connection con2;
- reap;
- dec $1;
-}
-enable_query_log;
-connection con1;
-select * from t1;
-connection con2;
-flush tables with read lock;
---error 1223
-drop table t2;
-connection con1;
-send drop table t2;
-connection con2;
-unlock tables;
-connection con1;
-reap;
-
-#test if drop database will wait until we release the global read lock
-connection con1;
-create database mysqltest;
-create table mysqltest.t1(n int);
-insert into mysqltest.t1 values (23);
-flush tables with read lock;
-connection con2;
-send drop database mysqltest;
-connection con1;
-select * from mysqltest.t1;
-unlock tables;
-connection con2;
-reap;
-
-# test if dirty close releases global read lock
-connection con1;
-create table t1 (n int);
-flush tables with read lock;
-dirty_close con1;
-connection con2;
-insert into t1 values (345);
-select * from t1;
-drop table t1;
-
-#
-# Bug#9459 - deadlock with flush with lock, and lock table write
-#
-create table t1 (c1 int);
-lock table t1 write;
-# Cannot get the global read lock with write locked tables.
---error ER_LOCK_OR_ACTIVE_TRANSACTION
-flush tables with read lock;
-lock table t1 read;
-# Cannot get the global read lock with read locked tables.
---error ER_LOCK_OR_ACTIVE_TRANSACTION
-flush tables with read lock;
-unlock tables;
-flush tables with read lock;
---error 1223
-lock table t1 write;
-lock table t1 read;
---error 1223
-lock table t1 write;
-# Release all table locks and the global read lock.
-unlock tables;
-create table t2 (c1 int);
-create table t3 (c1 int);
-lock table t1 read, t2 read, t3 write;
-# Cannot get the global read lock with write locked tables.
---error ER_LOCK_OR_ACTIVE_TRANSACTION
-flush tables with read lock;
-lock table t1 read, t2 read, t3 read;
-# Cannot get the global read lock with read locked tables.
---error ER_LOCK_OR_ACTIVE_TRANSACTION
-flush tables with read lock;
-unlock tables;
-drop table t1, t2, t3;
-
-# End of 4.1 tests
-
-#
-# Test of deadlock problem when doing FLUSH TABLE with read lock
-# (Bug was in NTPL threads in Linux when using different mutex while
-# waiting for a condtion variable)
-
-create table t1 (c1 int);
-create table t2 (c1 int);
-
-connect (con1,localhost,root,,);
-connect (con3,localhost,root,,);
-
-connection con1;
-lock table t1 write;
-
-connection con2;
-send flush tables with read lock;
---sleep 1
-
-connection con3;
-send insert into t2 values(1);
---sleep 1
-
-connection con1;
-unlock tables;
-disconnect con1;
-
-connection con2;
-reap;
-disconnect con2;
-
-connection con3;
-# It hangs here (insert into t2 does not end).
-reap;
-disconnect con3;
-
-connection default;
-drop table t1, t2;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 5.0 tests
diff --git a/mysql-test/suite/pbxt/t/flush_read_lock_kill.test b/mysql-test/suite/pbxt/t/flush_read_lock_kill.test
deleted file mode 100644
index 6fd9e888984..00000000000
--- a/mysql-test/suite/pbxt/t/flush_read_lock_kill.test
+++ /dev/null
@@ -1,54 +0,0 @@
-# Let's see if FLUSH TABLES WITH READ LOCK can be killed when waiting
-# for running commits to finish (in the past it could not)
-# This will not be a meaningful test on non-debug servers so will be
-# skipped.
-# If running mysql-test-run --debug, the --debug added by
-# mysql-test-run to the mysqld command line will override the one of
-# -master.opt. But this test is designed to still pass then (though it
-# won't test anything interesting).
-
-# This also won't work with the embedded server test
--- source include/not_embedded.inc
-
--- source include/have_debug.inc
-
-connect (con1,localhost,root,,);
-connect (con2,localhost,root,,);
-connection con1;
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-create table t1 (kill_id int);
-insert into t1 values(connection_id());
-select kill_id-kill_id from t1;
-
-# Thanks to the parameter we passed to --debug, this FLUSH will
-# block on a debug build running with our --debug=make_global... It
-# will block until killed. In other cases (non-debug build or other
-# --debug) it will succeed immediately
-
-connection con1;
-send flush tables with read lock;
-
-# kill con1
-connection con2;
-select ((@id := kill_id) - kill_id) from t1;
-
---sleep 2 # leave time for FLUSH to block
-kill connection @id;
-
-connection con1;
-# On debug builds it will be error 1053 (killed); on non-debug, or
-# debug build running without our --debug=make_global..., will be
-# error 0 (no error). The only important thing to test is that on
-# debug builds with our --debug=make_global... we don't hang forever.
---error 0,1053,2013
-reap;
-
-connection con2;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/flush_table.test b/mysql-test/suite/pbxt/t/flush_table.test
deleted file mode 100644
index dd11da38a2d..00000000000
--- a/mysql-test/suite/pbxt/t/flush_table.test
+++ /dev/null
@@ -1,132 +0,0 @@
-# TODO: Only run this if we have privilege to do flush table
-
-#
-# Test of flush table
-#
-
-# Should work in embedded server after mysqltest is fixed
--- source include/not_embedded.inc
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-create table t1 (a int not null auto_increment primary key);
-insert into t1 values(0);
-
-# Test for with read lock + flush
-
-lock table t1 read;
---error ER_TABLE_NOT_LOCKED_FOR_WRITE
-flush table t1;
-unlock tables;
-
-# Test for with write lock + flush
-
-lock table t1 write;
-flush table t1;
-check table t1;
-unlock tables;
-
-# Test for with a write lock and a waiting read lock + flush
-
-lock table t1 write;
-connect (locker,localhost,root,,test);
-connection locker;
-send lock table t1 read;
-connection default;
-sleep 2;
-flush table t1;
-select * from t1;
-unlock tables;
-connection locker;
-reap;
-unlock tables;
-connection default;
-
-# Test for with a write lock and a waiting write lock + flush
-
-lock table t1 write;
-connection locker;
-send lock table t1 write;
-connection default;
-sleep 2;
-flush table t1;
-select * from t1;
-unlock tables;
-connection locker;
-reap;
-unlock tables;
-select * from t1;
-connection default;
-drop table t1;
-disconnect locker;
-
-#
-# In the following test FLUSH TABLES produces a deadlock
-# (hang forever) if the fix for BUG #3565 is missing.
-# And it shows that handler tables are re-opened after flush (BUG #4286).
-#
-create table t1(table_id char(20) primary key);
-create table t2(table_id char(20) primary key);
-insert into t1 values ('test.t1');
-insert into t1 values ('');
-insert into t2 values ('test.t2');
-insert into t2 values ('');
-handler t1 open as a1;
-handler t1 open as a2;
-handler t2 open;
-handler a1 read first limit 9;
-handler a2 read first limit 9;
-handler t2 read first limit 9;
-flush tables;
-handler a1 read first limit 9;
-handler a2 read first limit 9;
-handler t2 read first limit 9;
-#
---error 1066
-handler t1 open as a1;
---error 1066
-handler t1 open as a2;
---error 1066
-handler t2 open;
-handler a1 read first limit 9;
-handler a2 read first limit 9;
-handler t2 read first limit 9;
-flush table t1;
-handler a1 read first limit 9;
-handler a2 read first limit 9;
-handler t2 read first limit 9;
-flush table t2;
-handler t2 close;
-drop table t1;
-drop table t2;
-
-#
-# The fix for BUG #4286 cannot restore the position after a flush.
-#
-create table t1(table_id char(20) primary key);
-insert into t1 values ('Record-01');
-insert into t1 values ('Record-02');
-insert into t1 values ('Record-03');
-insert into t1 values ('Record-04');
-insert into t1 values ('Record-05');
-handler t1 open;
-handler t1 read first limit 1;
-handler t1 read next limit 1;
-handler t1 read next limit 1;
-flush table t1;
-handler t1 read next limit 1;
-handler t1 read next limit 1;
-handler t1 close;
-drop table t1;
-
-#
-# Bug #11934 Two sequential FLUSH TABLES WITH READ LOCK hangs client
-#
-FLUSH TABLES WITH READ LOCK ;
-FLUSH TABLES WITH READ LOCK ;
-UNLOCK TABLES;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/foreign_key.test b/mysql-test/suite/pbxt/t/foreign_key.test
deleted file mode 100644
index e9940e60d15..00000000000
--- a/mysql-test/suite/pbxt/t/foreign_key.test
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Test syntax of foreign keys
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-set foreign_key_checks = 0;
-# PBXT: added row c so I can test set null (not allowed on primary key)
-create table t1 (
- a int not null references t2,
- b int not null references t2 (c),
- c int,
- primary key (a,b),
- foreign key (a) references t3 match full,
- foreign key (a) references t3 match partial,
- foreign key (a,b) references t3 (c,d) on delete no action
- on update no action,
- foreign key (a,b) references t3 (c,d) on update cascade,
- foreign key (a,b) references t3 (c,d) on delete set default,
- foreign key (c) references t3 (e) on update set null);
-
-create index a on t1 (a);
-create unique index b on t1 (a,b);
-drop table t1;
-
-set foreign_key_checks = 1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/func_concat.test b/mysql-test/suite/pbxt/t/func_concat.test
deleted file mode 100644
index 390d3337c1f..00000000000
--- a/mysql-test/suite/pbxt/t/func_concat.test
+++ /dev/null
@@ -1,74 +0,0 @@
-#
-# Test of problem with CONCAT_WS() and long separators.
-#
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-CREATE TABLE t1 ( number INT NOT NULL, alpha CHAR(6) NOT NULL );
-INSERT INTO t1 VALUES (1413006,'idlfmv'),
-(1413065,'smpsfz'),(1413127,'sljrhx'),(1413304,'qerfnd');
-
-SELECT number, alpha, CONCAT_WS('<---->',number,alpha) AS new
-FROM t1 GROUP BY number;
-
-SELECT CONCAT_WS('<---->',number,alpha) AS new
-FROM t1 GROUP BY new LIMIT 1;
-
-SELECT number, alpha, CONCAT_WS('<->',number,alpha) AS new
-FROM t1 GROUP BY new LIMIT 1;
-
-SELECT number, alpha, CONCAT_WS('-',number,alpha,alpha,alpha,alpha,alpha,alpha,alpha) AS new
-FROM t1 GROUP BY new LIMIT 1;
-
-SELECT number, alpha, CONCAT_WS('<------------------>',number,alpha) AS new
-FROM t1 GROUP BY new LIMIT 1;
-drop table t1;
-
-#
-# Bug #5540: a problem with double type
-#
-
-create table t1 (a char(4), b double, c date, d tinyint(4));
-insert into t1 values ('AAAA', 105, '2003-03-01', 1);
-select * from t1 where concat(A,C,B,D) = 'AAAA2003-03-011051';
-drop table t1;
-
-# BUG#6825
-select 'a' union select concat('a', -4);
-select 'a' union select concat('a', -4.5);
-
-select 'a' union select concat('a', -(4 + 1));
-select 'a' union select concat('a', 4 - 5);
-
-select 'a' union select concat('a', -'3');
-select 'a' union select concat('a', -concat('3',4));
-
-select 'a' union select concat('a', -0);
---replace_result a-0.0 a0.0
-select 'a' union select concat('a', -0.0);
-
---replace_result a-0.0000 a0.0000
-select 'a' union select concat('a', -0.0000);
-
-#
-# Bug#16716: subselect in concat() may lead to a wrong result
-#
-select concat((select x from (select 'a' as x) as t1 ),
- (select y from (select 'b' as y) as t2 )) from (select 1 union select 2 )
- as t3;
-
-# End of 4.1 tests
-
-#
-# Bug#15962: CONCAT() in UNION may lead to a data trucation.
-#
-create table t1(f1 varchar(6)) charset=utf8;
-insert into t1 values ("123456");
-select concat(f1, 2) a from t1 union select 'x' a from t1;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/func_crypt.test b/mysql-test/suite/pbxt/t/func_crypt.test
deleted file mode 100644
index 657f93ef083..00000000000
--- a/mysql-test/suite/pbxt/t/func_crypt.test
+++ /dev/null
@@ -1,61 +0,0 @@
--- source include/have_crypt.inc
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-select length(encrypt('foo', 'ff')) <> 0;
---replace_result $1$aa$4OSUA5cjdx0RUQ08opV27/ aaqPiZY5xR5l.
-
-create table t1 (name varchar(50), pw varchar(64));
-insert into t1 values ('tom', password('my_pass'));
-set @pass='my_pass';
-select name from t1 where name='tom' and pw=password(@pass);
-select name from t1 where name='tom' and pw=password(@undefined);
-drop table t1;
-
-# Test new and old password handling functions
-
-select password('abc');
-select password('');
-select old_password('abc');
-select old_password('');
-select password('gabbagabbahey');
-select old_password('idkfa');
-select length(password('1'));
-select length(encrypt('test'));
-select encrypt('test','aa');
-select old_password(NULL);
-select password(NULL);
-set global old_passwords=on;
-select password('');
-select old_password('');
-select password('idkfa');
-select old_password('idkfa');
-set old_passwords=on;
-select password('idkfa');
-select old_password('idkfa');
-set global old_passwords=off;
-select password('idkfa');
-select old_password('idkfa');
-
-# this test shows that new scrambles honor spaces in passwords:
-set old_passwords=off;
-select password('idkfa ');
-select password('idkfa');
-select password(' idkfa');
-select old_password('idkfa');
-select old_password(' i d k f a ');
-
-explain extended select password('idkfa '), old_password('idkfa');
-
-#
-# Bug #13619: Crash on FreeBSD with salt like '_.'
-#
---replace_column 1 #
-select encrypt('1234','_.');
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/func_date_add.test b/mysql-test/suite/pbxt/t/func_date_add.test
deleted file mode 100644
index 0d94b1d6a80..00000000000
--- a/mysql-test/suite/pbxt/t/func_date_add.test
+++ /dev/null
@@ -1,83 +0,0 @@
-#
-# Test of DATE_ADD
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-CREATE TABLE t1 (
- visitor_id int(10) unsigned DEFAULT '0' NOT NULL,
- group_id int(10) unsigned DEFAULT '0' NOT NULL,
- hits int(10) unsigned DEFAULT '0' NOT NULL,
- sessions int(10) unsigned DEFAULT '0' NOT NULL,
- ts timestamp,
- PRIMARY KEY (visitor_id,group_id)
-)/*! engine=MyISAM */;
-INSERT INTO t1 VALUES (465931136,7,2,2,20000318160952);
-INSERT INTO t1 VALUES (173865424,2,2,2,20000318233615);
-INSERT INTO t1 VALUES (173865424,8,2,2,20000318233615);
-INSERT INTO t1 VALUES (173865424,39,2,2,20000318233615);
-INSERT INTO t1 VALUES (173865424,7,2,2,20000318233615);
-INSERT INTO t1 VALUES (173865424,3,2,2,20000318233615);
-INSERT INTO t1 VALUES (173865424,6,2,2,20000318233615);
-INSERT INTO t1 VALUES (173865424,60,2,2,20000318233615);
-INSERT INTO t1 VALUES (173865424,1502,2,2,20000318233615);
-INSERT INTO t1 VALUES (48985536,2,2,2,20000319013932);
-INSERT INTO t1 VALUES (48985536,8,2,2,20000319013932);
-INSERT INTO t1 VALUES (48985536,39,2,2,20000319013932);
-INSERT INTO t1 VALUES (48985536,7,2,2,20000319013932);
-INSERT INTO t1 VALUES (465931136,3,2,2,20000318160951);
-INSERT INTO t1 VALUES (465931136,119,1,1,20000318160953);
-INSERT INTO t1 VALUES (465931136,2,1,1,20000318160950);
-INSERT INTO t1 VALUES (465931136,8,1,1,20000318160950);
-INSERT INTO t1 VALUES (465931136,39,1,1,20000318160950);
-INSERT INTO t1 VALUES (1092858576,14,1,1,20000319013445);
-INSERT INTO t1 VALUES (357917728,3,2,2,20000319145026);
-INSERT INTO t1 VALUES (357917728,7,2,2,20000319145027);
-select visitor_id,max(ts) as mts from t1 group by visitor_id
-having mts < DATE_SUB(NOW(),INTERVAL 3 MONTH);
-select visitor_id,max(ts) as mts from t1 group by visitor_id
-having DATE_ADD(mts,INTERVAL 3 MONTH) < NOW();
-drop table t1;
-
-#
-# Bug #10627: Invalid date turned to NULL from date_sub/date_add in
-# traditional mode
-#
-set sql_mode='traditional';
-create table t1 (d date);
---error S22008
-insert into t1 (d) select date_sub('2000-01-01', INTERVAL 2001 YEAR);
---error S22008
-insert into t1 (d) select date_add('2000-01-01',interval 8000 year);
-# No warnings/errors from the next two
-insert into t1 values (date_add(NULL, INTERVAL 1 DAY));
-insert into t1 values (date_add('2000-01-04', INTERVAL NULL DAY));
-set sql_mode='';
-# These will all work now, and we'll end up with some NULL entries in the
-# table and some warnings.
-insert into t1 (d) select date_sub('2000-01-01', INTERVAL 2001 YEAR);
-insert into t1 (d) select date_add('2000-01-01',interval 8000 year);
-insert into t1 values (date_add(NULL, INTERVAL 1 DAY));
-insert into t1 values (date_add('2000-01-04', INTERVAL NULL DAY));
-select * from t1;
-drop table t1;
-
---echo End of 4.1 tests
-
-#
-# Bug#21811
-#
-# Make sure we end up with an appropriate
-# date format (DATE) after addition operation
-#
-SELECT CAST('2006-09-26' AS DATE) + INTERVAL 1 DAY;
-SELECT CAST('2006-09-26' AS DATE) + INTERVAL 1 MONTH;
-SELECT CAST('2006-09-26' AS DATE) + INTERVAL 1 YEAR;
-SELECT CAST('2006-09-26' AS DATE) + INTERVAL 1 WEEK;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
---echo End of 5.0 tests
diff --git a/mysql-test/suite/pbxt/t/func_default.test b/mysql-test/suite/pbxt/t/func_default.test
deleted file mode 100644
index b4bd4520b42..00000000000
--- a/mysql-test/suite/pbxt/t/func_default.test
+++ /dev/null
@@ -1,34 +0,0 @@
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-
-create table t1(str varchar(10) default 'def',strnull varchar(10),intg int default '10',rel double default '3.14');
-
-insert into t1 values ('','',0,0.0);
-select default(str), default(strnull), default(intg), default(rel) from t1;
-explain extended select default(str), default(strnull), default(intg), default(rel) from t1;
-select * from t1 where str <> default(str);
-explain select * from t1 where str <> default(str);
-
-#TODO: uncomment when bug will be fixed
-#create table t2 select default(str), default(strnull), default(intg), default(rel) from t1;
-#show create table from t1;
-#insert into t2 select select default(str), default(strnull), default(intg), default(rel) from t1;
-
-drop table t1;
-
-# End of 4.1 tests
-
-#
-# Bug #11314 (HAVING DEFAULT() hangs)
-#
-CREATE TABLE t1 (id int(11), s varchar(20));
-INSERT INTO t1 VALUES (1, 'one'), (2, 'two'), (3, 'three');
---error 1364
-SELECT s, 32 AS mi FROM t1 GROUP BY s HAVING DEFAULT(mi) IS NULL;
-DROP TABLE t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/func_equal.test b/mysql-test/suite/pbxt/t/func_equal.test
deleted file mode 100644
index ed7073d55ff..00000000000
--- a/mysql-test/suite/pbxt/t/func_equal.test
+++ /dev/null
@@ -1,49 +0,0 @@
-# Initialise
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-#
-# Testing of the <=> operator
-#
-
-#
-# First some simple tests
-#
-
-select 0<=>0,0.0<=>0.0,0E0=0E0,"A"<=>"A",NULL<=>NULL;
-select 1<=>0,0<=>NULL,NULL<=>0;
-select 1.0<=>0.0,0.0<=>NULL,NULL<=>0.0;
-select "A"<=>"B","A"<=>NULL,NULL<=>"A";
-select 0<=>0.0, 0.0<=>0E0, 0E0<=>"0", 10.0<=>1E1, 10<=>10.0, 10<=>1E1;
-select 1.0<=>0E1,10<=>NULL,NULL<=>0.0, NULL<=>0E0;
-
-#
-# Test with tables
-#
-
-create table t1 (id int, value int);
-create table t2 (id int, value int);
-
-insert into t1 values (1,null);
-insert into t2 values (1,null);
-
-select t1.*, t2.*, t1.value<=>t2.value from t1, t2 where t1.id=t2.id and t1.id=1;
-select * from t1 where id <=>id;
-select * from t1 where value <=> value;
-select * from t1 where id <=> value or value<=>id;
-drop table t1,t2;
-
-#
-# Bug #12612: quoted bigint unsigned value and the use of "in" in where clause
-#
-create table t1 (a bigint unsigned);
-insert into t1 values (4828532208463511553);
-select * from t1 where a = '4828532208463511553';
-select * from t1 where a in ('4828532208463511553');
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/func_gconcat.test b/mysql-test/suite/pbxt/t/func_gconcat.test
deleted file mode 100644
index fc2aff42520..00000000000
--- a/mysql-test/suite/pbxt/t/func_gconcat.test
+++ /dev/null
@@ -1,506 +0,0 @@
-#
-# simple test of group_concat function
-#
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
-
-create table t1 (grp int, a bigint unsigned, c char(10) not null, d char(10) not null);
-insert into t1 values (1,1,"a","a");
-insert into t1 values (2,2,"b","a");
-insert into t1 values (2,3,"c","b");
-insert into t1 values (3,4,"E","a");
-insert into t1 values (3,5,"C","b");
-insert into t1 values (3,6,"D","b");
-insert into t1 values (3,7,"d","d");
-insert into t1 values (3,8,"d","d");
-insert into t1 values (3,9,"D","c");
-
-# Test of MySQL simple request
-select grp,group_concat(c) from t1 group by grp;
-explain extended select grp,group_concat(c) from t1 group by grp;
-select grp,group_concat(a,c) from t1 group by grp;
-select grp,group_concat("(",a,":",c,")") from t1 group by grp;
-
-# Test of MySQL with options
-select grp,group_concat(c separator ",") from t1 group by grp;
-select grp,group_concat(c separator "---->") from t1 group by grp;
-select grp,group_concat(c order by c) from t1 group by grp;
-select grp,group_concat(c order by c desc) from t1 group by grp;
-select grp,group_concat(d order by a) from t1 group by grp;
-select grp,group_concat(d order by a desc) from t1 group by grp;
---disable_warnings
-select grp,group_concat(a order by a,d+c-ascii(c)-a) from t1 group by grp;
-select grp,group_concat(a order by d+c-ascii(c),a) from t1 group by grp;
---enable_warnings
-select grp,group_concat(c order by 1) from t1 group by grp;
-select grp,group_concat(distinct c order by c) from t1 group by grp;
-select grp,group_concat(distinct c order by c desc) from t1 group by grp;
-explain extended select grp,group_concat(distinct c order by c desc) from t1 group by grp;
-select grp,group_concat(c order by c separator ",") from t1 group by grp;
-select grp,group_concat(c order by c desc separator ",") from t1 group by grp;
-select grp,group_concat(distinct c order by c separator ",") from t1 group by grp;
-explain extended select grp,group_concat(distinct c order by c separator ",") from t1 group by grp;
-select grp,group_concat(distinct c order by c desc separator ",") from t1 group by grp;
-
-# Test of SQL_LIST objects
-select grp,group_concat(c order by grp desc) from t1 group by grp order by grp;
-
-
-# Test transfer to real values
-
-select grp, group_concat(a separator "")+0 from t1 group by grp;
-
-select grp, group_concat(a separator "")+0.0 from t1 group by grp;
-
-select grp, ROUND(group_concat(a separator "")) from t1 group by grp;
-
-drop table t1;
-
-# Test NULL values
-
-create table t1 (grp int, c char(10));
-insert into t1 values (1,NULL),(2,"b"),(2,NULL),(3,"E"),(3,NULL),(3,"D"),(3,NULL),(3,NULL),(3,"D"),(4,""),(5,NULL);
-select grp,group_concat(c order by c) from t1 group by grp;
-
-# Test warnings
-
-set group_concat_max_len = 4;
-select grp,group_concat(c) from t1 group by grp;
-show warnings;
-set group_concat_max_len = 1024;
-
-# Test errors
-
---error 1111
-select group_concat(sum(c)) from t1 group by grp;
---error 1054
-select grp,group_concat(c order by 2) from t1 group by grp;
-
-drop table t1;
-
-# Test variable length
-
-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);
-# Make this order independent
---replace_result www.help.com X www.host.com X www.google.com X
-select REQ_ID, Group_Concat(URL) as URL from t1, t2 where
-t2.URL_ID = t1.URL_ID group by REQ_ID;
-# check min/max function
---replace_result www.help.com X www.host.com X www.google.com X
-select REQ_ID, Group_Concat(URL) as URL, Min(t1.URL_ID) urll,
-Max(t1.URL_ID) urlg from t1, t2 where t2.URL_ID = t1.URL_ID group by REQ_ID;
-
-drop table t1;
-drop table t2;
-
-create table t1 (id int, name varchar(16));
-insert into t1 values (1,'longername'),(1,'evenlongername');
-select ifnull(group_concat(concat(t1.id, ':', t1.name)), 'shortname') as 'without distinct: how it should be' from t1;
-select distinct ifnull(group_concat(concat(t1.id, ':', t1.name)), 'shortname') as 'with distinct: cutoff at length of shortname' from t1;
-drop table t1;
-
-# check zero rows (bug#836)
-create table t1(id int);
-create table t2(id int);
-insert into t1 values(0),(1);
-select group_concat(t1.id) FROM t1,t2;
-drop table t1;
-drop table t2;
-
-# check having
-create table t1 (bar varchar(32));
-insert into t1 values('test1'),('test2');
-select group_concat(bar order by concat(bar,bar)) from t1;
-select group_concat(bar order by concat(bar,bar) desc) from t1;
-select bar from t1 having group_concat(bar)='';
-select bar from t1 having instr(group_concat(bar), "test") > 0;
-select bar from t1 having instr(group_concat(bar order by concat(bar,bar) desc), "test2,test1") > 0;
-drop table t1;
-
-# ORDER BY fix_fields()
-create table t1 (a int, a1 varchar(10));
-create table t2 (a0 int);
-insert into t1 values (0,"a"),(0,"b"),(1,"c");
-insert into t2 values (1),(2),(3);
-select group_concat(a1 order by (t1.a IN (select a0 from t2))) from t1;
-select group_concat(a1 order by (t1.a)) from t1;
-drop table t1, t2;
-
-#
-# Problem with GROUP BY (Bug #2695)
-#
-
-CREATE TABLE t1 (id1 tinyint(4) NOT NULL, id2 tinyint(4) NOT NULL);
-INSERT INTO t1 VALUES (1, 1),(1, 2),(1, 3),(1, 4),(1, 5),(2, 1),(2, 2),(2, 3);
-CREATE TABLE t2 (id1 tinyint(4) NOT NULL);
-INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
-SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 AND t1.id1=1 GROUP BY t1.id1;
-SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;
-SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY t1.id2 DESC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;
-SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY 6-t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;
-
-# The following failed when it was run twice:
-SELECT t1.id1, GROUP_CONCAT(t1.id2,6-t1.id2 ORDER BY 6-t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;
-SELECT t1.id1, GROUP_CONCAT(t1.id2,6-t1.id2 ORDER BY 6-t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;
-
-SELECT t1.id1, GROUP_CONCAT(t1.id2,"/",6-t1.id2 ORDER BY 1+0,6-t1.id2,t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;
-drop table t1,t2;
-
-#
-# Problem with distinct (Bug #3381)
-#
-
-create table t1 (s1 char(10), s2 int not null);
-insert into t1 values ('a',2),('b',2),('c',1),('a',3),('b',4),('c',4);
-select distinct s1 from t1 order by s2,s1;
-select group_concat(distinct s1) from t1;
-select group_concat(distinct s1 order by s2) from t1 where s2 < 4;
-# The following is wrong and needs to be fixed ASAP
-select group_concat(distinct s1 order by s2) from t1;
-drop table t1;
-
-#
-# Test with subqueries (Bug #3319)
-#
-
-create table t1 (a int, c int);
-insert into t1 values (1, 2), (2, 3), (2, 4), (3, 5);
-create table t2 (a int, c int);
-insert into t2 values (1, 5), (2, 4), (3, 3), (3,3);
-select group_concat(c) from t1;
-select group_concat(c order by (select c from t2 where t2.a=t1.a limit 1)) as grp from t1;
-select group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a)) as grp from t1;
-select group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a) desc) as grp from t1;
-select t1.a, group_concat(c order by (select c from t2 where t2.a=t1.a limit 1)) as grp from t1 group by 1;
-select t1.a, group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a)) as grp from t1 group by 1;
-select t1.a, group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a) desc) as grp from t1 group by 1;
-
-# The following returns random results as we are sorting on blob addresses
-select group_concat(c order by (select concat(5-t1.c,group_concat(c order by a)) from t2 where t2.a=t1.a)) as grp from t1;
-select group_concat(c order by (select concat(t1.c,group_concat(c)) from t2 where a=t1.a)) as grp from t1;
-
-select a,c,(select group_concat(c order by a) from t2 where a=t1.a) as grp from t1 order by grp;
-drop table t1,t2;
-
-#
-# group_concat of expression with GROUP BY and external GROUP BY
-#
-CREATE TABLE t1 ( a int );
-CREATE TABLE t2 ( a int );
-INSERT INTO t1 VALUES (1), (2);
-INSERT INTO t2 VALUES (1), (2);
-SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) FROM t1, t2 GROUP BY t1.a;
-DROP TABLE t1, t2;
-
-#
-# Bug #4035: group_concat() and HAVING
-#
-
-CREATE TABLE t1 (a char(4));
-INSERT INTO t1 VALUES ('John'), ('Anna'), ('Bill');
-SELECT GROUP_CONCAT(a SEPARATOR '||') AS names FROM t1
- HAVING names LIKE '%An%';
-SELECT GROUP_CONCAT(a SEPARATOR '###') AS names FROM t1
- HAVING LEFT(names, 1) ='J';
-DROP TABLE t1;
-
-#
-# check blobs
-#
-
-CREATE TABLE t1 ( a int, b TEXT );
-INSERT INTO t1 VALUES (1,'First Row'), (2,'Second Row');
-SELECT GROUP_CONCAT(b ORDER BY b) FROM t1 GROUP BY a;
-DROP TABLE t1;
-
-#
-# check null values #2
-#
-
-CREATE TABLE t1 (A_ID INT NOT NULL,A_DESC CHAR(3) NOT NULL,PRIMARY KEY (A_ID));
-INSERT INTO t1 VALUES (1,'ABC'), (2,'EFG'), (3,'HIJ');
-CREATE TABLE t2 (A_ID INT NOT NULL,B_DESC CHAR(3) NOT NULL,PRIMARY KEY (A_ID,B_DESC));
-INSERT INTO t2 VALUES (1,'A'),(1,'B'),(3,'F');
-SELECT t1.A_ID, GROUP_CONCAT(t2.B_DESC) AS B_DESC FROM t1 LEFT JOIN t2 ON t1.A_ID=t2.A_ID GROUP BY t1.A_ID ORDER BY t1.A_DESC;
-DROP TABLE t1;
-DROP TABLE t2;
-
-#
-# blobs
-#
-
-create table t1 (a int, b text);
-insert into t1 values (1, 'bb'), (1, 'ccc'), (1, 'a'), (1, 'bb'), (1, 'ccc');
-insert into t1 values (2, 'BB'), (2, 'CCC'), (2, 'A'), (2, 'BB'), (2, 'CCC');
-select group_concat(b) from t1 group by a;
-select group_concat(distinct b) from t1 group by a;
-select group_concat(b order by b) from t1 group by a;
-select group_concat(distinct b order by b) from t1 group by a;
-set local group_concat_max_len=4;
-select group_concat(b) from t1 group by a;
-select group_concat(distinct b) from t1 group by a;
-select group_concat(b order by b) from t1 group by a;
-select group_concat(distinct b order by b) from t1 group by a;
-
-#
-# long blobs
-#
-
-insert into t1 values (1, concat(repeat('1', 300), '2')),
-(1, concat(repeat('1', 300), '2')), (1, concat(repeat('0', 300), '1')),
-(2, concat(repeat('1', 300), '2')), (2, concat(repeat('1', 300), '2')),
-(2, concat(repeat('0', 300), '1'));
-set local group_concat_max_len=1024;
-select group_concat(b) from t1 group by a;
-select group_concat(distinct b) from t1 group by a;
-select group_concat(b order by b) from t1 group by a;
-select group_concat(distinct b order by b) from t1 group by a;
-set local group_concat_max_len=400;
-select group_concat(b) from t1 group by a;
-select group_concat(distinct b) from t1 group by a;
-select group_concat(b order by b) from t1 group by a;
-select group_concat(distinct b order by b) from t1 group by a;
-
-drop table t1;
-
-#
-# Bug#10201
-#
-create table t1 (a varchar(255) character set cp1250 collate cp1250_general_ci,
- b varchar(255) character set koi8r);
-insert into t1 values ('xxx','yyy');
-select collation(a) from t1;
-select collation(group_concat(a)) from t1;
-create table t2 select group_concat(a) as a from t1;
-show create table t2;
-select collation(group_concat(a,_koi8r'test')) from t1;
---error 1267
-select collation(group_concat(a,_koi8r 0xC1C2)) from t1;
---error 1267
-select collation(group_concat(a,b)) from t1;
-drop table t1;
-drop table t2;
-
-#
-# Bug #12829
-# Cannot convert the charset of a GROUP_CONCAT result
-#
-CREATE TABLE t1 (a CHAR(10) CHARACTER SET cp850);
-INSERT INTO t1 VALUES ('');
-SELECT a FROM t1;
-SELECT GROUP_CONCAT(a) FROM t1;
-DROP TABLE t1;
-
-#
-# bug #7769: group_concat returning null is checked in having
-#
-CREATE TABLE t1 (id int);
-SELECT GROUP_CONCAT(id) AS gc FROM t1 HAVING gc IS NULL;
-DROP TABLE t1;
-
-#
-# Bug #8656: Crash with group_concat on alias in outer table
-#
-create table t2 (a int, b int);
-insert into t2 values (1,1), (2,2);
-select b x, (select group_concat(x) from t2) from t2;
-drop table t2;
-
-#
-# Bug #7405: problems with rollup
-#
-
-create table t1 (d int not null auto_increment,primary key(d), a int, b int, c int);
-insert into t1(a,b) values (1,3), (1,4), (1,2), (2,7), (1,1), (1,2), (2,3), (2,3);
-select d,a,b from t1 order by a;
-explain select a, group_concat(b) from t1 group by a with rollup;
-select a, group_concat(b) from t1 group by a with rollup;
-select a, group_concat(distinct b) from t1 group by a with rollup;
-select a, group_concat(b order by b) from t1 group by a with rollup;
-select a, group_concat(distinct b order by b) from t1 group by a with rollup;
-drop table t1;
-
-#
-# Bug #6475
-#
-create table t1 (a char(3), b char(20), primary key (a, b));
-insert into t1 values ('ABW', 'Dutch'), ('ABW', 'English');
-select group_concat(a) from t1 group by b;
-drop table t1;
-#
-# Bug #12095: GROUP_CONCAT for one row table
-#
-
-CREATE TABLE t1 (
- aID smallint(5) unsigned NOT NULL auto_increment,
- sometitle varchar(255) NOT NULL default '',
- bID smallint(5) unsigned NOT NULL,
- PRIMARY KEY (aID),
- UNIQUE KEY sometitle (sometitle)
-);
-INSERT INTO t1 SET sometitle = 'title1', bID = 1;
-INSERT INTO t1 SET sometitle = 'title2', bID = 1;
-
-CREATE TABLE t2 (
- bID smallint(5) unsigned NOT NULL auto_increment,
- somename varchar(255) NOT NULL default '',
- PRIMARY KEY (bID),
- UNIQUE KEY somename (somename)
-);
-INSERT INTO t2 SET somename = 'test';
-
-SELECT COUNT(*), GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |')
- FROM t1 JOIN t2 ON t1.bID = t2.bID;
-INSERT INTO t2 SET somename = 'test2';
-SELECT COUNT(*), GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |')
- FROM t1 JOIN t2 ON t1.bID = t2.bID;
-DELETE FROM t2 WHERE somename = 'test2';
-SELECT COUNT(*), GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |')
- FROM t1 JOIN t2 ON t1.bID = t2.bID;
-
-DROP TABLE t1,t2;
-
-#
-# Bug #12861 hang with group_concat insubquery FROM DUAL
-#
-select * from (select group_concat('c') from DUAL) t;
-
-#
-# Bug #12859 group_concat in subquery cause incorrect not null
-#
-create table t1 ( a int not null default 0);
-select * from (select group_concat(a) from t1) t2;
-select group_concat('x') UNION ALL select 1;
-drop table t1;
-
-#
-# Bug #12863 : missing separators after first empty cancatanated elements
-#
-
-CREATE TABLE t1 (id int, a varchar(9));
-INSERT INTO t1 VALUES
- (2, ''), (1, ''), (2, 'x'), (1, 'y'), (3, 'z'), (3, '');
-
-SELECT GROUP_CONCAT(a) FROM t1;
-SELECT GROUP_CONCAT(a ORDER BY a) FROM t1;
-
-SELECT GROUP_CONCAT(a) FROM t1 GROUP BY id;
-SELECT GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY id;
-
-DROP TABLE t1;
-
-#
-# Bug #15560: GROUP_CONCAT wasn't ready for WITH ROLLUP queries
-#
-create table t1(f1 int);
-insert into t1 values(1),(2),(3);
-select f1, group_concat(f1+1) from t1 group by f1 with rollup;
-select count(distinct (f1+1)) from t1 group by f1 with rollup;
-drop table t1;
-
-#
-# Bug#14169 type of group_concat() result changed to blob if tmp_table was used
-#
-create table t1 (f1 int unsigned, f2 varchar(255));
-insert into t1 values (1,repeat('a',255)),(2,repeat('b',255));
---enable_metadata
-select f2,group_concat(f1) from t1 group by f2;
---disable_metadata
-drop table t1;
-
-# End of 4.1 tests
-
-#
-# Bug#8568 "GROUP_CONCAT returns string, unless in a UNION in which case
-# returns BLOB": add a test case, the bug can not be repeated any more.
-#
-
-set names latin1;
-create table t1 (a char, b char);
-insert into t1 values ('a', 'a'), ('a', 'b'), ('b', 'a'), ('b', 'b');
-create table t2 select group_concat(b) as a from t1 where a = 'a';
-create table t3 (select group_concat(a) as a from t1 where a = 'a') union
- (select group_concat(b) as a from t1 where a = 'b');
-select charset(a) from t2;
-select charset(a) from t3;
-drop table t1, t2, t3;
-set names default;
-
-#
-# Bug#18281 group_concat changes charset to binary
-#
-create table t1 (c1 varchar(10), c2 int);
-select charset(group_concat(c1 order by c2)) from t1;
-drop table t1;
-
-#
-# Bug #16712: group_concat returns odd string instead of intended result
-#
-CREATE TABLE t1 (a INT(10), b LONGTEXT, PRIMARY KEY (a));
-
-SET GROUP_CONCAT_MAX_LEN = 20000000;
-
-INSERT INTO t1 VALUES (1,REPEAT(CONCAT('A',CAST(CHAR(0) AS BINARY),'B'), 40000));
-INSERT INTO t1 SELECT a + 1, b FROM t1;
-
-SELECT a, CHAR_LENGTH(b) FROM t1;
-SELECT CHAR_LENGTH( GROUP_CONCAT(b) ) FROM t1;
-SET GROUP_CONCAT_MAX_LEN = 1024;
-DROP TABLE t1;
-
-#
-# Bug #22015: crash with GROUP_CONCAT over a derived table that
-# returns the results of aggregation by GROUP_CONCAT
-#
-
-CREATE TABLE t1 (a int, b int);
-
-INSERT INTO t1 VALUES (2,1), (1,2), (2,2), (1,3);
-
-SELECT GROUP_CONCAT(a), x
- FROM (SELECT a, GROUP_CONCAT(b) x FROM t1 GROUP BY a) AS s
- GROUP BY x;
-
-DROP TABLE t1;
-#
-# Bug#23451 GROUP_CONCAT truncates a multibyte utf8 character
-#
-set names utf8;
-create table t1
-(
- x text character set utf8 not null,
- y integer not null
-);
-insert into t1 values (repeat('a', 1022), 0), (repeat(_utf8 0xc3b7, 4), 0);
-let $1= 10;
-while ($1)
-{
- eval set group_concat_max_len= 1022 + $1;
- --disable_result_log
- select @x:=group_concat(x) from t1 group by y;
- --enable_result_log
- select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
- dec $1;
-}
-drop table t1;
-set group_concat_max_len=1024;
-set names latin1;
-
-#
-# Bug#14169 type of group_concat() result changed to blob if tmp_table was used
-#
-create table t1 (f1 int unsigned, f2 varchar(255));
-insert into t1 values (1,repeat('a',255)),(2,repeat('b',255));
---enable_metadata
-select f2,group_concat(f1) from t1 group by f2;
---disable_metadata
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/func_group.test b/mysql-test/suite/pbxt/t/func_group.test
deleted file mode 100644
index f3b466c463d..00000000000
--- a/mysql-test/suite/pbxt/t/func_group.test
+++ /dev/null
@@ -1,834 +0,0 @@
-#
-# simple test of all group functions
-#
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-set @sav_dpi= @@div_precision_increment;
-set div_precision_increment= 5;
-show variables like 'div_precision_increment';
-create table t1 (grp int, a bigint unsigned, c char(10) not null);
-insert into t1 values (1,1,"a");
-insert into t1 values (2,2,"b");
-insert into t1 values (2,3,"c");
-insert into t1 values (3,4,"E");
-insert into t1 values (3,5,"C");
-insert into t1 values (3,6,"D");
-
-# Test of MySQL field extension with and without matching records.
-select a,c,sum(a) from t1 group by a;
-select a,c,sum(a) from t1 where a > 10 group by a;
-select sum(a) from t1 where a > 10;
-select a from t1 order by rand(10);
-select distinct a from t1 order by rand(10);
-select count(distinct a),count(distinct grp) from t1;
-insert into t1 values (null,null,'');
-select count(distinct a),count(distinct grp) from t1;
-
-select sum(all a),count(all a),avg(all a),std(all a),variance(all a),bit_or(all a),bit_and(all a),min(all a),max(all a),min(all c),max(all c) from t1;
-select grp, sum(a),count(a),avg(a),std(a),variance(a),bit_or(a),bit_and(a),min(a),max(a),min(c),max(c) from t1 group by grp;
---disable_warnings
-select grp, sum(a)+count(a)+avg(a)+std(a)+variance(a)+bit_or(a)+bit_and(a)+min(a)+max(a)+min(c)+max(c) as sum from t1 group by grp;
---enable_warnings
-
-create table t2 (grp int, a bigint unsigned, c char(10));
-insert into t2 select grp,max(a)+max(grp),max(c) from t1 group by grp;
-
-# REPLACE ... SELECT doesn't yet work with PS
-replace into t2 select grp, a, c from t1 limit 2,1;
-select * from t2;
-
-drop table t1,t2;
-
-#
-# Problem with std()
-#
-
-CREATE TABLE t1 (id int(11),value1 float(10,2));
-INSERT INTO t1 VALUES (1,0.00),(1,1.00), (1,2.00), (2,10.00), (2,11.00), (2,12.00);
-CREATE TABLE t2 (id int(11),name char(20));
-INSERT INTO t2 VALUES (1,'Set One'),(2,'Set Two');
-select id, avg(value1), std(value1), variance(value1) from t1 group by id;
-select name, avg(value1), std(value1), variance(value1) from t1, t2 where t1.id = t2.id group by t1.id;
-drop table t1,t2;
-
-#
-# Test of bug in left join & avg
-#
-
-create table t1 (id int not null);
-create table t2 (id int not null,rating int null);
-insert into t1 values(1),(2),(3);
-insert into t2 values(1, 3),(2, NULL),(2, NULL),(3, 2),(3, NULL);
-select t1.id, avg(rating) from t1 left join t2 on ( t1.id = t2.id ) group by t1.id;
-# Test different types with avg()
-select sql_small_result t2.id, avg(rating) from t2 group by t2.id;
-select sql_big_result t2.id, avg(rating) from t2 group by t2.id;
-select sql_small_result t2.id, avg(rating+0.0e0) from t2 group by t2.id;
-select sql_big_result t2.id, avg(rating+0.0e0) from t2 group by t2.id;
-drop table t1,t2;
-
-#
-# test of count
-#
-create table t1 (a smallint(6) primary key, c char(10), b text);
-INSERT INTO t1 VALUES (1,'1','1');
-INSERT INTO t1 VALUES (2,'2','2');
-INSERT INTO t1 VALUES (4,'4','4');
-
-select count(*) from t1;
-select count(*) from t1 where a = 1;
-select count(*) from t1 where a = 100;
-select count(*) from t1 where a >= 10;
-select count(a) from t1 where a = 1;
-select count(a) from t1 where a = 100;
-select count(a) from t1 where a >= 10;
-select count(b) from t1 where b >= 2;
-select count(b) from t1 where b >= 10;
-select count(c) from t1 where c = 10;
-drop table t1;
-
-#
-# Test of bug in COUNT(i)*(i+0)
-#
-
-CREATE TABLE t1 (d DATETIME, i INT);
-INSERT INTO t1 VALUES (NOW(), 1);
-SELECT COUNT(i), i, COUNT(i)*i FROM t1 GROUP BY i;
-SELECT COUNT(i), (i+0), COUNT(i)*(i+0) FROM t1 GROUP BY i;
-DROP TABLE t1;
-
-#
-# Another SUM() problem with 3.23.2
-#
-
-create table t1 (
- num float(5,2),
- user char(20)
-);
-insert into t1 values (10.3,'nem'),(20.53,'monty'),(30.23,'sinisa');
-insert into t1 values (30.13,'nem'),(20.98,'monty'),(10.45,'sinisa');
-insert into t1 values (5.2,'nem'),(8.64,'monty'),(11.12,'sinisa');
-select sum(num) from t1;
-select sum(num) from t1 group by user;
-drop table t1;
-
-#
-# Test problem with MIN() optimization in case of null values
-#
-
-create table t1 (a1 int, a2 char(3), key k1(a1), key k2(a2));
-insert into t1 values(10,'aaa'), (10,null), (10,'bbb'), (20,'zzz');
-create table t2(a1 char(3), a2 int, a3 real, key k1(a1), key k2(a2, a1));
-select * from t1;
-# The following returned NULL in 4.0.10
-select min(a2) from t1;
-select max(t1.a1), max(t2.a2) from t1, t2;
-select max(t1.a1) from t1, t2;
-select max(t2.a2), max(t1.a1) from t1, t2;
-
-explain select min(a2) from t1;
-explain select max(t1.a1), max(t2.a2) from t1, t2;
-
-insert into t2 values('AAA', 10, 0.5);
-insert into t2 values('BBB', 20, 1.0);
-select t1.a1, t1.a2, t2.a1, t2.a2 from t1,t2;
-
-SET @save_optimizer_switch=@@optimizer_switch;
-SET optimizer_switch='outer_join_with_cache=off';
-select max(t1.a1), max(t2.a1) from t1, t2 where t2.a2=9;
-select max(t2.a1), max(t1.a1) from t1, t2 where t2.a2=9;
-select t1.a1, t1.a2, t2.a1, t2.a2 from t1 left outer join t2 on t1.a1=10;
-select max(t1.a2) from t1 left outer join t2 on t1.a1=10;
-select max(t2.a1) from t2 left outer join t1 on t2.a2=10 where t2.a2=20;
-select max(t2.a1) from t2 left outer join t1 on t2.a2=10 where t2.a2=10;
-select max(t2.a1) from t1 left outer join t2 on t1.a2=t2.a1 and 1=0 where t2.a1='AAA';
-select max(t1.a2),max(t2.a1) from t1 left outer join t2 on t1.a1=10;
-SET optimizer_switch=@save_optimizer_switch;
-drop table t1,t2;
-
-#
-# Test of group function and NULL values
-#
-
-CREATE TABLE t1 (a int, b int);
-select count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1;
-select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a;
-insert into t1 values (1,null);
-select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a;
-insert into t1 values (1,null);
-insert into t1 values (2,null);
-select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a;
-select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a;
-insert into t1 values (2,1);
-select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a;
-select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a;
-insert into t1 values (3,1);
-select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a;
-select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b), bit_xor(b) from t1 group by a;
-explain extended select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b), bit_xor(b) from t1 group by a;
-drop table t1;
-
-#
-# Bug #1972: test for bit_and(), bit_or() and negative values
-#
-create table t1 (col int);
-insert into t1 values (-1), (-2), (-3);
-select bit_and(col), bit_or(col) from t1;
-select SQL_BIG_RESULT bit_and(col), bit_or(col) from t1 group by col;
-drop table t1;
-
-#
-# Bug #3376: avg() and an empty table
-#
-
-create table t1 (a int);
-select avg(2) from t1;
-drop table t1;
-
-#
-# Tests to check MIN/MAX query optimization
-#
-
-# Create database schema
-create table t1(
- a1 char(3) primary key,
- a2 smallint,
- a3 char(3),
- a4 real,
- a5 date,
- key k1(a2,a3),
- key k2(a4 desc,a1),
- key k3(a5,a1)
-);
-create table t2(
- a1 char(3) primary key,
- a2 char(17),
- a3 char(2),
- a4 char(3),
- key k1(a3, a2),
- key k2(a4)
-);
-
-# Populate table t1
-insert into t1 values('AME',0,'SEA',0.100,date'1942-02-19');
-insert into t1 values('HBR',1,'SEA',0.085,date'1948-03-05');
-insert into t1 values('BOT',2,'SEA',0.085,date'1951-11-29');
-insert into t1 values('BMC',3,'SEA',0.085,date'1958-09-08');
-insert into t1 values('TWU',0,'LAX',0.080,date'1969-10-05');
-insert into t1 values('BDL',0,'DEN',0.080,date'1960-11-27');
-insert into t1 values('DTX',1,'NYC',0.080,date'1961-05-04');
-insert into t1 values('PLS',1,'WDC',0.075,date'1949-01-02');
-insert into t1 values('ZAJ',2,'CHI',0.075,date'1960-06-15');
-insert into t1 values('VVV',2,'MIN',0.075,date'1959-06-28');
-insert into t1 values('GTM',3,'DAL',0.070,date'1977-09-23');
-insert into t1 values('SSJ',null,'CHI',null,date'1974-03-19');
-insert into t1 values('KKK',3,'ATL',null,null);
-insert into t1 values('XXX',null,'MIN',null,null);
-insert into t1 values('WWW',1,'LED',null,null);
-
-# Populate table t2
-insert into t2 values('TKF','Seattle','WA','AME');
-insert into t2 values('LCC','Los Angeles','CA','TWU');
-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');
-
-# Show the table contents
-select * from t1;
-select * from t2;
-
-# Queries with min/max functions
-# which regular min/max optimization are applied to
-
-explain
-select min(a1) from t1;
-select min(a1) from t1;
-explain
-select max(a4) from t1;
-select max(a4) from t1;
-explain
-select min(a5), max(a5) from t1;
-select min(a5), max(a5) from t1;
-explain
-select min(a3) from t1 where a2 = 2;
-select min(a3) from t1 where a2 = 2;
-explain
-select min(a1), max(a1) from t1 where a4 = 0.080;
-select min(a1), max(a1) from t1 where a4 = 0.080;
-
-explain
-select min(t1.a5), max(t2.a3) from t1, t2;
-select min(t1.a5), max(t2.a3) from t1, t2;
-explain
-select min(t1.a3), max(t2.a2) from t1, t2 where t1.a2 = 0 and t2.a3 = 'CA';
-select min(t1.a3), max(t2.a2) from t1, t2 where t1.a2 = 0 and t2.a3 = 'CA';
-
-# Queries with min/max functions
-# which extended min/max optimization are applied to
-
-explain
-select min(a1) from t1 where a1 > 'KKK';
-select min(a1) from t1 where a1 > 'KKK';
-explain
-select min(a1) from t1 where a1 >= 'KKK';
-select min(a1) from t1 where a1 >= 'KKK';
-explain
-select max(a3) from t1 where a2 = 2 and a3 < 'SEA';
-select max(a3) from t1 where a2 = 2 and a3 < 'SEA';
-explain
-select max(a5) from t1 where a5 < date'1970-01-01';
-select max(a5) from t1 where a5 < date'1970-01-01';
-explain
-select max(a3) from t1 where a2 is null;
-select max(a3) from t1 where a2 is null;
-explain
-select max(a3) from t1 where a2 = 0 and a3 between 'K' and 'Q';
-select max(a3) from t1 where a2 = 0 and a3 between 'K' and 'Q';
-explain
-select min(a1), max(a1) from t1 where a1 between 'A' and 'P';
-select min(a1), max(a1) from t1 where a1 between 'A' and 'P';
-explain
-select max(a3) from t1 where a3 < 'SEA' and a2 = 2 and a3 <= 'MIN';
-select max(a3) from t1 where a3 < 'SEA' and a2 = 2 and a3 <= 'MIN';
-explain
-select max(a3) from t1 where a3 = 'MIN' and a2 = 2;
-select max(a3) from t1 where a3 = 'MIN' and a2 = 2;
-explain
-select max(a3) from t1 where a3 = 'DEN' and a2 = 2;
-select max(a3) from t1 where a3 = 'DEN' and a2 = 2;
-
-explain
-select max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'MIN' and t2.a3 = 'CA';
-select max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'MIN' and t2.a3 = 'CA';
-
-explain
-select max(a3) from t1 where a2 is null and a2 = 2;
-select max(a3) from t1 where a2 is null and a2 = 2;
-
-explain
-select max(a2) from t1 where a2 >= 1;
-select max(a2) from t1 where a2 >= 1;
-explain
-select min(a3) from t1 where a2 = 2 and a3 < 'SEA';
-select min(a3) from t1 where a2 = 2 and a3 < 'SEA';
-
-explain
-select min(a3) from t1 where a2 = 4;
-select min(a3) from t1 where a2 = 4;
-explain
-select min(a3) from t1 where a2 = 2 and a3 > 'SEA';
-select min(a3) from t1 where a2 = 2 and a3 > 'SEA';
-explain
-select (min(a4)+max(a4))/2 from t1;
-select (min(a4)+max(a4))/2 from t1;
-explain
-select min(a3) from t1 where 2 = a2;
-select min(a3) from t1 where 2 = a2;
-explain
-select max(a3) from t1 where a2 = 2 and 'SEA' > a3;
-select max(a3) from t1 where a2 = 2 and 'SEA' > a3;
-explain
-select max(a3) from t1 where a2 = 2 and 'SEA' < a3;
-select max(a3) from t1 where a2 = 2 and 'SEA' < a3;
-explain
-select min(a3) from t1 where a2 = 2 and a3 >= 'CHI';
-select min(a3) from t1 where a2 = 2 and a3 >= 'CHI';
-explain
-select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 < 'SEA';
-select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 < 'SEA';
-explain
-select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 = 'MIN';
-select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 = 'MIN';
-explain
-select min(a3) from t1 where a2 = 2 and a3 >= 'SEA' and a3 = 'MIN';
-select min(a3) from t1 where a2 = 2 and a3 >= 'SEA' and a3 = 'MIN';
-
-explain
-select min(t1.a1), min(t2.a4) from t1,t2 where t1.a1 < 'KKK' and t2.a4 < 'KKK';
-select min(t1.a1), min(t2.a4) from t1,t2 where t1.a1 < 'KKK' and t2.a4 < 'KKK';
-
-# Queries to which max/min optimization is not applied
-
-explain
-select min(a1) from t1 where a1 > 'KKK' or a1 < 'XXX';
-explain
-select min(a1) from t1 where a1 != 'KKK';
-explain
-select max(a3) from t1 where a2 < 2 and a3 < 'SEA';
-explain
-select max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'MIN' and t2.a3 > 'CA';
-
-explain
-select min(a4 - 0.01) from t1;
-explain
-select max(a4 + 0.01) from t1;
-explain
-select min(a3) from t1 where (a2 +1 ) is null;
-explain
-select min(a3) from t1 where (a2 + 1) = 2;
-explain
-select min(a3) from t1 where 2 = (a2 + 1);
-explain
-select min(a2) from t1 where a2 < 2 * a2 - 8;
-explain
-select min(a1) from t1 where a1 between a3 and 'KKK';
-explain
-select min(a4) from t1 where (a4 + 0.01) between 0.07 and 0.08;
-explain
-select concat(min(t1.a1),min(t2.a4)) from t1, t2 where t2.a4 <> 'AME';
-drop table t1, t2;
-
-# Moved to func_group_innodb
-#--disable_warnings
-#create table t1 (USR_ID integer not null, MAX_REQ integer not null, constraint PK_SEA_USER primary key (USR_ID)) engine=InnoDB;
-#--enable_warnings
-#insert into t1 values (1, 3);
-#select count(*) + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ from t1 group by MAX_REQ;
-#select Case When Count(*) < MAX_REQ Then 1 Else 0 End from t1 where t1.USR_ID = 1 group by MAX_REQ;
-#drop table t1;
-
-
-create table t1 (a char(10));
-insert into t1 values ('a'),('b'),('c');
-select coercibility(max(a)) from t1;
-drop table t1;
-
-#
-# Bug #6658 MAX(column) returns incorrect coercibility
-#
-create table t1 (a char character set latin2);
-insert into t1 values ('a'),('b');
-select charset(max(a)), coercibility(max(a)),
- charset(min(a)), coercibility(min(a)) from t1;
-show create table t1;
-create table t2 select max(a),min(a) from t1;
-show create table t2;
-drop table t2;
-create table t2 select concat(a) from t1;
-show create table t2;
-drop table t2,t1;
-
-#
-# aggregate functions on static tables
-#
-create table t1 (a int);
-insert into t1 values (1);
-select max(a) as b from t1 having b=1;
-select a from t1 having a=1;
-drop table t1;
-
-#
-# Bug #3435: variance(const), stddev(const) and an empty table
-#
-
-create table t1 (a int);
-select variance(2) from t1;
-select stddev(2) from t1;
-drop table t1;
-
-
-#
-# cleunup() of optimized away count(*) and max/min
-#
-create table t1 (a int);
-insert into t1 values (1),(2);
-prepare stmt1 from 'SELECT COUNT(*) FROM t1';
-execute stmt1;
-execute stmt1;
-execute stmt1;
-deallocate prepare stmt1;
-drop table t1;
-
-create table t1 (a int, primary key(a));
-insert into t1 values (1),(2);
-prepare stmt1 from 'SELECT max(a) FROM t1';
-execute stmt1;
-execute stmt1;
-execute stmt1;
-deallocate prepare stmt1;
-drop table t1;
-
-#
-# Bug #5406 min/max optimization for empty set
-#
-
-CREATE TABLE t1 (a int primary key);
-INSERT INTO t1 VALUES (1),(2),(3),(4);
-
-SELECT MAX(a) FROM t1 WHERE a > 5;
-SELECT MIN(a) FROM t1 WHERE a < 0;
-
-DROP TABLE t1;
-
-#
-# Bug #5555 GROUP BY enum_field" returns incorrect results
-#
-
-CREATE TABLE t1 (
- id int(10) unsigned NOT NULL auto_increment,
- val enum('one','two','three') NOT NULL default 'one',
- PRIMARY KEY (id)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
-INSERT INTO t1 VALUES
-(1,'one'),(2,'two'),(3,'three'),(4,'one'),(5,'two');
-
-select val, count(*) from t1 group by val;
-drop table t1;
-
-CREATE TABLE t1 (
- id int(10) unsigned NOT NULL auto_increment,
- val set('one','two','three') NOT NULL default 'one',
- PRIMARY KEY (id)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
-INSERT INTO t1 VALUES
-(1,'one'),(2,'two'),(3,'three'),(4,'one'),(5,'two');
-
-select val, count(*) from t1 group by val;
-drop table t1;
-
-#
-# Bug #5615: type of aggregate function column wrong when using group by
-#
-
-create table t1(a int, b datetime);
-insert into t1 values (1, NOW()), (2, NOW());
-create table t2 select MAX(b) from t1 group by a;
-show create table t2;
-drop table t1, t2;
-
-#
-# Bug 7833: Wrong datatype of aggregate column is returned
-#
-
-create table t1(f1 datetime);
-insert into t1 values (now());
-create table t2 select f2 from (select max(now()) f2 from t1) a;
-show columns from t2;
-drop table t2;
-create table t2 select f2 from (select now() f2 from t1) a;
-show columns from t2;
-drop table t2, t1;
-
-#
-# Bug 8893: wrong result for min/max optimization with 2 indexes
-#
-
-CREATE TABLE t1(
- id int PRIMARY KEY,
- a int,
- b int,
- INDEX i_b_id(a,b,id),
- INDEX i_id(a,id)
-);
-INSERT INTO t1 VALUES
- (1,1,4), (2,2,1), (3,1,3), (4,2,1), (5,1,1);
-SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6;
-DROP TABLE t1;
-
-# change the order of the last two index definitions
-
-CREATE TABLE t1(
- id int PRIMARY KEY,
- a int,
- b int,
- INDEX i_id(a,id),
- INDEX i_b_id(a,b,id)
-);
-INSERT INTO t1 VALUES
- (1,1,4), (2,2,1), (3,1,3), (4,2,1), (5,1,1);
-SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6;
-DROP TABLE t1;
-
-
-#
-# Bug #12882 min/max inconsistent on empty table
-#
-# Test case moved to func_group_innodb
-#
-# Bug #18206: min/max optimization cannot be applied to partial index
-#
-
-CREATE TABLE t1 (id int PRIMARY KEY, b char(3), INDEX(b));
-INSERT INTO t1 VALUES (1,'xx'), (2,'aa');
-SELECT * FROM t1;
-
-SELECT MAX(b) FROM t1 WHERE b < 'ppppp';
-SHOW WARNINGS;
-SELECT MAX(b) FROM t1 WHERE b < 'pp';
-DROP TABLE t1;
-
-CREATE TABLE t1 (id int PRIMARY KEY, b char(16), INDEX(b(4)));
-INSERT INTO t1 VALUES (1, 'xxxxbbbb'), (2, 'xxxxaaaa');
-SELECT MAX(b) FROM t1;
-EXPLAIN SELECT MAX(b) FROM t1;
-DROP TABLE t1;
-
-CREATE TABLE t1 (id int , b varchar(512), INDEX(b(250))) COLLATE latin1_bin;
-INSERT INTO t1 VALUES
- (1,CONCAT(REPEAT('_', 250), "qq")), (1,CONCAT(REPEAT('_', 250), "zz")),
- (1,CONCAT(REPEAT('_', 250), "aa")), (1,CONCAT(REPEAT('_', 250), "ff"));
-
-SELECT MAX(b) FROM t1;
-EXPLAIN SELECT MAX(b) FROM t1;
-DROP TABLE t1;
-#
-# Bug #16792 query with subselect, join, and group not returning proper values
-#
-CREATE TABLE t1 (a INT, b INT);
-INSERT INTO t1 VALUES (1,1),(1,2),(2,3);
-
-SELECT (SELECT COUNT(DISTINCT t1.b)) FROM t1 GROUP BY t1.a;
-SELECT (SELECT COUNT(DISTINCT 12)) FROM t1 GROUP BY t1.a;
-# an attempt to test all aggregate function with no table.
-SELECT AVG(2), BIT_AND(2), BIT_OR(2), BIT_XOR(2), COUNT(*), COUNT(12),
- COUNT(DISTINCT 12), MIN(2),MAX(2),STD(2), VARIANCE(2),SUM(2),
- GROUP_CONCAT(2),GROUP_CONCAT(DISTINCT 2);
-DROP TABLE t1;
-
-# End of 4.1 tests
-
-#
-# decimal-related tests
-#
-create table t2 (ff double);
-insert into t2 values (2.2);
-select cast(sum(distinct ff) as decimal(5,2)) from t2;
-select cast(sum(distinct ff) as signed) from t2;
-select cast(variance(ff) as decimal(10,3)) from t2;
-select cast(min(ff) as decimal(5,2)) from t2;
-
-create table t1 (df decimal(5,1));
-insert into t1 values(1.1);
-insert into t1 values(2.2);
-select cast(sum(distinct df) as signed) from t1;
-select cast(min(df) as signed) from t1;
-select 1e8 * sum(distinct df) from t1;
-select 1e8 * min(df) from t1;
-
-create table t3 (ifl int);
-insert into t3 values(1), (2);
-select cast(min(ifl) as decimal(5,2)) from t3;
-
-drop table t1, t2, t3;
-
-
-#
-# BUG#3190, WL#1639: Standard Deviation STDDEV - 2 different calculations
-#
-
-CREATE TABLE t1 (id int(11),value1 float(10,2));
-INSERT INTO t1 VALUES (1,0.00),(1,1.00), (1,2.00), (2,10.00), (2,11.00), (2,12.00), (2,13.00);
-select id, stddev_pop(value1), var_pop(value1), stddev_samp(value1), var_samp(value1) from t1 group by id;
-DROP TABLE t1;
-
-#
-# BUG#8464 decimal AVG returns incorrect result
-#
-
-CREATE TABLE t1 (col1 decimal(16,12));
-INSERT INTO t1 VALUES (-5.00000000001),(-5.00000000002),(-5.00000000003),(-5.00000000000),(-5.00000000001),(-5.00000000002);
-insert into t1 select * from t1;
-select col1,count(col1),sum(col1),avg(col1) from t1 group by col1;
-DROP TABLE t1;
-
-#
-# BUG#8465 decimal MIN and MAX return incorrect result
-#
-
-create table t1 (col1 decimal(16,12));
-insert into t1 values (-5.00000000001);
-insert into t1 values (-5.00000000001);
-select col1,sum(col1),max(col1),min(col1) from t1 group by col1;
-delete from t1;
-insert into t1 values (5.00000000001);
-insert into t1 values (5.00000000001);
-select col1,sum(col1),max(col1),min(col1) from t1 group by col1;
-DROP TABLE t1;
-
-#
-# Test that new VARCHAR correctly works with COUNT(DISTINCT)
-#
-
-CREATE TABLE t1 (a VARCHAR(400));
-INSERT INTO t1 (a) VALUES ("A"), ("a"), ("a "), ("a "),
- ("B"), ("b"), ("b "), ("b ");
-SELECT COUNT(DISTINCT a) FROM t1;
-DROP TABLE t1;
-
-#
-# Test for buf #9210: GROUP BY with expression if a decimal type
-#
-
-CREATE TABLE t1 (a int, b int, c int);
-INSERT INTO t1 (a, b, c) VALUES
- (1,1,1), (1,1,2), (1,1,3),
- (1,2,1), (1,2,2), (1,2,3),
- (1,3,1), (1,3,2), (1,3,3),
- (2,1,1), (2,1,2), (2,1,3),
- (2,2,1), (2,2,2), (2,2,3),
- (2,3,1), (2,3,2), (2,3,3),
- (3,1,1), (3,1,2), (3,1,3),
- (3,2,1), (3,2,2), (3,2,3),
- (3,3,1), (3,3,2), (3,3,3);
-
-SELECT b/c as v, a FROM t1 ORDER BY v, a; # PBXT: Need a consistant order
-SELECT b/c as v, SUM(a) FROM t1 GROUP BY v;
-SELECT SUM(a) FROM t1 GROUP BY b/c;
-
-DROP TABLE t1;
-set div_precision_increment= @sav_dpi;
-
-#
-# Bug #20868: Client connection is broken on SQL query error
-#
-CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
-INSERT INTO t1 VALUES (1,1), (2,2);
-
-CREATE TABLE t2 (a INT PRIMARY KEY, b INT);
-INSERT INTO t2 VALUES (1,1), (3,3);
-
-SELECT SQL_NO_CACHE
- (SELECT SUM(c.a) FROM t1 ttt, t2 ccc
- WHERE ttt.a = ccc.b AND ttt.a = t.a GROUP BY ttt.a) AS minid
-FROM t1 t, t2 c WHERE t.a = c.b;
-
-DROP TABLE t1,t2;
-
-#
-# Bug #10966: Variance functions return wrong data type
-#
-
-create table t1 select variance(0);
-show create table t1;
-drop table t1;
-create table t1 select stddev(0);
-show create table t1;
-drop table t1;
-
-
-#
-# Bug#22555: STDDEV yields positive result for groups with only one row
-#
-
-create table bug22555 (i smallint primary key auto_increment, s1 smallint, s2 smallint, e decimal(30,10), o double);
-insert into bug22555 (s1, s2, e, o) values (53, 78, 11.4276528, 6.828112), (17, 78, 5.916793, 1.8502951), (18, 76, 2.679231, 9.17975591), (31, 62, 6.07831, 0.1), (19, 41, 5.37463, 15.1), (83, 73, 14.567426, 7.959222), (92, 53, 6.10151, 13.1856852), (7, 12, 13.92272, 3.442007), (92, 35, 11.95358909, 6.01376678), (38, 84, 2.572, 7.904571);
-select std(s1/s2) from bug22555 group by i;
-select std(e) from bug22555 group by i;
-select std(o) from bug22555 group by i;
-drop table bug22555;
-
-create table bug22555 (i smallint, s1 smallint, s2 smallint, o1 double, o2 double, e1 decimal, e2 decimal);
-insert into bug22555 values (1,53,78,53,78,53,78),(2,17,78,17,78,17,78),(3,18,76,18,76,18,76);
-select i, count(*) from bug22555 group by i;
-select std(s1/s2) from bug22555 where i=1;
-select std(s1/s2) from bug22555 where i=2;
-select std(s1/s2) from bug22555 where i=3;
-select std(s1/s2) from bug22555 where i=1 group by i;
-select std(s1/s2) from bug22555 where i=2 group by i;
-select std(s1/s2) from bug22555 where i=3 group by i;
-select std(s1/s2) from bug22555 group by i order by i;
-select i, count(*), std(o1/o2) from bug22555 group by i order by i;
-select i, count(*), std(e1/e2) from bug22555 group by i order by i;
-set @saved_div_precision_increment=@@div_precision_increment;
-set div_precision_increment=19;
-select i, count(*), variance(s1/s2) from bug22555 group by i order by i;
-select i, count(*), variance(o1/o2) from bug22555 group by i order by i;
-select i, count(*), variance(e1/e2) from bug22555 group by i order by i;
-select i, count(*), std(s1/s2) from bug22555 group by i order by i;
-select i, count(*), std(o1/o2) from bug22555 group by i order by i;
-select i, count(*), std(e1/e2) from bug22555 group by i order by i;
-set div_precision_increment=20;
-select i, count(*), variance(s1/s2) from bug22555 group by i order by i;
-select i, count(*), variance(o1/o2) from bug22555 group by i order by i;
-select i, count(*), variance(e1/e2) from bug22555 group by i order by i;
-select i, count(*), std(s1/s2) from bug22555 group by i order by i;
-select i, count(*), std(o1/o2) from bug22555 group by i order by i;
-select i, count(*), std(e1/e2) from bug22555 group by i order by i;
-set @@div_precision_increment=@saved_div_precision_increment;
-insert into bug22555 values (1,53,78,53,78,53,78),(2,17,78,17,78,17,78),(3,18,76,18,76,18,76);
-insert into bug22555 values (1,53,78,53,78,53,78),(2,17,78,17,78,17,78),(3,18,76,18,76,18,76);
-insert into bug22555 values (1,53,78,53,78,53,78),(2,17,78,17,78,17,78),(3,18,76,18,76,18,76);
-
-select i, count(*), std(s1/s2) from bug22555 group by i order by i;
-select i, count(*), std(o1/o2) from bug22555 group by i order by i;
-select i, count(*), std(e1/e2) from bug22555 group by i order by i;
-select std(s1/s2) from bug22555;
-select std(o1/o2) from bug22555;
-select std(e1/e2) from bug22555;
-set @saved_div_precision_increment=@@div_precision_increment;
-set div_precision_increment=19;
-select i, count(*), std(s1/s2) from bug22555 group by i order by i;
-select i, count(*), std(o1/o2) from bug22555 group by i order by i;
-select i, count(*), std(e1/e2) from bug22555 group by i order by i;
-select round(std(s1/s2), 17) from bug22555;
-select std(o1/o2) from bug22555;
-select round(std(e1/e2), 17) from bug22555;
-set div_precision_increment=20;
-select i, count(*), std(s1/s2) from bug22555 group by i order by i;
-select i, count(*), std(o1/o2) from bug22555 group by i order by i;
-select i, count(*), std(e1/e2) from bug22555 group by i order by i;
-select round(std(s1/s2), 17) from bug22555;
-select std(o1/o2) from bug22555;
-select round(std(e1/e2), 17) from bug22555;
-set @@div_precision_increment=@saved_div_precision_increment;
-drop table bug22555;
-
-create table bug22555 (s smallint, o double, e decimal);
-insert into bug22555 values (1,1,1),(2,2,2),(3,3,3),(6,6,6),(7,7,7);
-select var_samp(s), var_pop(s) from bug22555;
-select var_samp(o), var_pop(o) from bug22555;
-select var_samp(e), var_pop(e) from bug22555;
-drop table bug22555;
-
-create table bug22555 (s smallint, o double, e decimal);
-insert into bug22555 values (null,null,null),(null,null,null);
-select var_samp(s) as 'null', var_pop(s) as 'null' from bug22555;
-select var_samp(o) as 'null', var_pop(o) as 'null' from bug22555;
-select var_samp(e) as 'null', var_pop(e) as 'null' from bug22555;
-insert into bug22555 values (1,1,1);
-select var_samp(s) as 'null', var_pop(s) as '0' from bug22555;
-select var_samp(o) as 'null', var_pop(o) as '0' from bug22555;
-select var_samp(e) as 'null', var_pop(e) as '0' from bug22555;
-insert into bug22555 values (2,2,2);
-select var_samp(s) as '0.5', var_pop(s) as '0.25' from bug22555;
-select var_samp(o) as '0.5', var_pop(o) as '0.25' from bug22555;
-select var_samp(e) as '0.5', var_pop(e) as '0.25' from bug22555;
-drop table bug22555;
-
-
-#
-# Bug #23184: SELECT causes server crash
-#
-CREATE TABLE t1 (a INT, b INT);
-INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8);
-INSERT INTO t1 SELECT a, b+8 FROM t1;
-INSERT INTO t1 SELECT a, b+16 FROM t1;
-INSERT INTO t1 SELECT a, b+32 FROM t1;
-INSERT INTO t1 SELECT a, b+64 FROM t1;
-INSERT INTO t1 SELECT a, b+128 FROM t1;
-INSERT INTO t1 SELECT a, b+256 FROM t1;
-INSERT INTO t1 SELECT a, b+512 FROM t1;
-INSERT INTO t1 SELECT a, b+1024 FROM t1;
-INSERT INTO t1 SELECT a, b+2048 FROM t1;
-INSERT INTO t1 SELECT a, b+4096 FROM t1;
-INSERT INTO t1 SELECT a, b+8192 FROM t1;
-INSERT INTO t1 SELECT a, b+16384 FROM t1;
-INSERT INTO t1 SELECT a, b+32768 FROM t1;
-SELECT a,COUNT(DISTINCT b) AS cnt FROM t1 GROUP BY a HAVING cnt > 50;
-SELECT a,SUM(DISTINCT b) AS sumation FROM t1 GROUP BY a HAVING sumation > 50;
-SELECT a,AVG(DISTINCT b) AS average FROM t1 GROUP BY a HAVING average > 50;
-
-DROP TABLE t1;
-
-###
---disable_query_log
-drop database pbxt;
---enable_query_log
---echo End of 5.0 tests
diff --git a/mysql-test/suite/pbxt/t/func_if.test b/mysql-test/suite/pbxt/t/func_if.test
deleted file mode 100644
index dc83ceb771e..00000000000
--- a/mysql-test/suite/pbxt/t/func_if.test
+++ /dev/null
@@ -1,103 +0,0 @@
-#
-# Init section
-#
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-#
-# Simple IF tests
-#
-
-select IF(0,"ERROR","this"),IF(1,"is","ERROR"),IF(NULL,"ERROR","a"),IF(1,2,3)|0,IF(1,2.0,3.0)+0 ;
-
-#
-# Test of IF and case-sensitiveness
-#
-CREATE TABLE t1 (st varchar(255) NOT NULL, u int(11) NOT NULL) ENGINE=MyISAM;
-INSERT INTO t1 VALUES ('a',1),('A',1),('aa',1),('AA',1),('a',1),('aaa',0),('BBB',0);
-select if(1,st,st) s from t1 order by s;
-select if(u=1,st,st) s from t1 order by s;
-select if(u=1,binary st,st) s from t1 order by s;
-select if(u=1,st,binary st) s from t1 where st like "%a%" order by s;
-explain extended select if(u=1,st,binary st) s from t1 where st like "%a%" order by s;
-
-#
-# NULLIF test
-#
-select nullif(u, 1) from t1;
-explain extended select nullif(u, 1) from t1;
-drop table t1;
-select nullif(1,'test');
-
-#
-# Bug 2629
-#
-select NULLIF(NULL,NULL), NULLIF(NULL,1), NULLIF(NULL,1.0), NULLIF(NULL,"test");
-select NULLIF(1,NULL), NULLIF(1.0, NULL), NULLIF("test", NULL);
-
-#
-# Problem with IF()
-#
-
-create table t1 (num double(12,2));
-insert into t1 values (144.54);
-select sum(if(num is null,0.00,num)) from t1;
-drop table t1;
-create table t1 (x int, y int);
-insert into t1 values (0,6),(10,16),(20,26),(30,10),(40,46),(50,56);
-select min(if(y -x > 5,y,NULL)), max(if(y - x > 5,y,NULL)) from t1;
-drop table t1;
-
-#
-# BUG#3987
-#
-create table t1 (a int);
-insert t1 values (1),(2);
-select if(1>2,a,avg(a)) from t1;
-drop table t1;
-
-#
-# Bug #5595 NULLIF() IS NULL returns false if NULLIF() returns NULL
-#
-SELECT NULLIF(5,5) IS NULL, NULLIF(5,5) IS NOT NULL;
-
-#
-# Bug #9669 Ordering on IF function with FROM_UNIXTIME function fails
-#
-CREATE TABLE `t1` (
- `id` int(11) NOT NULL ,
- `date` int(10) default NULL,
- `text` varchar(32) NOT NULL
-);
-INSERT INTO t1 VALUES (1,1110000000,'Day 1'),(2,1111000000,'Day 2'),(3,1112000000,'Day 3');
-SELECT id, IF(date IS NULL, '-', FROM_UNIXTIME(date, '%d-%m-%Y')) AS date_ord, text FROM t1 ORDER BY date_ord ASC;
-SELECT id, IF(date IS NULL, '-', FROM_UNIXTIME(date, '%d-%m-%Y')) AS date_ord, text FROM t1 ORDER BY date_ord DESC;
-DROP TABLE t1;
-
-
-#
-# Test for bug #11142: evaluation of NULLIF when the first argument is NULL
-#
-
-CREATE TABLE t1 (a CHAR(10));
-INSERT INTO t1 VALUES ('aaa'), (NULL), (''), ('bbb');
-
-SELECT a, NULLIF(a,'') FROM t1;
-SELECT a, NULLIF(a,'') FROM t1 WHERE NULLIF(a,'') IS NULL;
-
-DROP TABLE t1;
-
-# End of 4.1 tests
-
-#
-# Bug #16272 IF function with decimal args can produce wrong result
-#
-create table t1 (f1 int, f2 int);
-insert into t1 values(1,1),(0,0);
-select f1, f2, if(f1, 40.0, 5.00) from t1 group by f1 order by f2;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/func_in.test b/mysql-test/suite/pbxt/t/func_in.test
deleted file mode 100644
index 47529647030..00000000000
--- a/mysql-test/suite/pbxt/t/func_in.test
+++ /dev/null
@@ -1,307 +0,0 @@
-# Initialise
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
-#
-# test of IN (NULL)
-#
-
-select 1 in (1,2,3);
-select 10 in (1,2,3);
-select NULL in (1,2,3);
-select 1 in (1,NULL,3);
-select 3 in (1,NULL,3);
-select 10 in (1,NULL,3);
-select 1.5 in (1.5,2.5,3.5);
-select 10.5 in (1.5,2.5,3.5);
-select NULL in (1.5,2.5,3.5);
-select 1.5 in (1.5,NULL,3.5);
-select 3.5 in (1.5,NULL,3.5);
-select 10.5 in (1.5,NULL,3.5);
-
-CREATE TABLE t1 (a int, b int, c int);
-insert into t1 values (1,2,3), (1,NULL,3);
-select 1 in (a,b,c) from t1;
-select 3 in (a,b,c) from t1;
-select 10 in (a,b,c) from t1;
-select NULL in (a,b,c) from t1;
-drop table t1;
-CREATE TABLE t1 (a float, b float, c float);
-insert into t1 values (1.5,2.5,3.5), (1.5,NULL,3.5);
-select 1.5 in (a,b,c) from t1;
-select 3.5 in (a,b,c) from t1;
-select 10.5 in (a,b,c) from t1;
-drop table t1;
-CREATE TABLE t1 (a varchar(10), b varchar(10), c varchar(10));
-insert into t1 values ('A','BC','EFD'), ('A',NULL,'EFD');
-select 'A' in (a,b,c) from t1;
-select 'EFD' in (a,b,c) from t1;
-select 'XSFGGHF' in (a,b,c) from t1;
-drop table t1;
-
-CREATE TABLE t1 (field char(1));
-INSERT INTO t1 VALUES ('A'),(NULL);
-SELECT * from t1 WHERE field IN (NULL);
-SELECT * from t1 WHERE field NOT IN (NULL);
-SELECT * from t1 where field = field;
-SELECT * from t1 where field <=> field;
-DELETE FROM t1 WHERE field NOT IN (NULL);
-SELECT * FROM t1;
-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 * from t1 where id in (2,5,9);
-drop table t1;
-
-create table t1 (
-a char(1) character set latin1 collate latin1_general_ci,
-b char(1) character set latin1 collate latin1_swedish_ci,
-c char(1) character set latin1 collate latin1_danish_ci
-);
-insert into t1 values ('A','B','C');
-insert into t1 values ('a','c','c');
---error 1267
-select * from t1 where a in (b);
---error 1270
-select * from t1 where a in (b,c);
---error 1271
-select * from t1 where 'a' in (a,b,c);
-select * from t1 where 'a' in (a);
-select * from t1 where a in ('a');
-select * from t1 where 'a' collate latin1_general_ci in (a,b,c);
-select * from t1 where 'a' collate latin1_bin in (a,b,c);
-select * from t1 where 'a' in (a,b,c collate latin1_bin);
-explain extended select * from t1 where 'a' in (a,b,c collate latin1_bin);
-drop table t1;
-
-set names utf8;
-create table t1 (a char(10) character set utf8 not null);
-insert into t1 values ('bbbb'),(_koi8r''),(_latin1'');
-select a from t1 where a in ('bbbb',_koi8r'',_latin1'') order by a;
-drop table t1;
-# Bug#7834 Illegal mix of collations in IN operator
-create table t1 (a char(10) character set latin1 not null);
-insert into t1 values ('a'),('b'),('c');
-select a from t1 where a IN ('a','b','c') order by a;
-drop table t1;
-set names latin1;
-
-select '1.0' in (1,2);
-select 1 in ('1.0',2);
-select 1 in (1,'2.0');
-select 1 in ('1.0',2.0);
-select 1 in (1.0,'2.0');
-select 1 in ('1.1',2);
-select 1 in ('1.1',2.0);
-
-# Test case for bug #6365
-
-create table t1 (a char(2) character set binary);
-insert into t1 values ('aa'), ('bb');
-select * from t1 where a in (NULL, 'aa');
-drop table t1;
-
-# BUG#13419
-create table t1 (id int, key(id));
-insert into t1 values (1),(2),(3);
-select count(*) from t1 where id not in (1);
-select count(*) from t1 where id not in (1,2);
-drop table t1;
-
-
-#
-# BUG#17047: CHAR() and IN() can return NULL without signaling NULL
-# result
-#
-# The problem was in the IN() function that ignored maybe_null flags
-# of all arguments except the first (the one _before_ the IN
-# keyword, '1' in the test case below).
-#
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-CREATE TABLE t1 SELECT 1 IN (2, NULL);
---echo SELECT should return NULL.
-SELECT * FROM t1;
-
-DROP TABLE t1;
-
-
---echo End of 4.1 tests
-
-
-#
-# Bug #11885: WHERE condition with NOT IN (one element)
-#
-
-CREATE TABLE t1 (a int PRIMARY KEY);
-INSERT INTO t1 VALUES (44), (45), (46);
-
-SELECT * FROM t1 WHERE a IN (45);
-SELECT * FROM t1 WHERE a NOT IN (0, 45);
-SELECT * FROM t1 WHERE a NOT IN (45);
-
-CREATE VIEW v1 AS SELECT * FROM t1 WHERE a NOT IN (45);
-SHOW CREATE VIEW v1;
-SELECT * FROM v1;
-
-DROP VIEW v1;
-DROP TABLE t1;
-
-# BUG#15872: Excessive memory consumption of range analysis of NOT IN
-create table t1 (a int);
-insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-create table t2 (a int, filler char(200), key(a));
-
-insert into t2 select C.a*2, 'no' from t1 A, t1 B, t1 C;
-insert into t2 select C.a*2+1, 'yes' from t1 C;
-
-explain
-select * from t2 where a NOT IN (0, 2,4,6,8,10,12,14,16,18);
-select * from t2 where a NOT IN (0, 2,4,6,8,10,12,14,16,18);
-
-# PBXT: Number rows in non-determined. (TODO: Why?)
---replace_column 9 #
-explain select * from t2 force index(a) where a NOT IN (2,2,2,2,2,2);
-# PBXT: Number rows in non-determined. (TODO: Why?)
---replace_column 9 #
-explain select * from t2 force index(a) where a <> 2;
-
-drop table t2;
-
-#
-# Repeat the test for DATETIME
-#
-create table t2 (a datetime, filler char(200), key(a));
-
-insert into t2 select '2006-04-25 10:00:00' + interval C.a minute,
- 'no' from t1 A, t1 B, t1 C where C.a % 2 = 0;
-
-insert into t2 select '2006-04-25 10:00:00' + interval C.a*2+1 minute,
- 'yes' from t1 C;
-
-explain
-select * from t2 where a NOT IN (
- '2006-04-25 10:00:00','2006-04-25 10:02:00','2006-04-25 10:04:00',
- '2006-04-25 10:06:00', '2006-04-25 10:08:00');
-select * from t2 where a NOT IN (
- '2006-04-25 10:00:00','2006-04-25 10:02:00','2006-04-25 10:04:00',
- '2006-04-25 10:06:00', '2006-04-25 10:08:00');
-drop table t2;
-
-#
-# Repeat the test for CHAR(N)
-#
-create table t2 (a varchar(10), filler char(200), key(a));
-
-insert into t2 select 'foo', 'no' from t1 A, t1 B;
-insert into t2 select 'barbar', 'no' from t1 A, t1 B;
-insert into t2 select 'bazbazbaz', 'no' from t1 A, t1 B;
-
-insert into t2 values ('fon', '1'), ('fop','1'), ('barbaq','1'),
- ('barbas','1'), ('bazbazbay', '1'),('zz','1');
-
-
-# PBXT: wait for sweeper
-analyze table t2;
-
-explain select * from t2 where a not in('foo','barbar', 'bazbazbaz');
-
-drop table t2;
-
-#
-# Repeat for DECIMAL
-#
-create table t2 (a decimal(10,5), filler char(200), key(a));
-
-insert into t2 select 345.67890, 'no' from t1 A, t1 B;
-insert into t2 select 43245.34, 'no' from t1 A, t1 B;
-insert into t2 select 64224.56344, 'no' from t1 A, t1 B;
-
-insert into t2 values (0, '1'), (22334.123,'1'), (33333,'1'),
- (55555,'1'), (77777, '1');
-
-# PBXT: wait for sweeper
-analyze table t2;
-
-explain
-select * from t2 where a not in (345.67890, 43245.34, 64224.56344);
-select * from t2 where a not in (345.67890, 43245.34, 64224.56344);
-
-drop table t2;
-
-# Try a very big IN-list
-create table t2 (a int, key(a), b int);
-insert into t2 values (1,1),(2,2);
-
-set @cnt= 1;
-set @str="update t2 set b=1 where a not in (";
-select count(*) from (
- select @str:=concat(@str, @cnt:=@cnt+1, ",")
- from t1 A, t1 B, t1 C, t1 D) Z;
-
-set @str:=concat(@str, "10000)");
-select substr(@str, 1, 50);
-prepare s from @str;
-execute s;
-deallocate prepare s;
-set @str=NULL;
-
-drop table t2;
-drop table t1;
-
-# BUG#19618: Crash in range optimizer for
-# "unsigned_keypart NOT IN(negative_number,...)"
-# (introduced in fix BUG#15872)
-create table t1 (
- some_id smallint(5) unsigned,
- key (some_id)
-);
-insert into t1 values (1),(2);
-select some_id from t1 where some_id not in(2,-1);
-select some_id from t1 where some_id not in(-4,-1,-4);
-select some_id from t1 where some_id not in(-4,-1,3423534,2342342);
-
-#
-# BUG#24261: crash when WHERE contains NOT IN ('<negative value>') for unsigned column type
-#
-
-select some_id from t1 where some_id not in('-1', '0');
-
-drop table t1;
-
-
---echo End of 5.0 tests
-
-
-#
-# Bug#18360: Type aggregation for IN and CASE may lead to a wrong result
-#
-create table t1(f1 char(1));
-insert into t1 values ('a'),('b'),('1');
-select f1 from t1 where f1 in ('a',1);
-select f1, case f1 when 'a' then '+' when 1 then '-' end from t1;
-create index t1f1_idx on t1(f1);
-select f1 from t1 where f1 in ('a',1);
-explain select f1 from t1 where f1 in ('a',1);
-select f1 from t1 where f1 in ('a','b');
-explain select f1 from t1 where f1 in ('a','b');
-select f1 from t1 where f1 in (2,1);
-explain select f1 from t1 where f1 in (2,1);
-create table t2(f2 int, index t2f2(f2));
-insert into t2 values(0),(1),(2);
-select f2 from t2 where f2 in ('a',2);
-explain select f2 from t2 where f2 in ('a',2);
-select f2 from t2 where f2 in ('a','b');
-explain select f2 from t2 where f2 in ('a','b');
-select f2 from t2 where f2 in (1,'b');
-explain select f2 from t2 where f2 in (1,'b');
-drop table t1, t2;
-
-
---disable_query_log
-drop database pbxt;
---enable_query_log
---echo End of 5.1 tests
diff --git a/mysql-test/suite/pbxt/t/func_isnull.test b/mysql-test/suite/pbxt/t/func_isnull.test
deleted file mode 100644
index 68077a4b0f2..00000000000
--- a/mysql-test/suite/pbxt/t/func_isnull.test
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# test of ISNULL()
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (id int auto_increment primary key not null, mydate date not null);
-insert into t1 values (0,"2002-05-01"),(0,"2002-05-01"),(0,"2002-05-01");
-flush tables;
-select * from t1 where isnull(to_days(mydate));
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/func_like.test b/mysql-test/suite/pbxt/t/func_like.test
deleted file mode 100644
index fbddb202a2b..00000000000
--- a/mysql-test/suite/pbxt/t/func_like.test
+++ /dev/null
@@ -1,119 +0,0 @@
-#
-# Test of like
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (a varchar(10), key(a));
-insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
-explain extended select * from t1 where a like 'abc%';
-explain extended select * from t1 where a like concat('abc','%');
-select * from t1 where a like "abc%";
-select * from t1 where a like concat("abc","%");
-select * from t1 where a like "ABC%";
-select * from t1 where a like "test%";
-select * from t1 where a like "te_t";
-
-#
-# The following will test the Turbo Boyer-Moore code
-#
-select * from t1 where a like "%a%";
-select * from t1 where a like "%abcd%";
-select * from t1 where a like "%abc\d%";
-
-drop table t1;
-
-create table t1 (a varchar(10), key(a));
-
-#
-# Bug #2231
-#
-insert into t1 values ('a'), ('a\\b');
-select * from t1 where a like 'a\\%' escape '#';
-select * from t1 where a like 'a\\%' escape '#' and a like 'a\\\\b';
-
-#
-# Bug #4200: Prepared statement parameter as argument to ESCAPE
-#
-prepare stmt1 from 'select * from t1 where a like \'a\\%\' escape ?';
-set @esc='#';
-execute stmt1 using @esc;
-deallocate prepare stmt1;
-
-drop table t1;
-
-#
-# Bug #2885: like and datetime
-#
-
-create table t1 (a datetime);
-insert into t1 values ('2004-03-11 12:00:21');
-select * from t1 where a like '2004-03-11 12:00:21';
-drop table t1;
-
-#
-# Test like with non-default character set
-#
-
-SET NAMES koi8r;
-
-CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET koi8r);
-
-INSERT INTO t1 VALUES (''),(''),(''),(''),(''),('');
-INSERT INTO t1 VALUES (''),(''),(''),('');
-INSERT INTO t1 VALUES (''),(''),(''),('');
-INSERT INTO t1 VALUES (''),(''),(''),('');
-
-SELECT * FROM t1 WHERE a LIKE '%%';
-SELECT * FROM t1 WHERE a LIKE '%%';
-SELECT * FROM t1 WHERE a LIKE '%';
-
-DROP TABLE t1;
-
-# Bug #2547 Strange "like" behaviour in tables with default charset=cp1250
-# Test like with non-default character set using TurboBM
-#
-SET NAMES cp1250;
-CREATE TABLE t1 (a varchar(250) NOT NULL) DEFAULT CHARACTER SET=cp1250;
-INSERT INTO t1 VALUES
-('Techni Tapes Sp. z o.o.'),
-('Pojazdy Szynowe PESA Bydgoszcz SA Holding'),
-('AKAPESTER 1 P.P.H.U.'),
-('Pojazdy Szynowe PESA Bydgoszcz S A Holding'),
-('PPUH PESKA-I Maria Struniarska');
-
-select * from t1 where a like '%PESA%';
-select * from t1 where a like '%PESA %';
-select * from t1 where a like '%PES%';
-select * from t1 where a like '%PESKA%';
-select * from t1 where a like '%ESKA%';
-DROP TABLE t1;
-
-#
-# LIKE crashed for binary collations in some cases
-#
-select _cp866'aaaaaaaaa' like _cp866'%aaaa%' collate cp866_bin;
-
-#
-# Check 8bit escape character
-#
-set names koi8r;
-select 'andre%' like 'andre%' escape '';
-
-# Check 8bit escape character with charset conversion:
-# For "a LIKE b ESCAPE c" expressions,
-# escape character is converted into the operation character set,
-# which is result of aggregation of character sets of "a" and "b".
-# "c" itself doesn't take part in aggregation, because its collation
-# doesn't matter, escape character is always compared binary.
-# In the example below, escape character is converted from koi8r into cp1251:
-#
-select _cp1251'andre%' like convert('andre%' using cp1251) escape '';
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-#
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/func_math.test b/mysql-test/suite/pbxt/t/func_math.test
deleted file mode 100644
index 54d6e185409..00000000000
--- a/mysql-test/suite/pbxt/t/func_math.test
+++ /dev/null
@@ -1,202 +0,0 @@
-#
-# Test of math functions
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-select floor(5.5),floor(-5.5);
-explain extended select floor(5.5),floor(-5.5);
-select ceiling(5.5),ceiling(-5.5);
-explain extended select ceiling(5.5),ceiling(-5.5);
-select truncate(52.64,1),truncate(52.64,2),truncate(52.64,-1),truncate(52.64,-2), truncate(-52.64,1),truncate(-52.64,-1);
-explain extended select truncate(52.64,1),truncate(52.64,2),truncate(52.64,-1),truncate(52.64,-2), truncate(-52.64,1),truncate(-52.64,-1);
-select round(5.5),round(-5.5);
-explain extended select round(5.5),round(-5.5);
-select round(5.64,1),round(5.64,2),round(5.64,-1),round(5.64,-2);
-select abs(-10), sign(-5), sign(5), sign(0);
-explain extended select abs(-10), sign(-5), sign(5), sign(0);
-select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2);
-explain extended select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2);
-select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL);
-explain extended select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL);
-select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
-explain extended select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
-select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
-explain extended select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
-select pow(10,log10(10)),power(2,4);
-explain extended select pow(10,log10(10)),power(2,4);
-set @@rand_seed1=10000000,@@rand_seed2=1000000;
-select rand(999999),rand();
-explain extended select rand(999999),rand();
-select pi(),format(sin(pi()/2),6),format(cos(pi()/2),6),format(abs(tan(pi())),6),format(cot(1),6),format(asin(1),6),format(acos(0),6),format(atan(1),6);
-explain extended select pi(),format(sin(pi()/2),6),format(cos(pi()/2),6),format(abs(tan(pi())),6),format(cot(1),6),format(asin(1),6),format(acos(0),6),format(atan(1),6);
-select degrees(pi()),radians(360);
-
-select format(atan(-2, 2), 6);
-select format(atan(pi(), 0), 6);
-select format(atan2(-2, 2), 6);
-select format(atan2(pi(), 0), 6);
-
-#
-# Bug #2338 Trignometric arithmatic problems
-#
-
-SELECT ACOS(1.0);
-SELECT ASIN(1.0);
-SELECT ACOS(0.2*5.0);
-SELECT ACOS(0.5*2.0);
-SELECT ASIN(0.8+0.2);
-SELECT ASIN(1.2-0.2);
-
-#
-# Bug #3051 FLOOR returns invalid
-#
-
-# This can't be tested as it's not portable
-#select floor(log(4)/log(2));
-#select floor(log(8)/log(2));
-#select floor(log(16)/log(2));
-
-#
-# Bug #9060 (format returns incorrect result)
-#
-select format(4.55, 1), format(4.551, 1);
-
-explain extended select degrees(pi()),radians(360);
-
-#
-# Bug #7281: problem with rand()
-#
-
---error 1054
-select rand(rand);
-
-# End of 4.1 tests
-
-#
-# Bug #8459 (FORMAT returns incorrect result)
-#
-create table t1 (col1 int, col2 decimal(60,30));
-insert into t1 values(1,1234567890.12345);
-select format(col2,7) from t1;
-select format(col2,8) from t1;
-insert into t1 values(7,1234567890123456.12345);
-select format(col2,6) from t1 where col1=7;
-drop table t1;
-
-
-#
-# Bug #10083 (round doesn't increase decimals)
-#
-select round(150, 2);
-
-#
-# Bug @10632 (Ceiling function returns wrong answer)
-#
-select ceil(0.09);
-select ceil(0.000000000000000009);
-
-#
-# Bug #9837: problem with round()
-#
-
-create table t1 select round(1, 6);
-show create table t1;
-select * from t1;
-drop table t1;
-
-#
-# Bug #11402: abs() forces rest of calculation to unsigned
-#
-select abs(-2) * -2;
-
-#
-# Bug #6172 RAND(a) should only accept constant values as arguments
-#
-CREATE TABLE t1 (a INT);
-
-INSERT INTO t1 VALUES (1),(1),(1),(2);
-SELECT CAST(RAND(2) * 1000 AS UNSIGNED), CAST(RAND(a) * 1000 AS UNSIGNED)
- FROM t1;
-SELECT CAST(RAND(2) * 1000 AS UNSIGNED), CAST(RAND(a) * 1000 AS UNSIGNED)
- FROM t1 WHERE a = 1;
-INSERT INTO t1 VALUES (3);
-SELECT CAST(RAND(2) * 1000 AS UNSIGNED), CAST(RAND(a) * 1000 AS UNSIGNED)
- FROM t1;
-SELECT CAST(RAND(2) * 1000 AS UNSIGNED), CAST(RAND(a) * 1000 AS UNSIGNED)
- FROM t1 WHERE a = 1;
-PREPARE stmt FROM
- "SELECT CAST(RAND(2) * 1000 AS UNSIGNED), CAST(RAND(?) * 1000 AS UNSIGNED)
- FROM t1 WHERE a = 1";
-set @var=2;
-EXECUTE stmt USING @var;
-
-DROP TABLE t1;
-
-#
-# Bug #14009: use of abs() on null value causes problems with filesort
-#
-# InnoDB is required to reproduce the fault, but it is okay if we default to
-# MyISAM when testing.
---disable_warnings
-create table t1 (a varchar(90), ts datetime not null, index (a)) engine=innodb default charset=utf8;
---enable_warnings
-insert into t1 values ('http://www.foo.com/', now());
-select a from t1 where a='http://www.foo.com/' order by abs(timediff(ts, 0));
-drop table t1;
-
-# End of 4.1 tests
-
-#
-# Bug #13820 (No warning on log(negative)
-#
-set sql_mode='traditional';
-select ln(-1);
-select log10(-1);
-select log2(-1);
-select log(2,-1);
-select log(-2,1);
-set sql_mode='';
-
-#
-# Bug #8461 truncate() and round() return false results 2nd argument negative.
-#
-# round(a,-b) log_10(b) > a
-select round(111,-10);
-# round on bigint
-select round(-5000111000111000155,-1);
-# round on unsigned bigint
-select round(15000111000111000155,-1);
-# truncate on bigint
-select truncate(-5000111000111000155,-1);
-# truncate on unsigned bigint
-select truncate(15000111000111000155,-1);
-
-#
-# Bug#16678 FORMAT gives wrong result if client run with default-character-set=utf8
-#
-set names utf8;
-create table t1
-(f1 varchar(32) not null,
- f2 smallint(5) unsigned not null,
- f3 int(10) unsigned not null default '0')
-engine=myisam default charset=utf8;
-insert into t1 values ('zombie',0,0),('gold',1,10000),('silver',2,10000);
-
-create table t2
-(f1 int(10) unsigned not null,
- f2 int(10) unsigned not null,
- f3 smallint(5) unsigned not null)
-engine=myisam default charset=utf8;
-insert into t2 values (16777216,16787215,1),(33554432,33564431,2);
-
-select format(t2.f2-t2.f1+1,0) from t1,t2
-where t1.f2 = t2.f3 order by t1.f1;
-drop table t1, t2;
-set names default;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/func_misc.test b/mysql-test/suite/pbxt/t/func_misc.test
deleted file mode 100644
index cafd272bd7f..00000000000
--- a/mysql-test/suite/pbxt/t/func_misc.test
+++ /dev/null
@@ -1,138 +0,0 @@
-#
-# Testing of misc functions
-#
-
-select format(1.5555,0),format(123.5555,1),format(1234.5555,2),format(12345.55555,3),format(123456.5555,4),format(1234567.5555,5),format("12345.2399",2);
-
-select inet_ntoa(inet_aton("255.255.255.255.255.255.255.255"));
-select inet_aton("255.255.255.255.255"),inet_aton("255.255.1.255"),inet_aton("0.1.255");
-select inet_ntoa(1099511627775),inet_ntoa(4294902271),inet_ntoa(511);
-
-select hex(inet_aton('127'));
-select hex(inet_aton('127.1'));
-select hex(inet_aton('127.1.1'));
-
-select length(uuid()), charset(uuid()), length(unhex(replace(uuid(),_utf8'-',_utf8'')));
-
-#
-# Test for core dump with nan
-#
-select length(format('nan', 2)) > 0;
-
-#
-# Test for bug #628
-#
-select concat("$",format(2500,2));
-
-# Test for BUG#7716
-create table t1 ( a timestamp );
-insert into t1 values ( '2004-01-06 12:34' );
-select a from t1 where left(a+0,6) in ( left(20040106,6) );
-select a from t1 where left(a+0,6) = ( left(20040106,6) );
-
-select a from t1 where right(a+0,6) in ( right(20040106123400,6) );
-select a from t1 where right(a+0,6) = ( right(20040106123400,6) );
-
-select a from t1 where mid(a+0,6,3) in ( mid(20040106123400,6,3) );
-select a from t1 where mid(a+0,6,3) = ( mid(20040106123400,6,3) );
-
-drop table t1;
-
-
-#
-# Bug#16501: IS_USED_LOCK does not appear to work
-#
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-CREATE TABLE t1 (conn CHAR(7), connection_id INT);
-INSERT INTO t1 VALUES ('default', CONNECTION_ID());
-
-SELECT GET_LOCK('bug16501',600);
-
-connect (con1,localhost,root,,);
-INSERT INTO t1 VALUES ('con1', CONNECTION_ID());
-SELECT IS_USED_LOCK('bug16501') = connection_id
-FROM t1
-WHERE conn = 'default';
-send SELECT GET_LOCK('bug16501',600);
-
-connection default;
-SELECT IS_USED_LOCK('bug16501') = CONNECTION_ID();
-SELECT RELEASE_LOCK('bug16501');
-connection con1;
-reap;
-connection default;
-SELECT IS_USED_LOCK('bug16501') = connection_id
-FROM t1
-WHERE conn = 'con1';
-
-connection con1;
-SELECT IS_USED_LOCK('bug16501') = CONNECTION_ID();
-SELECT RELEASE_LOCK('bug16501');
-SELECT IS_USED_LOCK('bug16501');
-
-disconnect con1;
-connection default;
-
-DROP TABLE t1;
-
-#
-# Bug #21531: EXPORT_SET() doesn't accept args with coercible character sets
-#
-select export_set(3, _latin1'foo', _utf8'bar', ',', 4);
-
---echo End of 4.1 tests
-
-
-#
-# Test for BUG#9535
-#
-create table t1 as select uuid(), length(uuid());
-show create table t1;
-drop table t1;
-
-#
-# Bug #6760: Add SLEEP() function
-#
-create table t1 (a timestamp default '2005-05-05 01:01:01',
- b timestamp default '2005-05-05 01:01:01');
-insert into t1 set a = now();
-select sleep(3);
-update t1 set b = now();
-select timediff(b, a) >= '00:00:03' from t1;
-drop table t1;
-
-#
-# Bug #12689: SLEEP() gets incorrectly cached/optimized-away
-#
-set global query_cache_size=1355776;
-create table t1 (a int);
-insert into t1 values (1),(1),(1);
-create table t2 (a datetime default null, b datetime default null);
-insert into t2 set a = now();
-select a from t1 where sleep(1);
-update t2 set b = now() where b is null;
-insert into t2 set a = now();
-select a from t1 where sleep(a);
-update t2 set b = now() where b is null;
-insert into t2 set a = now();
-select a from t1 where sleep(1);
-update t2 set b = now() where b is null;
-select timediff(b, a) >= '00:00:03' from t2;
-drop table t2;
-drop table t1;
-set global query_cache_size=default;
-
-#
-# Bug #21466: INET_ATON() returns signed, not unsigned
-#
-
-create table t1 select INET_ATON('255.255.0.1') as `a`;
-show create table t1;
-drop table t1;
---disable_query_log
-drop database pbxt;
---enable_query_log
---echo End of 5.0 tests
diff --git a/mysql-test/suite/pbxt/t/func_op.test b/mysql-test/suite/pbxt/t/func_op.test
deleted file mode 100644
index 4a6474df946..00000000000
--- a/mysql-test/suite/pbxt/t/func_op.test
+++ /dev/null
@@ -1,40 +0,0 @@
-# Description
-# -----------
-# Simple operands and arithmetic grouping
-
-select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5)|0,-(1+1)*-2;
-explain extended select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5)|0,-(1+1)*-2;
-select 1 | (1+1),5 & 3,bit_count(7) ;
-explain extended select 1 | (1+1),5 & 3,bit_count(7) ;
-select 1 << 32,1 << 63, 1 << 64, 4 >> 2, 4 >> 63, 1<< 63 >> 60;
-#
-# bug #1993: bit functions must be unsigned
-#
-select -1 | 0, -1 ^ 0, -1 & 0;
-select -1 | 1, -1 ^ 1, -1 & 1;
-select 1 | -1, 1 ^ -1, 1 & -1;
-select 0 | -1, 0 ^ -1, 0 & -1;
-select -1 >> 0, -1 << 0;
-select -1 >> 1, -1 << 1;
-
-#
-# Bug 13044: wrong bit_count() results
-#
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-create table t1(a int);
-create table t2(a int, b int);
-insert into t1 values (1), (2), (3);
-insert into t2 values (1, 7), (3, 7);
-SET @save_optimizer_switch=@@optimizer_switch;
-SET optimizer_switch='outer_join_with_cache=off';
-select t1.a, t2.a, t2.b, bit_count(t2.b) from t1 left join t2 on t1.a=t2.a;
-SET optimizer_switch=@save_optimizer_switch;
-drop table t1, t2;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/func_regexp.test b/mysql-test/suite/pbxt/t/func_regexp.test
deleted file mode 100644
index 02b13405ab5..00000000000
--- a/mysql-test/suite/pbxt/t/func_regexp.test
+++ /dev/null
@@ -1,80 +0,0 @@
-#
-# Some regexp tests
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (s1 char(64),s2 char(64));
-
-insert into t1 values('aaa','aaa');
-insert into t1 values('aaa|qqq','qqq');
-insert into t1 values('gheis','^[^a-dXYZ]+$');
-insert into t1 values('aab','^aa?b');
-insert into t1 values('Baaan','^Ba*n');
-insert into t1 values('aaa','qqq|aaa');
-insert into t1 values('qqq','qqq|aaa');
-
-insert into t1 values('bbb','qqq|aaa');
-insert into t1 values('bbb','qqq');
-insert into t1 values('aaa','aba');
-
-insert into t1 values(null,'abc');
-insert into t1 values('def',null);
-insert into t1 values(null,null);
-insert into t1 values('ghi','ghi[');
-
-select HIGH_PRIORITY s1 regexp s2 from t1;
-
-drop table t1;
-
-#
-# This test a bug in regexp on Alpha
-#
-
-create table t1 (xxx char(128));
-insert into t1 (xxx) values('this is a test of some long text to see what happens');
-select * from t1 where xxx regexp('is a test of some long text to');
-explain extended select * from t1 where xxx regexp('is a test of some long text to');
-select * from t1 where xxx regexp('is a test of some long text to ');
-select * from t1 where xxx regexp('is a test of some long text to s');
-select * from t1 where xxx regexp('is a test of some long text to se');
-drop table t1;
-
-create table t1 (xxx char(128));
-insert into t1 (xxx) values('this is some text: to test - out.reg exp (22/45)');
-select * from t1 where xxx REGEXP '^this is some text: to test - out\\.reg exp [[(][0-9]+[/\\][0-9]+[])][ ]*$';
-drop table t1;
-
-#
-# Check with different character sets and collations
-#
-select _latin1 0xFF regexp _latin1 '[[:lower:]]' COLLATE latin1_bin;
-select _koi8r 0xFF regexp _koi8r '[[:lower:]]' COLLATE koi8r_bin;
-select _latin1 0xFF regexp _latin1 '[[:upper:]]' COLLATE latin1_bin;
-select _koi8r 0xFF regexp _koi8r '[[:upper:]]' COLLATE koi8r_bin;
-
-select _latin1 0xF7 regexp _latin1 '[[:alpha:]]';
-select _koi8r 0xF7 regexp _koi8r '[[:alpha:]]';
-
-select _latin1'a' regexp _latin1'A' collate latin1_general_ci;
-select _latin1'a' regexp _latin1'A' collate latin1_bin;
-
-#
-# regexp cleanup()
-#
-create table t1 (a varchar(40));
-insert into t1 values ('C1'),('C2'),('R1'),('C3'),('R2'),('R3');
-prepare stmt1 from 'select a from t1 where a rlike ? order by a';
-set @a="^C.*";
-execute stmt1 using @a;
-set @a="^R.*";
-execute stmt1 using @a;
-deallocate prepare stmt1;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/func_sapdb.test b/mysql-test/suite/pbxt/t/func_sapdb.test
deleted file mode 100644
index d8ef28317ba..00000000000
--- a/mysql-test/suite/pbxt/t/func_sapdb.test
+++ /dev/null
@@ -1,137 +0,0 @@
---disable_warnings
-drop table if exists t1, test;
---enable_warnings
-
-
-#
-# time functions
-#
-select extract(DAY_MICROSECOND FROM "1999-01-02 10:11:12.000123");
-select extract(HOUR_MICROSECOND FROM "1999-01-02 10:11:12.000123");
-select extract(MINUTE_MICROSECOND FROM "1999-01-02 10:11:12.000123");
-select extract(SECOND_MICROSECOND FROM "1999-01-02 10:11:12.000123");
-select extract(MICROSECOND FROM "1999-01-02 10:11:12.000123");
-select date_format("1997-12-31 23:59:59.000002", "%f");
-
-select date_add("1997-12-31 23:59:59.000002",INTERVAL "10000 99:99:99.999999" DAY_MICROSECOND);
-select date_add("1997-12-31 23:59:59.000002",INTERVAL "10000:99:99.999999" HOUR_MICROSECOND);
-select date_add("1997-12-31 23:59:59.000002",INTERVAL "10000:99.999999" MINUTE_MICROSECOND);
-select date_add("1997-12-31 23:59:59.000002",INTERVAL "10000.999999" SECOND_MICROSECOND);
-select date_add("1997-12-31 23:59:59.000002",INTERVAL "999999" MICROSECOND);
-
-select date_sub("1998-01-01 00:00:00.000001",INTERVAL "1 1:1:1.000002" DAY_MICROSECOND);
-select date_sub("1998-01-01 00:00:00.000001",INTERVAL "1:1:1.000002" HOUR_MICROSECOND);
-select date_sub("1998-01-01 00:00:00.000001",INTERVAL "1:1.000002" MINUTE_MICROSECOND);
-select date_sub("1998-01-01 00:00:00.000001",INTERVAL "1.000002" SECOND_MICROSECOND);
-select date_sub("1998-01-01 00:00:00.000001",INTERVAL "000002" MICROSECOND);
-
-#Date functions
-select adddate("1997-12-31 23:59:59.000001", 10);
-select subdate("1997-12-31 23:59:59.000001", 10);
-
-select datediff("1997-12-31 23:59:59.000001","1997-12-30");
-select datediff("1997-11-30 23:59:59.000001","1997-12-31");
-SET @@SQL_MODE="ALLOW_INVALID_DATES";
-select datediff("1997-11-31 23:59:59.000001","1997-12-31");
-SET @@SQL_MODE="";
-
-# This will give a warning
-select datediff("1997-11-31 23:59:59.000001","1997-12-31");
-select datediff("1997-11-30 23:59:59.000001",null);
-
-select weekofyear("1997-11-30 23:59:59.000001");
-
-select makedate(1997,1);
-select makedate(1997,0);
-select makedate(9999,365);
-select makedate(9999,366);
-
-#Time functions
-
-select addtime("1997-12-31 23:59:59.999999", "1 1:1:1.000002");
-select subtime("1997-12-31 23:59:59.000001", "1 1:1:1.000002");
-select addtime("1997-12-31 23:59:59.999999", "1998-01-01 01:01:01.999999");
-select subtime("1997-12-31 23:59:59.999999", "1998-01-01 01:01:01.999999");
-select subtime("01:00:00.999999", "02:00:00.999998");
-select subtime("02:01:01.999999", "01:01:01.999999");
-
-# PS doesn't support fractional seconds
---disable_ps_protocol
-select timediff("1997-01-01 23:59:59.000001","1995-12-31 23:59:59.000002");
-select timediff("1997-12-31 23:59:59.000001","1997-12-30 01:01:01.000002");
-select timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002");
-select timediff("1997-12-31 23:59:59.000001","23:59:59.000001");
-select timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001");
-select timediff("2005-01-11 15:48:49.999999", "2005-01-11 15:48:50");
---enable_ps_protocol
-
-select maketime(10,11,12);
-select maketime(25,11,12);
-select maketime(-25,11,12);
-
-# Extraction functions
-
-# PS doesn't support fractional seconds
---disable_ps_protocol
-select timestamp("2001-12-01", "01:01:01.999999");
-select timestamp("2001-13-01", "01:01:01.000001");
-select timestamp("2001-12-01", "25:01:01");
-select timestamp("2001-12-01 01:01:01.000100");
-select timestamp("2001-12-01");
-select day("1997-12-31 23:59:59.000001");
-select date("1997-12-31 23:59:59.000001");
-select date("1997-13-31 23:59:59.000001");
-select time("1997-12-31 23:59:59.000001");
-select time("1997-12-31 25:59:59.000001");
-select microsecond("1997-12-31 23:59:59.000001");
---enable_ps_protocol
-
-create table t1
-select makedate(1997,1) as f1,
- addtime(cast("1997-12-31 23:59:59.000001" as datetime), "1 1:1:1.000002") as f2,
- addtime(cast("23:59:59.999999" as time) , "1 1:1:1.000002") as f3,
- timediff("1997-12-31 23:59:59.000001","1997-12-30 01:01:01.000002") as f4,
- timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002") as f5,
- maketime(10,11,12) as f6,
- timestamp(cast("2001-12-01" as date), "01:01:01") as f7,
- date("1997-12-31 23:59:59.000001") as f8,
- time("1997-12-31 23:59:59.000001") as f9;
-describe t1;
-# PS doesn't support fractional seconds
---disable_ps_protocol
-select * from t1;
---enable_ps_protocol
-
-create table test(t1 datetime, t2 time, t3 time, t4 datetime);
-insert into test values
-('2001-01-01 01:01:01', '01:01:01', null, '2001-02-01 01:01:01'),
-('2001-01-01 01:01:01', '-01:01:01', '-23:59:59', "1997-12-31 23:59:59.000001"),
-('1997-12-31 23:59:59.000001', '-23:59:59', '-01:01:01', '2001-01-01 01:01:01'),
-('2001-01-01 01:01:01', '01:01:01', '-1 01:01:01', null),
-('2001-01-01 01:01:01', '-01:01:01', '1 01:01:01', '2001-01-01 01:01:01'),
-('2001-01-01 01:01:01', null, '-1 01:01:01', null),
-(null, null, null, null),
-('2001-01-01 01:01:01', '01:01:01', '1 01:01:01', '2001-01-01 01:01:01');
-
-SELECT ADDTIME(t1,t2) As ttt, ADDTIME(t2, t3) As qqq from test;
-# PS doesn't support fractional seconds
---disable_ps_protocol
-SELECT TIMEDIFF(t1, t4) As ttt, TIMEDIFF(t2, t3) As qqq,
- TIMEDIFF(t3, t2) As eee, TIMEDIFF(t2, t4) As rrr from test;
---enable_ps_protocol
-
-drop table t1, test;
-
-select addtime("-01:01:01.01", "-23:59:59.1") as a;
-select microsecond("1997-12-31 23:59:59.01") as a;
-select microsecond(19971231235959.01) as a;
-select date_add("1997-12-31",INTERVAL "10.09" SECOND_MICROSECOND) as a;
-# PS doesn't support fractional seconds
---disable_ps_protocol
-select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f");
---enable_ps_protocol
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/func_set.test b/mysql-test/suite/pbxt/t/func_set.test
deleted file mode 100644
index d89551a8a2f..00000000000
--- a/mysql-test/suite/pbxt/t/func_set.test
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# Testing if SET and similar functions
-#
-
-select interval(55,10,20,30,40,50,60,70,80,90,100),interval(3,1,1+1,1+1+1+1),field("IBM","NCA","ICL","SUN","IBM","DIGITAL"),field("A","B","C"),elt(2,"ONE","TWO","THREE"),interval(0,1,2,3,4),elt(1,1,2,3)|0,elt(1,1.1,1.2,1.3)+0;
-explain extended select INTERVAL(55,10,20,30,40,50,60,70,80,90,100),interval(3,1,1+1,1+1+1+1),field("IBM","NCA","ICL","SUN","IBM","DIGITAL"),field("A","B","C"),elt(2,"ONE","TWO","THREE"),interval(0,1,2,3,4),elt(1,1,2,3)|0,elt(1,1.1,1.2,1.3)+0;
-# Test 8 and 9 values (Bug #1561)
-SELECT INTERVAL(13, 7, 14, 21, 28, 35, 42, 49, 56);
-SELECT INTERVAL(13, 7, 14, 21, 28, 35, 42, 49, 56, 77);
-
-select find_in_set("b","a,b,c"),find_in_set("c","a,b,c"),find_in_set("dd","a,bbb,dd"),find_in_set("bbb","a,bbb,dd");
-select find_in_set("d","a,b,c"),find_in_set("dd","a,bbb,d"),find_in_set("bb","a,bbb,dd");
-select make_set(0,'a','b','c'),make_set(-1,'a','b','c'),make_set(1,'a','b','c'),make_set(2,'a','b','c'),make_set(1+2,concat('a','b'),'c');
-select make_set(NULL,'a','b','c'),make_set(1|4,'a',NULL,'c'),make_set(1+2,'a',NULL,'c');
-select export_set(9,"Y","N","-",5),export_set(9,"Y","N"),export_set(9,"Y","N","");
-
-#
-# Wrong usage of functions
-#
-select elt(2,1),field(NULL,"a","b","c");
-select field("b","a",NULL),field(1,0,NULL)+0,field(1.0,0.0,NULL)+0.0,field(1.0e1,0.0e1,NULL)+0.0e1;
-select field(NULL,"a",NULL),field(NULL,0,NULL)+0,field(NULL,0.0,NULL)+0.0,field(NULL,0.0e1,NULL)+0.0e1;
-select find_in_set("","a,b,c"),find_in_set("","a,b,c,"),find_in_set("",",a,b,c");
-select find_in_set("abc","abc"),find_in_set("ab","abc"),find_in_set("abcd","abc");
-select interval(null, 1, 10, 100);
-
-#
-# test for a bug with elt()
-#
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-create table t1 (id int(10) not null unique);
-create table t2 (id int(10) not null primary key, val int(10) not null);
-insert into t1 values (1),(2),(4);
-insert into t2 values (1,1),(2,1),(3,1),(4,2);
-
-select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id;
-select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id order by one.id;
-drop table t1,t2;
-
-#
-# Bug4340: find_in_set is case insensitive even on binary operators
-#
-
-select find_in_set(binary 'a',binary 'A,B,C');
-select find_in_set('a',binary 'A,B,C');
-select find_in_set(binary 'a', 'A,B,C');
-
-#
-# Bug5513:FIND_IN_SET fails if set ends with a comma
-#
-select find_in_set('1','3,1,');
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/func_str.test b/mysql-test/suite/pbxt/t/func_str.test
deleted file mode 100644
index aa8e4163ca2..00000000000
--- a/mysql-test/suite/pbxt/t/func_str.test
+++ /dev/null
@@ -1,1113 +0,0 @@
-# Description
-# -----------
-# Testing string functions
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-set names latin1;
-
-select 'hello',"'hello'",'""hello""','''h''e''l''l''o''',"hel""lo",'hel\'lo';
-select 'hello' 'monty';
-select length('\n\t\r\b\0\_\%\\');
-select bit_length('\n\t\r\b\0\_\%\\');
-select char_length('\n\t\r\b\0\_\%\\');
-select length(_latin1'\n\t\n\b\0\\_\\%\\');
-select concat('monty',' was here ','again'),length('hello'),char(ascii('h')),ord('h');
-select hex(char(256));
-select locate('he','hello'),locate('he','hello',2),locate('lo','hello',2) ;
-select instr('hello','HE'), instr('hello',binary 'HE'), instr(binary 'hello','HE');
-select position(binary 'll' in 'hello'),position('a' in binary 'hello');
-#
-# Bug#11728 string function LEFT,
-# strange undocumented behaviour, strict mode
-#
-select left('hello',null), right('hello',null);
-select left('hello',2),right('hello',2),substring('hello',2,2),mid('hello',1,5) ;
-select concat('',left(right(concat('what ',concat('is ','happening')),9),4),'',substring('monty',5,1)) ;
-select substring_index('www.tcx.se','.',-2),substring_index('www.tcx.se','.',1);
-select substring_index('www.tcx.se','tcx',1),substring_index('www.tcx.se','tcx',-1);
-select substring_index('.tcx.se','.',-2),substring_index('.tcx.se','.tcx',-1);
-select substring_index('aaaaaaaaa1','a',1);
-select substring_index('aaaaaaaaa1','aa',1);
-select substring_index('aaaaaaaaa1','aa',2);
-select substring_index('aaaaaaaaa1','aa',3);
-select substring_index('aaaaaaaaa1','aa',4);
-select substring_index('aaaaaaaaa1','aa',5);
-select substring_index('aaaaaaaaa1','aaa',1);
-select substring_index('aaaaaaaaa1','aaa',2);
-select substring_index('aaaaaaaaa1','aaa',3);
-select substring_index('aaaaaaaaa1','aaa',4);
-select substring_index('aaaaaaaaa1','aaaa',1);
-select substring_index('aaaaaaaaa1','aaaa',2);
-select substring_index('aaaaaaaaa1','1',1);
-select substring_index('aaaaaaaaa1','a',-1);
-select substring_index('aaaaaaaaa1','aa',-1);
-select substring_index('aaaaaaaaa1','aa',-2);
-select substring_index('aaaaaaaaa1','aa',-3);
-select substring_index('aaaaaaaaa1','aa',-4);
-select substring_index('aaaaaaaaa1','aa',-5);
-select substring_index('aaaaaaaaa1','aaa',-1);
-select substring_index('aaaaaaaaa1','aaa',-2);
-select substring_index('aaaaaaaaa1','aaa',-3);
-select substring_index('aaaaaaaaa1','aaa',-4);
-select substring_index('the king of thethe hill','the',-2);
-select substring_index('the king of the the hill','the',-2);
-select substring_index('the king of the the hill','the',-2);
-select substring_index('the king of the the hill',' the ',-1);
-select substring_index('the king of the the hill',' the ',-2);
-select substring_index('the king of the the hill',' ',-1);
-select substring_index('the king of the the hill',' ',-2);
-select substring_index('the king of the the hill',' ',-3);
-select substring_index('the king of the the hill',' ',-4);
-select substring_index('the king of the the hill',' ',-5);
-select substring_index('the king of the.the hill','the',-2);
-select substring_index('the king of thethethe.the hill','the',-3);
-select substring_index('the king of thethethe.the hill','the',-1);
-select substring_index('the king of the the hill','the',1);
-select substring_index('the king of the the hill','the',2);
-select substring_index('the king of the the hill','the',3);
-
-select concat(':',ltrim(' left '),':',rtrim(' right '),':');
-select concat(':',trim(leading from ' left '),':',trim(trailing from ' right '),':');
-select concat(':',trim(LEADING FROM ' left'),':',trim(TRAILING FROM ' right '),':');
-select concat(':',trim(' m '),':',trim(BOTH FROM ' y '),':',trim('*' FROM '*s*'),':');
-select concat(':',trim(BOTH 'ab' FROM 'ababmyabab'),':',trim(BOTH '*' FROM '***sql'),':');
-select concat(':',trim(LEADING '.*' FROM '.*my'),':',trim(TRAILING '.*' FROM 'sql.*.*'),':');
-select TRIM("foo" FROM "foo"), TRIM("foo" FROM "foook"), TRIM("foo" FROM "okfoo");
-
-select concat_ws(', ','monty','was here','again');
-select concat_ws(NULL,'a'),concat_ws(',',NULL,'');
-select concat_ws(',','',NULL,'a');
-SELECT CONCAT('"',CONCAT_WS('";"',repeat('a',60),repeat('b',60),repeat('c',60),repeat('d',100)), '"');
-
-select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
-select replace('aaaa','a','b'),replace('aaaa','aa','b'),replace('aaaa','a','bb'),replace('aaaa','','b'),replace('bbbb','a','c');
-select replace(concat(lcase(concat('THIS',' ','IS',' ','A',' ')),ucase('false'),' ','test'),'FALSE','REAL') ;
-select soundex(''),soundex('he'),soundex('hello all folks'),soundex('#3556 in bugdb');
-select 'mood' sounds like 'mud';
-select 'Glazgo' sounds like 'Liverpool';
-select null sounds like 'null';
-select 'null' sounds like null;
-select null sounds like null;
-select md5('hello');
-select crc32("123");
-select sha('abc');
-select sha1('abc');
-select aes_decrypt(aes_encrypt('abc','1'),'1');
-select aes_decrypt(aes_encrypt('abc','1'),1);
-select aes_encrypt(NULL,"a");
-select aes_encrypt("a",NULL);
-select aes_decrypt(NULL,"a");
-select aes_decrypt("a",NULL);
-select aes_decrypt("a","a");
-select aes_decrypt(aes_encrypt("","a"),"a");
-select repeat('monty',5),concat('*',space(5),'*');
-select reverse('abc'),reverse('abcd');
-select rpad('a',4,'1'),rpad('a',4,'12'),rpad('abcd',3,'12'), rpad(11, 10 , 22), rpad("ab", 10, 22);
-select lpad('a',4,'1'),lpad('a',4,'12'),lpad('abcd',3,'12'), lpad(11, 10 , 22);
-select rpad(741653838,17,'0'),lpad(741653838,17,'0');
-select rpad('abcd',7,'ab'),lpad('abcd',7,'ab');
-select rpad('abcd',1,'ab'),lpad('abcd',1,'ab');
-select rpad('STRING', 20, CONCAT('p','a','d') );
-select lpad('STRING', 20, CONCAT('p','a','d') );
-
-select LEAST(NULL,'HARRY','HARRIOT',NULL,'HAROLD'),GREATEST(NULL,'HARRY','HARRIOT',NULL,'HAROLD');
-select least(1,2,3) | greatest(16,32,8), least(5,4)*1,greatest(-1.0,1.0)*1,least(3,2,1)*1.0,greatest(1,1.1,1.0),least("10",9),greatest("A","B","0");
-
-select decode(encode(repeat("a",100000),"monty"),"monty")=repeat("a",100000);
-select decode(encode("abcdef","monty"),"monty")="abcdef";
-
-select quote('\'\"\\test');
-select quote(concat('abc\'', '\\cba'));
-select quote(1/0), quote('\0\Z');
-select length(quote(concat(char(0),"test")));
-select hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235))));
-select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678"), unhex(NULL);
-select hex(unhex("1")), hex(unhex("12")), hex(unhex("123")), hex(unhex("1234")), hex(unhex("12345")), hex(unhex("123456"));
-select length(unhex(md5("abrakadabra")));
-
-#
-# Bug #6564: QUOTE(NULL
-#
-
-select concat('a', quote(NULL));
-
-#
-# Wrong usage of functions
-#
-
-select reverse("");
-select insert("aa",100,1,"b"),insert("aa",1,3,"b"),left("aa",-1),substring("a",1,2);
-select elt(2,1),field(NULL,"a","b","c"),reverse("");
-select locate("a","b",2),locate("","a",1);
-select ltrim("a"),rtrim("a"),trim(BOTH "" from "a"),trim(BOTH " " from "a");
-select concat("1","2")|0,concat("1",".5")+0.0;
-select substring_index("www.tcx.se","",3);
-select length(repeat("a",100000000)),length(repeat("a",1000*64));
-select position("0" in "baaa" in (1)),position("0" in "1" in (1,2,3)),position("sql" in ("mysql"));
-select position(("1" in (1,2,3)) in "01");
-select length(repeat("a",65500)),length(concat(repeat("a",32000),repeat("a",32000))),length(replace("aaaaa","a",concat(repeat("a",10000)))),length(insert(repeat("a",40000),1,30000,repeat("b",50000)));
-select length(repeat("a",1000000)),length(concat(repeat("a",32000),repeat("a",32000),repeat("a",32000))),length(replace("aaaaa","a",concat(repeat("a",32000)))),length(insert(repeat("a",48000),1,1000,repeat("a",48000)));
-
-#
-# Problem med concat
-#
-
-create table t1 ( domain char(50) );
-insert into t1 VALUES ("hello.de" ), ("test.de" );
-select domain from t1 where concat('@', trim(leading '.' from concat('.', domain))) = '@hello.de';
-select domain from t1 where concat('@', trim(leading '.' from concat('.', domain))) = '@test.de';
-drop table t1;
-
-#
-# Test bug in concat_ws
-#
-
-CREATE TABLE t1 (
- id int(10) unsigned NOT NULL,
- title varchar(255) default NULL,
- prio int(10) unsigned default NULL,
- category int(10) unsigned default NULL,
- program int(10) unsigned default NULL,
- bugdesc text,
- created datetime default NULL,
- modified timestamp NOT NULL,
- bugstatus int(10) unsigned default NULL,
- submitter int(10) unsigned default NULL
-) ENGINE=MyISAM;
-
-INSERT INTO t1 VALUES (1,'Link',1,1,1,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa','2001-02-28 08:40:16',20010228084016,0,4);
-SELECT CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified+0,bugstatus,submitter), '"') FROM t1;
-SELECT CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugstatus,submitter), '"') FROM t1;
-SELECT CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified+0,bugstatus,submitter) FROM t1;
-SELECT bugdesc, REPLACE(bugdesc, 'xxxxxxxxxxxxxxxxxxxx', 'bbbbbbbbbbbbbbbbbbbb') from t1 group by bugdesc;
-drop table t1;
-
-#
-# Test bug in AES_DECRYPT() when called with wrong argument
-#
-
-CREATE TABLE t1 (id int(11) NOT NULL auto_increment, tmp text NOT NULL, KEY id (id)) ENGINE=MyISAM;
-INSERT INTO t1 VALUES (1, 'a545f661efdd1fb66fdee3aab79945bf');
-SELECT 1 FROM t1 WHERE tmp=AES_DECRYPT(tmp,"password");
-DROP TABLE t1;
-
-CREATE TABLE t1 (
- wid int(10) unsigned NOT NULL auto_increment,
- data_podp date default NULL,
- status_wnio enum('nowy','podp','real','arch') NOT NULL default 'nowy',
- PRIMARY KEY(wid)
-);
-
-INSERT INTO t1 VALUES (8,NULL,'real');
-INSERT INTO t1 VALUES (9,NULL,'nowy');
-SELECT elt(status_wnio,data_podp) FROM t1 GROUP BY wid;
-DROP TABLE t1;
-
-#
-# test for #739
-
-CREATE TABLE t1 (title text) ENGINE=MyISAM;
-INSERT INTO t1 VALUES ('Congress reconvenes in September to debate welfare and adult education');
-INSERT INTO t1 VALUES ('House passes the CAREERS bill');
-SELECT CONCAT("</a>",RPAD("",(55 - LENGTH(title)),".")) from t1;
-DROP TABLE t1;
-
-#
-# test for Bug #2290 "output truncated with ELT when using DISTINCT"
-#
-
-CREATE TABLE t1 (i int, j int);
-INSERT INTO t1 VALUES (1,1),(2,2);
-SELECT DISTINCT i, ELT(j, '345', '34') FROM t1;
-DROP TABLE t1;
-
-#
-# bug #3756: quote and NULL
-#
-
-create table t1(a char(4));
-insert into t1 values ('one'),(NULL),('two'),('four');
-select a, quote(a), isnull(quote(a)), quote(a) is null, ifnull(quote(a), 'n') from t1;
-drop table t1;
-
-#
-# Bug #5498: TRIM fails with LEADING or TRAILING if remstr = str
-#
-
-select trim(trailing 'foo' from 'foo');
-select trim(leading 'foo' from 'foo');
-
-#
-# crashing bug with QUOTE() and LTRIM() or TRIM() fixed
-# Bug #7495
-#
-
-select quote(ltrim(concat(' ', 'a')));
-select quote(trim(concat(' ', 'a')));
-
-# Bad results from QUOTE(). Bug #8248
-CREATE TABLE t1 SELECT 1 UNION SELECT 2 UNION SELECT 3;
-SELECT QUOTE('A') FROM t1;
-DROP TABLE t1;
-
-# Test collation and coercibility
-#
-
-select 1=_latin1'1';
-select _latin1'1'=1;
-select _latin2'1'=1;
-select 1=_latin2'1';
---error 1267
-select _latin1'1'=_latin2'1';
-select row('a','b','c') = row('a','b','c');
-select row('A','b','c') = row('a','b','c');
-select row('A' COLLATE latin1_bin,'b','c') = row('a','b','c');
-select row('A','b','c') = row('a' COLLATE latin1_bin,'b','c');
---error 1267
-select row('A' COLLATE latin1_general_ci,'b','c') = row('a' COLLATE latin1_bin,'b','c');
-
---error 1267
-select concat(_latin1'a',_latin2'a');
---error 1270
-select concat(_latin1'a',_latin2'a',_latin5'a');
---error 1271
-select concat(_latin1'a',_latin2'a',_latin5'a',_latin7'a');
---error 1267
-select concat_ws(_latin1'a',_latin2'a');
-
-#
-# Test FIELD() and collations
-#
-select FIELD('b','A','B');
-select FIELD('B','A','B');
-select FIELD('b' COLLATE latin1_bin,'A','B');
-select FIELD('b','A' COLLATE latin1_bin,'B');
---error 1270
-select FIELD(_latin2'b','A','B');
---error 1270
-select FIELD('b',_latin2'A','B');
-select FIELD('1',_latin2'3','2',1);
-
-select POSITION(_latin1'B' IN _latin1'abcd');
-select POSITION(_latin1'B' IN _latin1'abcd' COLLATE latin1_bin);
-select POSITION(_latin1'B' COLLATE latin1_bin IN _latin1'abcd');
---error 1267
-select POSITION(_latin1'B' COLLATE latin1_general_ci IN _latin1'abcd' COLLATE latin1_bin);
---error 1267
-select POSITION(_latin1'B' IN _latin2'abcd');
-
-select FIND_IN_SET(_latin1'B',_latin1'a,b,c,d');
-
-# fix this:
---disable_parsing
-select FIND_IN_SET(_latin1'B',_latin1'a,b,c,d' COLLATE latin1_bin);
-select FIND_IN_SET(_latin1'B' COLLATE latin1_bin,_latin1'a,b,c,d');
---enable_parsing
-
---error 1267
-select FIND_IN_SET(_latin1'B' COLLATE latin1_general_ci,_latin1'a,b,c,d' COLLATE latin1_bin);
---error 1267
-select FIND_IN_SET(_latin1'B',_latin2'a,b,c,d');
-
-select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin1'd',2);
-
-# fix this:
---disable_parsing
-select SUBSTRING_INDEX(_latin1'abcdabcdabcd' COLLATE latin1_bin,_latin1'd',2);
-select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin1'd' COLLATE latin1_bin,2);
---enable_parsing
-
---error 1267
-select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin2'd',2);
---error 1267
-select SUBSTRING_INDEX(_latin1'abcdabcdabcd' COLLATE latin1_general_ci,_latin1'd' COLLATE latin1_bin,2);
-
-select _latin1'B' between _latin1'a' and _latin1'c';
-select _latin1'B' collate latin1_bin between _latin1'a' and _latin1'c';
-select _latin1'B' between _latin1'a' collate latin1_bin and _latin1'c';
-select _latin1'B' between _latin1'a' and _latin1'c' collate latin1_bin;
---error 1270
-select _latin2'B' between _latin1'a' and _latin1'b';
---error 1270
-select _latin1'B' between _latin2'a' and _latin1'b';
---error 1270
-select _latin1'B' between _latin1'a' and _latin2'b';
---error 1270
-select _latin1'B' collate latin1_general_ci between _latin1'a' collate latin1_bin and _latin1'b';
-
-select _latin1'B' in (_latin1'a',_latin1'b');
-select _latin1'B' collate latin1_bin in (_latin1'a',_latin1'b');
-select _latin1'B' in (_latin1'a' collate latin1_bin,_latin1'b');
-select _latin1'B' in (_latin1'a',_latin1'b' collate latin1_bin);
---error 1270
-select _latin2'B' in (_latin1'a',_latin1'b');
---error 1270
-select _latin1'B' in (_latin2'a',_latin1'b');
---error 1270
-select _latin1'B' in (_latin1'a',_latin2'b');
---error 1270
-select _latin1'B' COLLATE latin1_general_ci in (_latin1'a' COLLATE latin1_bin,_latin1'b');
---error 1270
-select _latin1'B' COLLATE latin1_general_ci in (_latin1'a',_latin1'b' COLLATE latin1_bin);
-
-select collation(bin(130)), coercibility(bin(130));
-select collation(oct(130)), coercibility(oct(130));
-select collation(conv(130,16,10)), coercibility(conv(130,16,10));
-select collation(hex(130)), coercibility(hex(130));
-select collation(char(130)), coercibility(hex(130));
-select collation(format(130,10)), coercibility(format(130,10));
-select collation(lcase(_latin2'a')), coercibility(lcase(_latin2'a'));
-select collation(ucase(_latin2'a')), coercibility(ucase(_latin2'a'));
-select collation(left(_latin2'a',1)), coercibility(left(_latin2'a',1));
-select collation(right(_latin2'a',1)), coercibility(right(_latin2'a',1));
-select collation(substring(_latin2'a',1,1)), coercibility(substring(_latin2'a',1,1));
-select collation(concat(_latin2'a',_latin2'b')), coercibility(concat(_latin2'a',_latin2'b'));
-select collation(lpad(_latin2'a',4,_latin2'b')), coercibility(lpad(_latin2'a',4,_latin2'b'));
-select collation(rpad(_latin2'a',4,_latin2'b')), coercibility(rpad(_latin2'a',4,_latin2'b'));
-select collation(concat_ws(_latin2'a',_latin2'b')), coercibility(concat_ws(_latin2'a',_latin2'b'));
-select collation(make_set(255,_latin2'a',_latin2'b',_latin2'c')), coercibility(make_set(255,_latin2'a',_latin2'b',_latin2'c'));
-select collation(export_set(255,_latin2'y',_latin2'n',_latin2' ')), coercibility(export_set(255,_latin2'y',_latin2'n',_latin2' '));
-select collation(trim(_latin2' a ')), coercibility(trim(_latin2' a '));
-select collation(ltrim(_latin2' a ')), coercibility(ltrim(_latin2' a '));
-select collation(rtrim(_latin2' a ')), coercibility(rtrim(_latin2' a '));
-select collation(trim(LEADING _latin2' ' FROM _latin2'a')), coercibility(trim(LEADING _latin2'a' FROM _latin2'a'));
-select collation(trim(TRAILING _latin2' ' FROM _latin2'a')), coercibility(trim(TRAILING _latin2'a' FROM _latin2'a'));
-select collation(trim(BOTH _latin2' ' FROM _latin2'a')), coercibility(trim(BOTH _latin2'a' FROM _latin2'a'));
-select collation(repeat(_latin2'a',10)), coercibility(repeat(_latin2'a',10));
-select collation(reverse(_latin2'ab')), coercibility(reverse(_latin2'ab'));
-select collation(quote(_latin2'ab')), coercibility(quote(_latin2'ab'));
-select collation(soundex(_latin2'ab')), coercibility(soundex(_latin2'ab'));
-select collation(substring(_latin2'ab',1)), coercibility(substring(_latin2'ab',1));
-select collation(insert(_latin2'abcd',2,3,_latin2'ef')), coercibility(insert(_latin2'abcd',2,3,_latin2'ef'));
-select collation(replace(_latin2'abcd',_latin2'b',_latin2'B')), coercibility(replace(_latin2'abcd',_latin2'b',_latin2'B'));
-select collation(encode('abcd','ab')), coercibility(encode('abcd','ab'));
-
-create table t1
-select
- bin(130),
- oct(130),
- conv(130,16,10),
- hex(130),
- char(130),
- format(130,10),
- left(_latin2'a',1),
- right(_latin2'a',1),
- lcase(_latin2'a'),
- ucase(_latin2'a'),
- substring(_latin2'a',1,1),
- concat(_latin2'a',_latin2'b'),
- lpad(_latin2'a',4,_latin2'b'),
- rpad(_latin2'a',4,_latin2'b'),
- concat_ws(_latin2'a',_latin2'b'),
- make_set(255,_latin2'a',_latin2'b',_latin2'c'),
- export_set(255,_latin2'y',_latin2'n',_latin2' '),
- trim(_latin2' a '),
- ltrim(_latin2' a '),
- rtrim(_latin2' a '),
- trim(LEADING _latin2' ' FROM _latin2' a '),
- trim(TRAILING _latin2' ' FROM _latin2' a '),
- trim(BOTH _latin2' ' FROM _latin2' a '),
- repeat(_latin2'a',10),
- reverse(_latin2'ab'),
- quote(_latin2'ab'),
- soundex(_latin2'ab'),
- substring(_latin2'ab',1),
- insert(_latin2'abcd',2,3,_latin2'ef'),
- replace(_latin2'abcd',_latin2'b',_latin2'B'),
- encode('abcd','ab')
-;
-show create table t1;
-drop table t1;
-
-#
-# Bug#9129
-#
-create table t1 (a char character set latin2);
-insert into t1 values (null);
-select charset(a), collation(a), coercibility(a) from t1;
-drop table t1;
-select charset(null), collation(null), coercibility(null);
-#
-# Make sure OUTER JOIN is not replaced with a regular joun
-#
-CREATE TABLE t1 (a int, b int);
-CREATE TABLE t2 (a int, b int);
-INSERT INTO t1 VALUES (1,1),(2,2);
-INSERT INTO t2 VALUES (2,2),(3,3);
-select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b)
-where collation(t2.a) = _utf8'binary' order by t1.a,t2.a;
-select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b)
-where charset(t2.a) = _utf8'binary' order by t1.a,t2.a;
-select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b)
-where coercibility(t2.a) = 5 order by t1.a,t2.a;
-DROP TABLE t1, t2;
-
-#
-# test for SUBSTR
-#
-select SUBSTR('abcdefg',3,2);
-select SUBSTRING('abcdefg',3,2);
-select SUBSTR('abcdefg',-3,2) FROM DUAL;
-select SUBSTR('abcdefg',-1,5) FROM DUAL;
-select SUBSTR('abcdefg',0,0) FROM DUAL;
-select SUBSTR('abcdefg',-1,-1) FROM DUAL;
-select SUBSTR('abcdefg',1,-1) FROM DUAL;
-
-#
-# Test that fix_fields doesn't follow to upper level (to comparison)
-# when an error on a lower level (in concat) has accured:
-#
-create table t7 (s1 char);
---error 1267
-select * from t7
-where concat(s1 collate latin1_general_ci,s1 collate latin1_swedish_ci) = 'AA';
-drop table t7;
-
-select substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2),substring_index("1abcd;2abcd;3abcd;4abcd", ';', -2);
-
-explain extended select md5('hello');
-explain extended select sha('abc');
-explain extended select sha1('abc');
-explain extended select soundex('');
-explain extended select 'mood' sounds like 'mud';
-explain extended select aes_decrypt(aes_encrypt('abc','1'),'1');
-explain extended select concat('*',space(5),'*');
-explain extended select reverse('abc');
-explain extended select rpad('a',4,'1');
-explain extended select lpad('a',4,'1');
-explain extended select concat_ws(',','',NULL,'a');
-explain extended select make_set(255,_latin2'a', _latin2'b', _latin2'c');
-explain extended select elt(2,1);
-explain extended select locate("a","b",2);
-explain extended select format(130,10);
-explain extended select char(0);
-explain extended select conv(130,16,10);
-explain extended select hex(130);
-explain extended select binary 'HE';
-explain extended select export_set(255,_latin2'y', _latin2'n', _latin2' ');
-explain extended select FIELD('b' COLLATE latin1_bin,'A','B');
-explain extended select FIND_IN_SET(_latin1'B', _latin1'a,b,c,d');
-explain extended select collation(conv(130,16,10));
-explain extended select coercibility(conv(130,16,10));
-explain extended select length('\n\t\r\b\0\_\%\\');
-explain extended select bit_length('\n\t\r\b\0\_\%\\');
-explain extended select bit_length('\n\t\r\b\0\_\%\\');
-explain extended select concat('monty',' was here ','again');
-explain extended select length('hello');
-explain extended select char(ascii('h'));
-explain extended select ord('h');
-explain extended select quote(1/0);
-explain extended select crc32("123");
-explain extended select replace('aaaa','a','b');
-explain extended select insert('txs',2,1,'hi');
-explain extended select left(_latin2'a',1);
-explain extended select right(_latin2'a',1);
-explain extended select lcase(_latin2'a');
-explain extended select ucase(_latin2'a');
-explain extended select SUBSTR('abcdefg',3,2);
-explain extended select substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2);
-explain extended select trim(_latin2' a ');
-explain extended select ltrim(_latin2' a ');
-explain extended select rtrim(_latin2' a ');
-explain extended select decode(encode(repeat("a",100000),"monty"),"monty");
-
-#
-# lpad returns incorrect result (Bug #2182)
-#
-
-SELECT lpad(12345, 5, "#");
-
-#
-# Problem the the CONV() function (Bug #2972)
-#
-
-SELECT conv(71, 10, 36), conv('1Z', 36, 10);
-SELECT conv(71, 10, 37), conv('1Z', 37, 10), conv(0,1,10),conv(0,0,10), conv(0,-1,10);
-
-#
-# Bug in SUBSTRING when mixed with CONCAT and ORDER BY (Bug #3089)
-#
-
-create table t1 (id int(1), str varchar(10)) DEFAULT CHARSET=utf8;
-insert into t1 values (1,'aaaaaaaaaa'), (2,'bbbbbbbbbb');
-create table t2 (id int(1), str varchar(10)) DEFAULT CHARSET=utf8;
-insert into t2 values (1,'cccccccccc'), (2,'dddddddddd');
-select substring(concat(t1.str, t2.str), 1, 15) "name" from t1, t2
-where t2.id=t1.id order by name;
-drop table t1, t2;
-
-#
-# Test case for conversion of long string value to integer (Bug #3472)
-#
-
-create table t1 (c1 INT, c2 INT UNSIGNED);
-insert into t1 values ('21474836461','21474836461');
-insert into t1 values ('-21474836461','-21474836461');
-show warnings;
-select * from t1;
-drop table t1;
-
-#
-# Bug #4878: LEFT() in integer/float context
-#
-
-select left(1234, 3) + 0;
-
-#
-# Bug #7101: bug with LEFT() when used as a field in GROUP BY aggregation
-#
-create table t1 (a int not null primary key, b varchar(40), c datetime);
-insert into t1 (a,b,c) values (1,'Tom','2004-12-10 12:13:14'),(2,'ball games','2004-12-10 12:13:14'), (3,'Basil','2004-12-10 12:13:14'), (4,'Dean','2004-12-10 12:13:14'),(5,'Ellis','2004-12-10 12:13:14'), (6,'Serg','2004-12-10 12:13:14'), (7,'Sergei','2004-12-10 12:13:14'),(8,'Georg','2004-12-10 12:13:14'),(9,'Salle','2004-12-10 12:13:14'),(10,'Sinisa','2004-12-10 12:13:14');
-select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12;
-drop table t1;
-
-#
-# Bug#7455 unexpected result: TRIM(<NULL> FROM <whatever>) gives NOT NULL
-# According to ANSI if one of the TRIM arguments is NULL, then the result
-# must be NULL too.
-#
-select trim(null from 'kate') as "must_be_null";
-select trim('xyz' from null) as "must_be_null";
-select trim(leading NULL from 'kate') as "must_be_null";
-select trim(trailing NULL from 'xyz') as "must_be_null";
-
-#
-# Bug #7751 - conversion for a bigint unsigned constant
-#
-
-CREATE TABLE t1 (
- id int(11) NOT NULL auto_increment,
- a bigint(20) unsigned default NULL,
- PRIMARY KEY (id)
-) ENGINE=MyISAM;
-
-INSERT INTO t1 VALUES
-('0','16307858876001849059');
-
-SELECT CONV('e251273eb74a8ee3', 16, 10);
-
-EXPLAIN
-SELECT id
- FROM t1
- WHERE a = 16307858876001849059;
-
-EXPLAIN
- SELECT id
- FROM t1
- WHERE a = CONV('e251273eb74a8ee3', 16, 10);
-
-DROP TABLE t1;
-
-#
-# Bug #6317: string function CHAR, parameter is NULL, wrong result
-#
-SELECT CHAR(NULL,121,83,81,'76') as my_column;
-SELECT CHAR_LENGTH(CHAR(NULL,121,83,81,'76')) as my_column;
-#
-# Test case for bug #8669: null aes_decrypt result in order by query
-#
-
-CREATE TABLE t1 (id int PRIMARY KEY, str char(255) NOT NULL);
-CREATE TABLE t2 (id int NOT NULL UNIQUE);
-INSERT INTO t2 VALUES (1),(2);
-INSERT INTO t1 VALUES (1, aes_encrypt('foo', 'bar'));
-INSERT INTO t1 VALUES (2, 'not valid');
-
-SELECT t1.id, aes_decrypt(str, 'bar') FROM t1, t2 WHERE t1.id = t2.id;
-SELECT t1.id, aes_decrypt(str, 'bar') FROM t1, t2 WHERE t1.id = t2.id
- ORDER BY t1.id;
-
-DROP TABLE t1, t2;
-
-#
-# Bug #10944: Mishandling of NULL arguments in FIELD()
-#
-select field(0,NULL,1,0), field("",NULL,"bar",""), field(0.0,NULL,1.0,0.0);
-select field(NULL,1,2,NULL), field(NULL,1,2,0);
-
-#
-# Bug #10124: access by integer index with a string key that is not a number
-#
-
-CREATE TABLE t1 (str varchar(20) PRIMARY KEY);
-CREATE TABLE t2 (num int primary key);
-INSERT INTO t1 VALUES ('notnumber');
-INSERT INTO t2 VALUES (0), (1);
-
-SELECT * FROM t1, t2 WHERE num=str;
-SELECT * FROM t1, t2 WHERE num=substring(str from 1 for 6);
-
-DROP TABLE t1,t2;
-
-#
-# Bug #11469: NOT NULL optimization wrongly used for arguments of CONCAT_WS
-#
-
-CREATE TABLE t1(
- id int(11) NOT NULL auto_increment,
- pc int(11) NOT NULL default '0',
- title varchar(20) default NULL,
- PRIMARY KEY (id)
-);
-
-INSERT INTO t1 VALUES
- (1, 0, 'Main'),
- (2, 1, 'Toys'),
- (3, 1, 'Games');
-
-SELECT t1.id, CONCAT_WS('->', t3.title, t2.title, t1.title) as col1
- FROM t1 LEFT JOIN t1 AS t2 ON t1.pc=t2.id
- LEFT JOIN t1 AS t3 ON t2.pc=t3.id;
-SELECT t1.id, CONCAT_WS('->', t3.title, t2.title, t1.title) as col1
- FROM t1 LEFT JOIN t1 AS t2 ON t1.pc=t2.id
- LEFT JOIN t1 AS t3 ON t2.pc=t3.id
- WHERE CONCAT_WS('->', t3.title, t2.title, t1.title) LIKE '%Toys%';
-
-DROP TABLE t1;
-
-
-CREATE TABLE t1(
- trackid int(10) unsigned NOT NULL auto_increment,
- trackname varchar(100) NOT NULL default '',
- PRIMARY KEY (trackid)
-);
-
-CREATE TABLE t2(
- artistid int(10) unsigned NOT NULL auto_increment,
- artistname varchar(100) NOT NULL default '',
- PRIMARY KEY (artistid)
-);
-
-CREATE TABLE t3(
- trackid int(10) unsigned NOT NULL,
- artistid int(10) unsigned NOT NULL,
- PRIMARY KEY (trackid,artistid)
-);
-
-INSERT INTO t1 VALUES (1, 'April In Paris'), (2, 'Autumn In New York');
-INSERT INTO t2 VALUES (1, 'Vernon Duke');
-INSERT INTO t3 VALUES (1,1);
-
-SELECT CONCAT_WS(' ', trackname, artistname) trackname, artistname
- FROM t1 LEFT JOIN t3 ON t1.trackid=t3.trackid
- LEFT JOIN t2 ON t2.artistid=t3.artistid
- WHERE CONCAT_WS(' ', trackname, artistname) LIKE '%In%';
-
-DROP TABLE t1,t2,t3;
-
-#
-# Correct length reporting from substring() (BUG#10269)
-#
-create table t1 (b varchar(5));
-insert t1 values ('ab'), ('abc'), ('abcd'), ('abcde');
-select *,substring(b,1),substring(b,-1),substring(b,-2),substring(b,-3),substring(b,-4),substring(b,-5) from t1;
-select * from (select *,substring(b,1),substring(b,-1),substring(b,-2),substring(b,-3),substring(b,-4),substring(b,-5) from t1) t;
-drop table t1;
-
-#
-# Bug #9854 hex() and out of range handling
-#
-select hex(29223372036854775809), hex(-29223372036854775809);
-
-#
-# Bug #11311: Incorrect length returned from LPAD() and RPAD()
-#
-create table t1 (i int);
-insert into t1 values (1000000000),(1);
---enable_metadata
-select lpad(i, 7, ' ') as t from t1;
-select rpad(i, 7, ' ') as t from t1;
---disable_metadata
-drop table t1;
-
-#
-# Bug #10418: LOAD_FILE does not behave like in manual if file does not exist
-#
-
-select load_file("lkjlkj");
-select ifnull(load_file("lkjlkj"),"it's null");
-
-#
-# Bug#15351: Wrong collation used for comparison of md5() and sha()
-# parameter can lead to a wrong result.
-#
-create table t1 (f1 varchar(4), f2 varchar(64), unique key k1 (f1,f2));
-insert into t1 values ( 'test',md5('test')), ('test', sha('test'));
-select * from t1 where f1='test' and (f2= md5("test") or f2= md5("TEST"));
-select * from t1 where f1='test' and (f2= md5("TEST") or f2= md5("test"));
-select * from t1 where f1='test' and (f2= sha("test") or f2= sha("TEST"));
-select * from t1 where f1='test' and (f2= sha("TEST") or f2= sha("test"));
-drop table t1;
-
-#
-# Bug#18243: REVERSE changes its argument
-#
-
-CREATE TABLE t1 (a varchar(10));
-INSERT INTO t1 VALUES ('abc'), ('xyz');
-
-SELECT a, CONCAT(a,' ',a) AS c FROM t1
- HAVING LEFT(c,LENGTH(c)-INSTR(REVERSE(c)," ")) = a;
-
-SELECT a, CONCAT(a,' ',a) AS c FROM t1
- HAVING LEFT(CONCAT(a,' ',a),
- LENGTH(CONCAT(a,' ',a))-
- INSTR(REVERSE(CONCAT(a,' ',a))," ")) = a;
-
-DROP TABLE t1;
-
-#
-# Bug#17526: WRONG PRINT for TRIM FUNCTION with two arguments
-#
-
-CREATE TABLE t1 (s varchar(10));
-INSERT INTO t1 VALUES ('yadda'), ('yaddy');
-
-EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(s) > 'ab';
-EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM('y' FROM s) > 'ab';
-EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(LEADING 'y' FROM s) > 'ab';
-EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(TRAILING 'y' FROM s) > 'ab';
-EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(BOTH 'y' FROM s) > 'ab';
-
-DROP TABLE t1;
-
---echo End of 4.1 tests
-
-#
-# Bug #13361: SELECT FORMAT(<decimal field with null>, 2) crashes
-#
-create table t1 (d decimal default null);
-insert into t1 values (null);
-select format(d, 2) from t1;
-drop table t1;
-
-#
-# Bug #14676: substring_index() returns incorrect results
-#
-create table t1 (c varchar(40));
-insert into t1 values ('y,abc'),('y,abc');
-select c, substring_index(lcase(c), @q:=',', -1) as res from t1;
-drop table t1;
-
-#
-# Bug #17043: Casting trimmed string to decimal loses precision
-#
-select cast(rtrim(' 20.06 ') as decimal(19,2));
-select cast(ltrim(' 20.06 ') as decimal(19,2));
-select cast(rtrim(ltrim(' 20.06 ')) as decimal(19,2));
-
-#
-# Bug #13975: "same string" + 0 has 2 different results
-#
-select conv("18383815659218730760",10,10) + 0;
-select "18383815659218730760" + 0;
-
-#
-# Bug #21698: substitution of a string field for a constant under a function
-#
-
-CREATE TABLE t1 (code varchar(10));
-INSERT INTO t1 VALUES ('a12'), ('A12'), ('a13');
-
-SELECT ASCII(code), code FROM t1 WHERE code='A12';
-SELECT ASCII(code), code FROM t1 WHERE code='A12' AND ASCII(code)=65;
-
-INSERT INTO t1 VALUES ('a12 '), ('A12 ');
-
-SELECT LENGTH(code), code FROM t1 WHERE code='A12';
-SELECT LENGTH(code), code FROM t1 WHERE code='A12' AND LENGTH(code)=5;
-
-ALTER TABLE t1 ADD INDEX (code);
-CREATE TABLE t2 (id varchar(10) PRIMARY KEY);
-INSERT INTO t2 VALUES ('a11'), ('a12'), ('a13'), ('a14');
-
-SELECT * FROM t1 INNER JOIN t2 ON t1.code=t2.id
- WHERE t2.id='a12' AND (LENGTH(code)=5 OR code < 'a00');
-EXPLAIN EXTENDED
-SELECT * FROM t1 INNER JOIN t2 ON code=id
- WHERE id='a12' AND (LENGTH(code)=5 OR code < 'a00');
-
-DROP TABLE t1,t2;
-
-#
-# Bug#22684: The Functions ENCODE, DECODE and FORMAT are not real functions
-#
-
-select encode(NULL, NULL);
-select encode("data", NULL);
-select encode(NULL, "password");
-
-select decode(NULL, NULL);
-select decode("data", NULL);
-select decode(NULL, "password");
-
-select format(NULL, NULL);
-select format(pi(), NULL);
-select format(NULL, 2);
-
-select benchmark(NULL, NULL);
-select benchmark(0, NULL);
-select benchmark(100, NULL);
-select benchmark(NULL, 1+1);
-
-#
-# Please note:
-# 1) The collation of the password is irrelevant, the encryption uses
-# the binary representation of the string without charset/collation.
-# 2) These tests can not print the encoded text directly, because it's binary,
-# and doing this would cause problems with source control.
-# Instead, an md5() checksum is used, to verify the result indirectly.
-# 3) Each md5() result must be identical.
-# 4) The md5() result must never change, and must be stable across releases.
-#
-set @password="password";
-set @my_data="clear text to encode";
-select md5(encode(@my_data, "password"));
-select md5(encode(@my_data, _utf8 "password"));
-select md5(encode(@my_data, binary "password"));
-select md5(encode(@my_data, _latin1 "password"));
-select md5(encode(@my_data, _koi8r "password"));
-select md5(encode(@my_data, (select "password" from dual)));
-select md5(encode(@my_data, concat("pass", "word")));
-select md5(encode(@my_data, @password));
-
-set @my_data="binary encoded data";
-select md5(decode(@my_data, "password"));
-select md5(decode(@my_data, _utf8 "password"));
-select md5(decode(@my_data, binary "password"));
-select md5(decode(@my_data, _latin1 "password"));
-select md5(decode(@my_data, _koi8r "password"));
-select md5(decode(@my_data, (select "password" from dual)));
-select md5(decode(@my_data, concat("pass", "word")));
-select md5(decode(@my_data, @password));
-
-set @dec=5;
-select format(pi(), (1+1));
-select format(pi(), (select 3 from dual));
-select format(pi(), @dec);
-
-set @bench_count=10;
-select benchmark(10, pi());
-select benchmark(5+5, pi());
-select benchmark((select 10 from dual), pi());
-select benchmark(@bench_count, pi());
-
-
-#
-# Bug #10963
-# 4294967296 18446744073709551616
-
-select locate('he','hello',-2);
-select locate('lo','hello',-4294967295);
-select locate('lo','hello',4294967295);
-select locate('lo','hello',-4294967296);
-select locate('lo','hello',4294967296);
-select locate('lo','hello',-4294967297);
-select locate('lo','hello',4294967297);
-select locate('lo','hello',-18446744073709551615);
-select locate('lo','hello',18446744073709551615);
-select locate('lo','hello',-18446744073709551616);
-select locate('lo','hello',18446744073709551616);
-select locate('lo','hello',-18446744073709551617);
-select locate('lo','hello',18446744073709551617);
-
-select left('hello', 10);
-select left('hello', 0);
-select left('hello', -1);
-select left('hello', -4294967295);
-select left('hello', 4294967295);
-select left('hello', -4294967296);
-select left('hello', 4294967296);
-select left('hello', -4294967297);
-select left('hello', 4294967297);
-select left('hello', -18446744073709551615);
-select left('hello', 18446744073709551615);
-select left('hello', -18446744073709551616);
-select left('hello', 18446744073709551616);
-select left('hello', -18446744073709551617);
-select left('hello', 18446744073709551617);
-
-select right('hello', 10);
-select right('hello', 0);
-select right('hello', -1);
-select right('hello', -4294967295);
-select right('hello', 4294967295);
-select right('hello', -4294967296);
-select right('hello', 4294967296);
-select right('hello', -4294967297);
-select right('hello', 4294967297);
-select right('hello', -18446744073709551615);
-select right('hello', 18446744073709551615);
-select right('hello', -18446744073709551616);
-select right('hello', 18446744073709551616);
-select right('hello', -18446744073709551617);
-select right('hello', 18446744073709551617);
-
-select substring('hello', 2, -1);
-
-select substring('hello', -1, 1);
-select substring('hello', -2, 1);
-select substring('hello', -4294967295, 1);
-select substring('hello', 4294967295, 1);
-select substring('hello', -4294967296, 1);
-select substring('hello', 4294967296, 1);
-select substring('hello', -4294967297, 1);
-select substring('hello', 4294967297, 1);
-select substring('hello', -18446744073709551615, 1);
-select substring('hello', 18446744073709551615, 1);
-select substring('hello', -18446744073709551616, 1);
-select substring('hello', 18446744073709551616, 1);
-select substring('hello', -18446744073709551617, 1);
-select substring('hello', 18446744073709551617, 1);
-select substring('hello', 1, -1);
-select substring('hello', 1, -4294967295);
-select substring('hello', 1, 4294967295);
-select substring('hello', 1, -4294967296);
-select substring('hello', 1, 4294967296);
-select substring('hello', 1, -4294967297);
-select substring('hello', 1, 4294967297);
-select substring('hello', 1, -18446744073709551615);
-select substring('hello', 1, 18446744073709551615);
-select substring('hello', 1, -18446744073709551616);
-select substring('hello', 1, 18446744073709551616);
-select substring('hello', 1, -18446744073709551617);
-select substring('hello', 1, 18446744073709551617);
-select substring('hello', -1, -1);
-select substring('hello', -4294967295, -4294967295);
-select substring('hello', 4294967295, 4294967295);
-select substring('hello', -4294967296, -4294967296);
-select substring('hello', 4294967296, 4294967296);
-select substring('hello', -4294967297, -4294967297);
-select substring('hello', 4294967297, 4294967297);
-select substring('hello', -18446744073709551615, -18446744073709551615);
-select substring('hello', 18446744073709551615, 18446744073709551615);
-select substring('hello', -18446744073709551616, -18446744073709551616);
-select substring('hello', 18446744073709551616, 18446744073709551616);
-select substring('hello', -18446744073709551617, -18446744073709551617);
-select substring('hello', 18446744073709551617, 18446744073709551617);
-
-select insert('hello', -1, 1, 'hi');
-select insert('hello', -4294967295, 1, 'hi');
-select insert('hello', 4294967295, 1, 'hi');
-select insert('hello', -4294967296, 1, 'hi');
-select insert('hello', 4294967296, 1, 'hi');
-select insert('hello', -4294967297, 1, 'hi');
-select insert('hello', 4294967297, 1, 'hi');
-select insert('hello', -18446744073709551615, 1, 'hi');
-select insert('hello', 18446744073709551615, 1, 'hi');
-select insert('hello', -18446744073709551616, 1, 'hi');
-select insert('hello', 18446744073709551616, 1, 'hi');
-select insert('hello', -18446744073709551617, 1, 'hi');
-select insert('hello', 18446744073709551617, 1, 'hi');
-select insert('hello', 1, -1, 'hi');
-select insert('hello', 1, -4294967295, 'hi');
-select insert('hello', 1, 4294967295, 'hi');
-select insert('hello', 1, -4294967296, 'hi');
-select insert('hello', 1, 4294967296, 'hi');
-select insert('hello', 1, -4294967297, 'hi');
-select insert('hello', 1, 4294967297, 'hi');
-select insert('hello', 1, -18446744073709551615, 'hi');
-select insert('hello', 1, 18446744073709551615, 'hi');
-select insert('hello', 1, -18446744073709551616, 'hi');
-select insert('hello', 1, 18446744073709551616, 'hi');
-select insert('hello', 1, -18446744073709551617, 'hi');
-select insert('hello', 1, 18446744073709551617, 'hi');
-select insert('hello', -1, -1, 'hi');
-select insert('hello', -4294967295, -4294967295, 'hi');
-select insert('hello', 4294967295, 4294967295, 'hi');
-select insert('hello', -4294967296, -4294967296, 'hi');
-select insert('hello', 4294967296, 4294967296, 'hi');
-select insert('hello', -4294967297, -4294967297, 'hi');
-select insert('hello', 4294967297, 4294967297, 'hi');
-select insert('hello', -18446744073709551615, -18446744073709551615, 'hi');
-select insert('hello', 18446744073709551615, 18446744073709551615, 'hi');
-select insert('hello', -18446744073709551616, -18446744073709551616, 'hi');
-select insert('hello', 18446744073709551616, 18446744073709551616, 'hi');
-select insert('hello', -18446744073709551617, -18446744073709551617, 'hi');
-select insert('hello', 18446744073709551617, 18446744073709551617, 'hi');
-
-select repeat('hello', -1);
-select repeat('hello', -4294967295);
-select repeat('hello', 4294967295);
-select repeat('hello', -4294967296);
-select repeat('hello', 4294967296);
-select repeat('hello', -4294967297);
-select repeat('hello', 4294967297);
-select repeat('hello', -18446744073709551615);
-select repeat('hello', 18446744073709551615);
-select repeat('hello', -18446744073709551616);
-select repeat('hello', 18446744073709551616);
-select repeat('hello', -18446744073709551617);
-select repeat('hello', 18446744073709551617);
-
-select space(-1);
-select space(-4294967295);
-select space(4294967295);
-select space(-4294967296);
-select space(4294967296);
-select space(-4294967297);
-select space(4294967297);
-select space(-18446744073709551615);
-select space(18446744073709551615);
-select space(-18446744073709551616);
-select space(18446744073709551616);
-select space(-18446744073709551617);
-select space(18446744073709551617);
-
-select rpad('hello', -1, '1');
-select rpad('hello', -4294967295, '1');
-select rpad('hello', 4294967295, '1');
-select rpad('hello', -4294967296, '1');
-select rpad('hello', 4294967296, '1');
-select rpad('hello', -4294967297, '1');
-select rpad('hello', 4294967297, '1');
-select rpad('hello', -18446744073709551615, '1');
-select rpad('hello', 18446744073709551615, '1');
-select rpad('hello', -18446744073709551616, '1');
-select rpad('hello', 18446744073709551616, '1');
-select rpad('hello', -18446744073709551617, '1');
-select rpad('hello', 18446744073709551617, '1');
-
-select lpad('hello', -1, '1');
-select lpad('hello', -4294967295, '1');
-select lpad('hello', 4294967295, '1');
-select lpad('hello', -4294967296, '1');
-select lpad('hello', 4294967296, '1');
-select lpad('hello', -4294967297, '1');
-select lpad('hello', 4294967297, '1');
-select lpad('hello', -18446744073709551615, '1');
-select lpad('hello', 18446744073709551615, '1');
-select lpad('hello', -18446744073709551616, '1');
-select lpad('hello', 18446744073709551616, '1');
-select lpad('hello', -18446744073709551617, '1');
-select lpad('hello', 18446744073709551617, '1');
-
-
-#
-# BUG#17047: CHAR() and IN() can return NULL without signaling NULL
-# result
-#
-SET @orig_sql_mode = @@SQL_MODE;
-SET SQL_MODE=traditional;
-
-SELECT CHAR(0xff,0x8f USING utf8);
-SELECT CHAR(0xff,0x8f USING utf8) IS NULL;
-
-SET SQL_MODE=@orig_sql_mode;
-
-#
-# Bug #24947: problem with some string function with unsigned int parameters
-#
-
-select substring('abc', cast(2 as unsigned int));
-select repeat('a', cast(2 as unsigned int));
-select rpad('abc', cast(5 as unsigned integer), 'x');
-select lpad('abc', cast(5 as unsigned integer), 'x');
-
---disable_query_log
-drop database pbxt;
---enable_query_log
---echo End of 5.0 tests
diff --git a/mysql-test/suite/pbxt/t/func_system.test b/mysql-test/suite/pbxt/t/func_system.test
deleted file mode 100644
index 2bfe1e5a09a..00000000000
--- a/mysql-test/suite/pbxt/t/func_system.test
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# system functions
-#
-
-select database();
-select charset(database());
-select database() = "test";
-select database() = _utf8"test";
-select database() = _latin1"test";
-
-select user() like "%@%";
-select user() like _utf8"%@%";
-select user() like _latin1"%@%";
-select charset(user());
-
-select version()>="3.23.29";
-select version()>=_utf8"3.23.29";
-select version()>=_latin1"3.23.29";
-select charset(version());
-explain extended select database(), user();
-
-create table t1 (version char(60)) select database(), user(), version() as 'version';
-show create table t1;
-drop table t1;
-
-select charset(charset(_utf8'a')), charset(collation(_utf8'a'));
-select collation(charset(_utf8'a')), collation(collation(_utf8'a'));
-create table t1 select charset(_utf8'a'), collation(_utf8'a');
-show create table t1;
-drop table t1;
-
-select TRUE,FALSE,NULL;
-
-#
-# Bug#12351: CONCAT with USER()/DATEBASE() and
-# a constant and a column gets strange results
-#
-create table t1 (c1 char(5)) character set=latin1;
-insert into t1 values('row 1');
-insert into t1 values('row 2');
-insert into t1 values('row 3');
-select concat(user(), '--', c1) from t1;
-select concat(database(), '--', c1) from t1;
-drop table t1;
-
-#
-# Bug#8291 Illegal collation mix with USER() function
-#
-create table t1 (a char(10)) character set latin1;
-select * from t1 where a=version();
-select * from t1 where a=database();
-select * from t1 where a=user();
-insert into t1 values ('a');
-select left(concat(a,version()),1) from t1;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/func_timestamp.test b/mysql-test/suite/pbxt/t/func_timestamp.test
deleted file mode 100644
index 80afcc246b1..00000000000
--- a/mysql-test/suite/pbxt/t/func_timestamp.test
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# Tests that depend on the timestamp and the TZ variable
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-# Set timezone to GMT-3, to make it possible to use "interval 3 hour"
-set time_zone="+03:00";
-
-create table t1 (Zeit time, Tag tinyint not null, Monat tinyint not null,
-Jahr smallint not null, index(Tag), index(Monat), index(Jahr) );
-insert into t1 values ("09:26:00",16,9,1998),("09:26:00",16,9,1998);
-SELECT CONCAT(Jahr,'-',Monat,'-',Tag,' ',Zeit) AS Date,
- UNIX_TIMESTAMP(CONCAT(Jahr,'-',Monat,'-',Tag,' ',Zeit)) AS Unix
-FROM t1;
-drop table t1;
-
-# End of 4.1 tests
-
-# Restore timezone to default
-set time_zone= @@global.time_zone;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/gcc296.test b/mysql-test/suite/pbxt/t/gcc296.test
deleted file mode 100644
index 3e66e866e37..00000000000
--- a/mysql-test/suite/pbxt/t/gcc296.test
+++ /dev/null
@@ -1,22 +0,0 @@
-#try to crash gcc 2.96
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-CREATE TABLE t1 (
- kodoboru varchar(10) default NULL,
- obor tinytext,
- aobor tinytext,
- UNIQUE INDEX kodoboru (kodoboru),
- FULLTEXT KEY obor (obor),
- FULLTEXT KEY aobor (aobor)
-) engine=myisam; # PBXT: Only MyISAM has full-text index
-INSERT INTO t1 VALUES ('0101000000','aaa','AAA');
-INSERT INTO t1 VALUES ('0102000000','bbb','BBB');
-INSERT INTO t1 VALUES ('0103000000','ccc','CCC');
-INSERT INTO t1 VALUES ('0104000000','xxx','XXX');
-
-select * from t1;
-drop table t1;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/grant.test b/mysql-test/suite/pbxt/t/grant.test
deleted file mode 100644
index 35b2c1c0bae..00000000000
--- a/mysql-test/suite/pbxt/t/grant.test
+++ /dev/null
@@ -1,947 +0,0 @@
-# Test of GRANT commands
-
-# Grant tests not performed with embedded server
--- source include/not_embedded.inc
-
-# Cleanup
---disable_warnings
-drop table if exists t1;
-drop database if exists mysqltest;
---enable_warnings
-
-connect (master,localhost,root,,);
-connection master;
-SET NAMES binary;
-
-#
-# Test that SSL options works properly
-#
-
-delete from mysql.user where user='mysqltest_1';
-delete from mysql.db where user='mysqltest_1';
-flush privileges;
-grant select on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA";
-show grants for mysqltest_1@localhost;
-grant delete on mysqltest.* to mysqltest_1@localhost;
-select * from mysql.user where user="mysqltest_1";
-show grants for mysqltest_1@localhost;
-revoke delete on mysqltest.* from mysqltest_1@localhost;
-show grants for mysqltest_1@localhost;
-grant select on mysqltest.* to mysqltest_1@localhost require NONE;
-show grants for mysqltest_1@localhost;
-grant USAGE on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "testsubject" ISSUER "MySQL AB";
-show grants for mysqltest_1@localhost;
-revoke all privileges on mysqltest.* from mysqltest_1@localhost;
-show grants for mysqltest_1@localhost;
-delete from mysql.user where user='mysqltest_1';
-flush privileges;
-
-#
-# Test of GRANTS specifying user limits
-#
-delete from mysql.user where user='mysqltest_1';
-flush privileges;
-grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 10;
-select * from mysql.user where user="mysqltest_1";
-show grants for mysqltest_1@localhost;
-grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30;
-select * from mysql.user where user="mysqltest_1";
-show grants for mysqltest_1@localhost;
-# This is just to double check that one won't ignore results of selects
-flush privileges;
-show grants for mysqltest_1@localhost;
-delete from mysql.user where user='mysqltest_1';
-flush privileges;
-
-#
-# Test that the new db privileges are stored/retrieved correctly
-#
-
-grant CREATE TEMPORARY TABLES, LOCK TABLES on mysqltest.* to mysqltest_1@localhost;
-show grants for mysqltest_1@localhost;
-flush privileges;
-show grants for mysqltest_1@localhost;
-revoke CREATE TEMPORARY TABLES on mysqltest.* from mysqltest_1@localhost;
-show grants for mysqltest_1@localhost;
-grant ALL PRIVILEGES on mysqltest.* to mysqltest_1@localhost with GRANT OPTION;
-flush privileges;
-show grants for mysqltest_1@localhost;
-revoke LOCK TABLES, ALTER on mysqltest.* from mysqltest_1@localhost;
-show grants for mysqltest_1@localhost;
-revoke all privileges on mysqltest.* from mysqltest_1@localhost;
-delete from mysql.user where user='mysqltest_1';
-flush privileges;
-grant usage on test.* to mysqltest_1@localhost with grant option;
-show grants for mysqltest_1@localhost;
-delete from mysql.user where user='mysqltest_1';
-delete from mysql.db where user='mysqltest_1';
-delete from mysql.tables_priv where user='mysqltest_1';
-delete from mysql.columns_priv where user='mysqltest_1';
-flush privileges;
---error 1141
-show grants for mysqltest_1@localhost;
-
-#
-# Test what happens when you have same table and colum level grants
-#
-
-create table t1 (a int);
-GRANT select,update,insert on t1 to mysqltest_1@localhost;
-GRANT select (a), update (a),insert(a), references(a) on t1 to mysqltest_1@localhost;
-show grants for mysqltest_1@localhost;
-select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1";
-REVOKE select (a), update on t1 from mysqltest_1@localhost;
-show grants for mysqltest_1@localhost;
-REVOKE select,update,insert,insert (a) on t1 from mysqltest_1@localhost;
-show grants for mysqltest_1@localhost;
-GRANT select,references on t1 to mysqltest_1@localhost;
-select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1";
-grant all on test.* to mysqltest_3@localhost with grant option;
-revoke all on test.* from mysqltest_3@localhost;
-show grants for mysqltest_3@localhost;
-revoke grant option on test.* from mysqltest_3@localhost;
-show grants for mysqltest_3@localhost;
-grant all on test.t1 to mysqltest_2@localhost with grant option;
-revoke all on test.t1 from mysqltest_2@localhost;
-show grants for mysqltest_2@localhost;
-revoke grant option on test.t1 from mysqltest_2@localhost;
-show grants for mysqltest_2@localhost;
-delete from mysql.user where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
-delete from mysql.db where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
-delete from mysql.tables_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
-delete from mysql.columns_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
-flush privileges;
-drop table t1;
-
-#
-# Test some error conditions
-#
---error 1221
-GRANT FILE on mysqltest.* to mysqltest_1@localhost;
-select 1; # To test that the previous command didn't cause problems
-
-#
-# Bug #4898: User privileges depending on ORDER BY Settings of table db
-#
-insert into mysql.user (host, user) values ('localhost', 'test11');
-insert into mysql.db (host, db, user, select_priv) values
-('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y');
-alter table mysql.db order by db asc;
-flush privileges;
-show grants for test11@localhost;
-alter table mysql.db order by db desc;
-flush privileges;
-show grants for test11@localhost;
-delete from mysql.user where user='test11';
-delete from mysql.db where user='test11';
-
-#
-# Bug#6123: GRANT USAGE inserts useless Db row
-#
-create database mysqltest1;
-grant usage on mysqltest1.* to test6123 identified by 'magic123';
-select host,db,user,select_priv,insert_priv from mysql.db where db="mysqltest1";
-delete from mysql.user where user='test6123';
-drop database mysqltest1;
-
-#
-# Test for 'drop user', 'revoke privileges, grant'
-#
-
-create table t1 (a int);
-grant ALL PRIVILEGES on *.* to drop_user2@localhost with GRANT OPTION;
-show grants for drop_user2@localhost;
-revoke all privileges, grant option from drop_user2@localhost;
-drop user drop_user2@localhost;
-
-grant ALL PRIVILEGES on *.* to drop_user@localhost with GRANT OPTION;
-grant ALL PRIVILEGES on test.* to drop_user@localhost with GRANT OPTION;
-grant select(a) on test.t1 to drop_user@localhost;
-show grants for drop_user@localhost;
-
-#
-# Bug3086
-#
-set sql_mode=ansi_quotes;
-show grants for drop_user@localhost;
-set sql_mode=default;
-
-set sql_quote_show_create=0;
-show grants for drop_user@localhost;
-set sql_mode="ansi_quotes";
-show grants for drop_user@localhost;
-set sql_quote_show_create=1;
-show grants for drop_user@localhost;
-set sql_mode="";
-show grants for drop_user@localhost;
-
-revoke all privileges, grant option from drop_user@localhost;
-show grants for drop_user@localhost;
-drop user drop_user@localhost;
---error 1269
-revoke all privileges, grant option from drop_user@localhost;
-
-grant select(a) on test.t1 to drop_user1@localhost;
-grant select on test.t1 to drop_user2@localhost;
-grant select on test.* to drop_user3@localhost;
-grant select on *.* to drop_user4@localhost;
-# Drop user now implicitly revokes all privileges.
-drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost,
-drop_user4@localhost;
---error 1269
-revoke all privileges, grant option from drop_user1@localhost, drop_user2@localhost,
-drop_user3@localhost, drop_user4@localhost;
---error 1396
-drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost,
-drop_user4@localhost;
-drop table t1;
-grant usage on *.* to mysqltest_1@localhost identified by "password";
-grant select, update, insert on test.* to mysqltest_1@localhost;
-show grants for mysqltest_1@localhost;
-drop user mysqltest_1@localhost;
-
-#
-# Bug #3403 Wrong encodin in SHOW GRANTS output
-#
-SET NAMES koi8r;
-CREATE DATABASE ;
-USE ;
-CREATE TABLE ( int);
-
-GRANT SELECT ON .* TO @localhost;
-SHOW GRANTS FOR @localhost;
-REVOKE SELECT ON .* FROM @localhost;
-
-GRANT SELECT ON . TO @localhost;
-SHOW GRANTS FOR @localhost;
-REVOKE SELECT ON . FROM @localhost;
-
-GRANT SELECT () ON . TO @localhost;
-SHOW GRANTS FOR @localhost;
-REVOKE SELECT () ON . FROM @localhost;
-
-# Revoke does not drop user. Leave a clean user table for the next tests.
-DROP USER @localhost;
-
-DROP DATABASE ;
-SET NAMES latin1;
-
-#
-# Bug #5831: REVOKE ALL PRIVILEGES, GRANT OPTION does not revoke everything
-#
-USE test;
-CREATE TABLE t1 (a int );
-CREATE TABLE t2 LIKE t1;
-CREATE TABLE t3 LIKE t1;
-CREATE TABLE t4 LIKE t1;
-CREATE TABLE t5 LIKE t1;
-CREATE TABLE t6 LIKE t1;
-CREATE TABLE t7 LIKE t1;
-CREATE TABLE t8 LIKE t1;
-CREATE TABLE t9 LIKE t1;
-CREATE TABLE t10 LIKE t1;
-CREATE DATABASE testdb1;
-CREATE DATABASE testdb2;
-CREATE DATABASE testdb3;
-CREATE DATABASE testdb4;
-CREATE DATABASE testdb5;
-CREATE DATABASE testdb6;
-CREATE DATABASE testdb7;
-CREATE DATABASE testdb8;
-CREATE DATABASE testdb9;
-CREATE DATABASE testdb10;
-GRANT ALL ON testdb1.* TO testuser@localhost;
-GRANT ALL ON testdb2.* TO testuser@localhost;
-GRANT ALL ON testdb3.* TO testuser@localhost;
-GRANT ALL ON testdb4.* TO testuser@localhost;
-GRANT ALL ON testdb5.* TO testuser@localhost;
-GRANT ALL ON testdb6.* TO testuser@localhost;
-GRANT ALL ON testdb7.* TO testuser@localhost;
-GRANT ALL ON testdb8.* TO testuser@localhost;
-GRANT ALL ON testdb9.* TO testuser@localhost;
-GRANT ALL ON testdb10.* TO testuser@localhost;
-GRANT SELECT ON test.t1 TO testuser@localhost;
-GRANT SELECT ON test.t2 TO testuser@localhost;
-GRANT SELECT ON test.t3 TO testuser@localhost;
-GRANT SELECT ON test.t4 TO testuser@localhost;
-GRANT SELECT ON test.t5 TO testuser@localhost;
-GRANT SELECT ON test.t6 TO testuser@localhost;
-GRANT SELECT ON test.t7 TO testuser@localhost;
-GRANT SELECT ON test.t8 TO testuser@localhost;
-GRANT SELECT ON test.t9 TO testuser@localhost;
-GRANT SELECT ON test.t10 TO testuser@localhost;
-GRANT SELECT (a) ON test.t1 TO testuser@localhost;
-GRANT SELECT (a) ON test.t2 TO testuser@localhost;
-GRANT SELECT (a) ON test.t3 TO testuser@localhost;
-GRANT SELECT (a) ON test.t4 TO testuser@localhost;
-GRANT SELECT (a) ON test.t5 TO testuser@localhost;
-GRANT SELECT (a) ON test.t6 TO testuser@localhost;
-GRANT SELECT (a) ON test.t7 TO testuser@localhost;
-GRANT SELECT (a) ON test.t8 TO testuser@localhost;
-GRANT SELECT (a) ON test.t9 TO testuser@localhost;
-GRANT SELECT (a) ON test.t10 TO testuser@localhost;
-REVOKE ALL PRIVILEGES, GRANT OPTION FROM testuser@localhost;
-SHOW GRANTS FOR testuser@localhost;
-DROP USER testuser@localhost;
-DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
-DROP DATABASE testdb1;
-DROP DATABASE testdb2;
-DROP DATABASE testdb3;
-DROP DATABASE testdb4;
-DROP DATABASE testdb5;
-DROP DATABASE testdb6;
-DROP DATABASE testdb7;
-DROP DATABASE testdb8;
-DROP DATABASE testdb9;
-DROP DATABASE testdb10;
-
-#
-# Bug #6932: a problem with 'revoke ALL PRIVILEGES'
-#
-
-create table t1(a int, b int, c int, d int);
-grant insert(b), insert(c), insert(d), insert(a) on t1 to grant_user@localhost;
-show grants for grant_user@localhost;
-select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv order by Column_name;
-revoke ALL PRIVILEGES on t1 from grant_user@localhost;
-show grants for grant_user@localhost;
-select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv;
-drop user grant_user@localhost;
-drop table t1;
-
-#
-# Bug#7391: Cross-database multi-table UPDATE security problem
-#
-create database mysqltest_1;
-create database mysqltest_2;
-create table mysqltest_1.t1 select 1 a, 2 q;
-create table mysqltest_1.t2 select 1 b, 2 r;
-create table mysqltest_2.t1 select 1 c, 2 s;
-create table mysqltest_2.t2 select 1 d, 2 t;
-
-#test the column privileges
-grant update (a) on mysqltest_1.t1 to mysqltest_3@localhost;
-grant select (b) on mysqltest_1.t2 to mysqltest_3@localhost;
-grant select (c) on mysqltest_2.t1 to mysqltest_3@localhost;
-grant update (d) on mysqltest_2.t2 to mysqltest_3@localhost;
-connect (conn1,localhost,mysqltest_3,,);
-connection conn1;
-SELECT * FROM INFORMATION_SCHEMA.COLUMN_PRIVILEGES
- WHERE GRANTEE = '''mysqltest_3''@''localhost'''
- ORDER BY TABLE_NAME,COLUMN_NAME,PRIVILEGE_TYPE;
-SELECT * FROM INFORMATION_SCHEMA.TABLE_PRIVILEGES
- WHERE GRANTEE = '''mysqltest_3''@''localhost'''
- ORDER BY TABLE_NAME,PRIVILEGE_TYPE;
-SELECT * from INFORMATION_SCHEMA.SCHEMA_PRIVILEGES
- WHERE GRANTEE = '''mysqltest_3''@''localhost'''
- ORDER BY TABLE_SCHEMA,PRIVILEGE_TYPE;
-SELECT * from INFORMATION_SCHEMA.USER_PRIVILEGES
- WHERE GRANTEE = '''mysqltest_3''@''localhost'''
- ORDER BY TABLE_CATALOG,PRIVILEGE_TYPE;
---error 1143
-update mysqltest_1.t1, mysqltest_1.t2 set q=10 where b=1;
---error 1143
-update mysqltest_1.t2, mysqltest_2.t2 set d=20 where d=1;
---error 1142
-update mysqltest_1.t1, mysqltest_2.t2 set d=20 where d=1;
---error 1142
-update mysqltest_2.t1, mysqltest_1.t2 set c=20 where b=1;
---error 1143
-update mysqltest_2.t1, mysqltest_2.t2 set d=10 where s=2;
-#the following two should work
-update mysqltest_1.t1, mysqltest_2.t2 set a=10,d=10;
-update mysqltest_1.t1, mysqltest_2.t1 set a=20 where c=20;
-connection master;
-select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2;
-select t1.*,t2.* from mysqltest_2.t1,mysqltest_2.t2;
-revoke all on mysqltest_1.t1 from mysqltest_3@localhost;
-revoke all on mysqltest_1.t2 from mysqltest_3@localhost;
-revoke all on mysqltest_2.t1 from mysqltest_3@localhost;
-revoke all on mysqltest_2.t2 from mysqltest_3@localhost;
-
-#test the db/table level privileges
-grant all on mysqltest_2.* to mysqltest_3@localhost;
-grant select on *.* to mysqltest_3@localhost;
-# Next grant is needed to trigger bug#7391. Do not optimize!
-grant select on mysqltest_2.t1 to mysqltest_3@localhost;
-flush privileges;
-disconnect conn1;
-connect (conn2,localhost,mysqltest_3,,);
-connection conn2;
-use mysqltest_1;
-update mysqltest_2.t1, mysqltest_2.t2 set c=500,d=600;
-# the following failed before, should fail now.
---error 1142
-update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200;
-use mysqltest_2;
-#the following used to succeed, it must fail now.
---error 1142
-update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200;
---error 1142
-update mysqltest_2.t1, mysqltest_1.t2 set c=100,b=200;
---error 1142
-update mysqltest_1.t1, mysqltest_2.t2 set a=100,d=200;
-#lets see the result
-connection master;
-select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2;
-select t1.*,t2.* from mysqltest_2.t1,mysqltest_2.t2;
-
-delete from mysql.user where user='mysqltest_3';
-delete from mysql.db where user="mysqltest_3";
-delete from mysql.tables_priv where user="mysqltest_3";
-delete from mysql.columns_priv where user="mysqltest_3";
-flush privileges;
-drop database mysqltest_1;
-drop database mysqltest_2;
-
-#
-# just SHOW PRIVILEGES test
-#
-SHOW PRIVILEGES;
-
-#
-# Rights for renaming test (Bug #3270)
-#
-connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
-connection root;
---disable_warnings
-create database mysqltest;
---enable_warnings
-create table mysqltest.t1 (a int,b int,c int);
-grant all on mysqltest.t1 to mysqltest_1@localhost;
-connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
-connection user1;
--- error 1142
-alter table t1 rename t2;
-connection root;
-revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
-delete from mysql.user where user=_binary'mysqltest_1';
-drop database mysqltest;
-
-#
-# check all new table priveleges
-#
-CREATE USER dummy@localhost;
-CREATE DATABASE mysqltest;
-CREATE TABLE mysqltest.dummytable (dummyfield INT);
-CREATE VIEW mysqltest.dummyview AS SELECT dummyfield FROM mysqltest.dummytable;
-GRANT ALL PRIVILEGES ON mysqltest.dummytable TO dummy@localhost;
-GRANT ALL PRIVILEGES ON mysqltest.dummyview TO dummy@localhost;
-SHOW GRANTS FOR dummy@localhost;
-use INFORMATION_SCHEMA;
-SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
-PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
-= '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME;
-FLUSH PRIVILEGES;
-SHOW GRANTS FOR dummy@localhost;
-SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
-PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
-= '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME;
-SHOW FIELDS FROM mysql.tables_priv;
-use test;
-REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
-DROP USER dummy@localhost;
-DROP DATABASE mysqltest;
-# check view only privileges
-CREATE USER dummy@localhost;
-CREATE DATABASE mysqltest;
-CREATE TABLE mysqltest.dummytable (dummyfield INT);
-CREATE VIEW mysqltest.dummyview AS SELECT dummyfield FROM mysqltest.dummytable;
-GRANT CREATE VIEW ON mysqltest.dummytable TO dummy@localhost;
-GRANT CREATE VIEW ON mysqltest.dummyview TO dummy@localhost;
-SHOW GRANTS FOR dummy@localhost;
-use INFORMATION_SCHEMA;
-SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
-PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
-= '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME;
-FLUSH PRIVILEGES;
-SHOW GRANTS FOR dummy@localhost;
-SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
-PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
-= '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME;
-use test;
-REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
-DROP USER dummy@localhost;
-DROP DATABASE mysqltest;
-CREATE USER dummy@localhost;
-CREATE DATABASE mysqltest;
-CREATE TABLE mysqltest.dummytable (dummyfield INT);
-CREATE VIEW mysqltest.dummyview AS SELECT dummyfield FROM mysqltest.dummytable;
-GRANT SHOW VIEW ON mysqltest.dummytable TO dummy@localhost;
-GRANT SHOW VIEW ON mysqltest.dummyview TO dummy@localhost;
-SHOW GRANTS FOR dummy@localhost;
-use INFORMATION_SCHEMA;
-SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
-PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
-= '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME;
-FLUSH PRIVILEGES;
-SHOW GRANTS FOR dummy@localhost;
-SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
-PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
-= '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME;
-use test;
-REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
-DROP USER dummy@localhost;
-DROP DATABASE mysqltest;
-#
-# Bug #11330: Entry in tables_priv with host = '' causes crash
-#
-connection default;
-use mysql;
-insert into tables_priv values ('','test_db','mysqltest_1','test_table','test_grantor',CURRENT_TIMESTAMP,'Select','Select');
-flush privileges;
-delete from tables_priv where host = '' and user = 'mysqltest_1';
-flush privileges;
-use test;
-
-#
-# Bug #10892 user variables not auto cast for comparisons
-# Check that we don't get illegal mix of collations
-#
-set @user123="non-existent";
-select * from mysql.db where user=@user123;
-
-set names koi8r;
-create database ;
-grant select on .* to root@localhost;
-select hex(Db) from mysql.db where Db='';
-show grants for root@localhost;
-flush privileges;
-show grants for root@localhost;
-drop database ;
-revoke all privileges on .* from root@localhost;
-show grants for root@localhost;
-set names latin1;
-
-#
-# Bug #15598 Server crashes in specific case during setting new password
-# - Caused by a user with host ''
-#
-create user mysqltest_7@;
-set password for mysqltest_7@ = password('systpass');
-show grants for mysqltest_7@;
-drop user mysqltest_7@;
---error 1141
-show grants for mysqltest_7@;
-
-#
-# Bug#14385: GRANT and mapping to correct user account problems
-#
-create database mysqltest;
-use mysqltest;
-create table t1(f1 int);
-GRANT DELETE ON mysqltest.t1 TO mysqltest1@'%';
-GRANT SELECT ON mysqltest.t1 TO mysqltest1@'192.%';
-show grants for mysqltest1@'192.%';
-show grants for mysqltest1@'%';
-delete from mysql.user where user='mysqltest1';
-delete from mysql.db where user='mysqltest1';
-delete from mysql.tables_priv where user='mysqltest1';
-flush privileges;
-drop database mysqltest;
-
-# End of 4.1 tests
-
-#
-# Bug #16297 In memory grant tables not flushed when users's hostname is ""
-#
-use test;
-create table t1 (a int);
-
-# Backup anonymous users and remove them. (They get in the way of
-# the one we test with here otherwise.)
-create table t2 as select * from mysql.user where user='';
-delete from mysql.user where user='';
-flush privileges;
-
-# Create some users with different hostnames
-create user mysqltest_8@'';
-create user mysqltest_8;
-create user mysqltest_8@host8;
-
-# Try to create them again
---error 1396
-create user mysqltest_8@'';
---error 1396
-create user mysqltest_8;
---error 1396
-create user mysqltest_8@host8;
-
-select user, QUOTE(host) from mysql.user where user="mysqltest_8";
-
---echo Schema privileges
-grant select on mysqltest.* to mysqltest_8@'';
-show grants for mysqltest_8@'';
-grant select on mysqltest.* to mysqltest_8@;
-show grants for mysqltest_8@;
-grant select on mysqltest.* to mysqltest_8;
-show grants for mysqltest_8;
-select * from information_schema.schema_privileges
-where grantee like "'mysqltest_8'%";
-connect (conn3,localhost,mysqltest_8,,);
-select * from t1;
-disconnect conn3;
-connection master;
-revoke select on mysqltest.* from mysqltest_8@'';
-revoke select on mysqltest.* from mysqltest_8;
-show grants for mysqltest_8@'';
-show grants for mysqltest_8;
-select * from information_schema.schema_privileges
-where grantee like "'mysqltest_8'%";
-flush privileges;
-show grants for mysqltest_8@'';
-show grants for mysqltest_8@;
-grant select on mysqltest.* to mysqltest_8@'';
-flush privileges;
-show grants for mysqltest_8@;
-revoke select on mysqltest.* from mysqltest_8@'';
-flush privileges;
-
---echo Column privileges
-grant update (a) on t1 to mysqltest_8@'';
-grant update (a) on t1 to mysqltest_8;
-show grants for mysqltest_8@'';
-show grants for mysqltest_8;
-flush privileges;
-show grants for mysqltest_8@'';
-show grants for mysqltest_8;
-select * from information_schema.column_privileges;
-connect (conn4,localhost,mysqltest_8,,);
-select * from t1;
-disconnect conn4;
-connection master;
-revoke update (a) on t1 from mysqltest_8@'';
-revoke update (a) on t1 from mysqltest_8;
-show grants for mysqltest_8@'';
-show grants for mysqltest_8;
-select * from information_schema.column_privileges;
-flush privileges;
-show grants for mysqltest_8@'';
-show grants for mysqltest_8;
-
---echo Table privileges
-grant update on t1 to mysqltest_8@'';
-grant update on t1 to mysqltest_8;
-show grants for mysqltest_8@'';
-show grants for mysqltest_8;
-flush privileges;
-show grants for mysqltest_8@'';
-show grants for mysqltest_8;
-select * from information_schema.table_privileges;
-connect (conn5,localhost,mysqltest_8,,);
-select * from t1;
-disconnect conn5;
-connection master;
-revoke update on t1 from mysqltest_8@'';
-revoke update on t1 from mysqltest_8;
-show grants for mysqltest_8@'';
-show grants for mysqltest_8;
-select * from information_schema.table_privileges;
-flush privileges;
-show grants for mysqltest_8@'';
-show grants for mysqltest_8;
-
---echo "DROP USER" should clear privileges
-grant all privileges on mysqltest.* to mysqltest_8@'';
-grant select on mysqltest.* to mysqltest_8@'';
-grant update on t1 to mysqltest_8@'';
-grant update (a) on t1 to mysqltest_8@'';
-grant all privileges on mysqltest.* to mysqltest_8;
-show grants for mysqltest_8@'';
-show grants for mysqltest_8;
-select * from information_schema.user_privileges
-where grantee like "'mysqltest_8'%";
-connect (conn5,localhost,mysqltest_8,,);
-select * from t1;
-disconnect conn5;
-connection master;
-flush privileges;
-show grants for mysqltest_8@'';
-show grants for mysqltest_8;
-drop user mysqltest_8@'';
---error 1141
-show grants for mysqltest_8@'';
-show grants for mysqltest_8;
-select * from information_schema.user_privileges
-where grantee like "'mysqltest_8'%";
-drop user mysqltest_8;
---replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
---error 1045
-connect (conn6,localhost,mysqltest_8,,);
-connection master;
---error 1141
-show grants for mysqltest_8;
-drop user mysqltest_8@host8;
---error 1141
-show grants for mysqltest_8@host8;
-
-# Restore the anonymous users.
-insert into mysql.user select * from t2;
-flush privileges;
-drop table t2;
-
-drop table t1;
-
-#
-# Bug#20214: Incorrect error when user calls SHOW CREATE VIEW on non
-# privileged view
-#
-
-connection master;
-
-CREATE DATABASE mysqltest3;
-use mysqltest3;
-
-CREATE TABLE t_nn (c1 INT);
-CREATE VIEW v_nn AS SELECT * FROM t_nn;
-
-CREATE DATABASE mysqltest2;
-use mysqltest2;
-
-CREATE TABLE t_nn (c1 INT);
-CREATE VIEW v_nn AS SELECT * FROM t_nn;
-CREATE VIEW v_yn AS SELECT * FROM t_nn;
-CREATE VIEW v_gy AS SELECT * FROM t_nn;
-CREATE VIEW v_ny AS SELECT * FROM t_nn;
-CREATE VIEW v_yy AS SELECT * FROM t_nn WHERE c1=55;
-
-GRANT SHOW VIEW ON mysqltest2.v_ny TO 'mysqltest_1'@'localhost' IDENTIFIED BY 'mysqltest_1';
-GRANT SELECT ON mysqltest2.v_yn TO 'mysqltest_1'@'localhost' IDENTIFIED BY 'mysqltest_1';
-GRANT SELECT ON mysqltest2.* TO 'mysqltest_1'@'localhost' IDENTIFIED BY 'mysqltest_1';
-GRANT SHOW VIEW,SELECT ON mysqltest2.v_yy TO 'mysqltest_1'@'localhost' IDENTIFIED BY 'mysqltest_1';
-
-connect (mysqltest_1, localhost, mysqltest_1, mysqltest_1,);
-
-# fail because of missing SHOW VIEW (have generic SELECT)
---error ER_TABLEACCESS_DENIED_ERROR
-SHOW CREATE VIEW mysqltest2.v_nn;
---error ER_TABLEACCESS_DENIED_ERROR
-SHOW CREATE TABLE mysqltest2.v_nn;
-
-
-
-# fail because of missing SHOW VIEW
---error ER_TABLEACCESS_DENIED_ERROR
-SHOW CREATE VIEW mysqltest2.v_yn;
---error ER_TABLEACCESS_DENIED_ERROR
-SHOW CREATE TABLE mysqltest2.v_yn;
-
-
-
-# succeed (despite of missing SELECT, having SHOW VIEW bails us out)
-SHOW CREATE TABLE mysqltest2.v_ny;
-
-# succeed (despite of missing SELECT, having SHOW VIEW bails us out)
-SHOW CREATE VIEW mysqltest2.v_ny;
-
-
-
-# fail because of missing (specific or generic) SELECT
---error ER_TABLEACCESS_DENIED_ERROR
-SHOW CREATE TABLE mysqltest3.t_nn;
-
-# fail because of missing (specific or generic) SELECT (not because it's not a view!)
---error ER_TABLEACCESS_DENIED_ERROR
-SHOW CREATE VIEW mysqltest3.t_nn;
-
-
-
-# fail because of missing missing (specific or generic) SELECT (and SHOW VIEW)
---error ER_TABLEACCESS_DENIED_ERROR
-SHOW CREATE VIEW mysqltest3.v_nn;
---error ER_TABLEACCESS_DENIED_ERROR
-SHOW CREATE TABLE mysqltest3.v_nn;
-
-
-
-# succeed thanks to generic SELECT
-SHOW CREATE TABLE mysqltest2.t_nn;
-
-# fail because it's not a view! (have generic SELECT though)
---error ER_WRONG_OBJECT
-SHOW CREATE VIEW mysqltest2.t_nn;
-
-
-
-# succeed, have SELECT and SHOW VIEW
-SHOW CREATE VIEW mysqltest2.v_yy;
-
-# succeed, have SELECT and SHOW VIEW
-SHOW CREATE TABLE mysqltest2.v_yy;
-
-
-
-#clean-up
-connection master;
-
-# succeed, we're root
-SHOW CREATE TABLE mysqltest2.v_nn;
-SHOW CREATE VIEW mysqltest2.v_nn;
-
-SHOW CREATE TABLE mysqltest2.t_nn;
-
-# fail because it's not a view!
---error ER_WRONG_OBJECT
-SHOW CREATE VIEW mysqltest2.t_nn;
-
-
-
-DROP VIEW mysqltest2.v_nn;
-DROP VIEW mysqltest2.v_yn;
-DROP VIEW mysqltest2.v_ny;
-DROP VIEW mysqltest2.v_yy;
-
-DROP TABLE mysqltest2.t_nn;
-
-DROP DATABASE mysqltest2;
-
-
-
-DROP VIEW mysqltest3.v_nn;
-DROP TABLE mysqltest3.t_nn;
-
-DROP DATABASE mysqltest3;
-
-REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'mysqltest_1'@'localhost';
-DROP USER 'mysqltest_1'@'localhost';
-
-# restore the original database
-use test;
-
-#
-# Bug #10668: CREATE USER does not enforce username length limit
-#
---error ER_WRONG_STRING_LENGTH
-create user mysqltest1_thisisreallytoolong;
-
-#
-# Test for BUG#16899: Possible buffer overflow in handling of DEFINER-clause.
-#
-# These checks are intended to ensure that appropriate errors are risen when
-# illegal user name or hostname is specified in user-clause of GRANT/REVOKE
-# statements.
-#
-
-#
-# Bug #22369: Alter table rename combined with other alterations causes lost tables
-#
-CREATE DATABASE mysqltest1;
-CREATE TABLE mysqltest1.t1 (
- int_field INTEGER UNSIGNED NOT NULL,
- char_field CHAR(10),
- INDEX(`int_field`)
-);
-CREATE TABLE mysqltest1.t2 (int_field INT);
-
---echo "Now check that we require equivalent grants for "
---echo "RENAME TABLE and ALTER TABLE"
-CREATE USER mysqltest_1@localhost;
-GRANT SELECT ON mysqltest1.t1 TO mysqltest_1@localhost;
-
-connect (conn42,localhost,mysqltest_1,,mysqltest1);
-SELECT USER();
-SHOW GRANTS;
---error ER_TABLEACCESS_DENIED_ERROR
-RENAME TABLE t1 TO t2;
---error ER_TABLEACCESS_DENIED_ERROR
-ALTER TABLE t1 RENAME TO t2;
---disconnect conn42
---connection default
-GRANT DROP ON mysqltest1.t1 TO mysqltest_1@localhost;
-
-connect (conn42,localhost,mysqltest_1,,mysqltest1);
---error ER_TABLEACCESS_DENIED_ERROR
-RENAME TABLE t1 TO t2;
---error ER_TABLEACCESS_DENIED_ERROR
-ALTER TABLE t1 RENAME TO t2;
---disconnect conn42
---connection default
-GRANT ALTER ON mysqltest1.t1 TO mysqltest_1@localhost;
-
-connect (conn42,localhost,mysqltest_1,,mysqltest1);
-SHOW GRANTS;
---error ER_TABLEACCESS_DENIED_ERROR
-RENAME TABLE t1 TO t2;
---error ER_TABLEACCESS_DENIED_ERROR
-ALTER TABLE t1 RENAME TO t2;
---disconnect conn42
---connection default
-GRANT INSERT, CREATE ON mysqltest1.t1 TO mysqltest_1@localhost;
-connect (conn42,localhost,mysqltest_1,,mysqltest1);
-SHOW GRANTS;
---error ER_TABLEACCESS_DENIED_ERROR
---disconnect conn42
---connection default
-GRANT INSERT, SELECT, CREATE, ALTER, DROP ON mysqltest1.t2 TO mysqltest_1@localhost;
-DROP TABLE mysqltest1.t2;
-
-connect (conn42,localhost,mysqltest_1,,mysqltest1);
---sorted_result
-SHOW GRANTS;
-RENAME TABLE t1 TO t2;
-RENAME TABLE t2 TO t1;
-ALTER TABLE t1 RENAME TO t2;
-ALTER TABLE t2 RENAME TO t1;
---disconnect conn42
---connection default
-REVOKE DROP, INSERT ON mysqltest1.t1 FROM mysqltest_1@localhost;
-REVOKE DROP, INSERT ON mysqltest1.t2 FROM mysqltest_1@localhost;
-
-connect (conn42,localhost,mysqltest_1,,mysqltest1);
---sorted_result
-SHOW GRANTS;
---error ER_TABLEACCESS_DENIED_ERROR
-RENAME TABLE t1 TO t2;
---error ER_TABLEACCESS_DENIED_ERROR
-ALTER TABLE t1 RENAME TO t2;
---disconnect conn42
---connection default
-
-DROP USER mysqltest_1@localhost;
-DROP DATABASE mysqltest1;
-
-# Working with database-level privileges.
-
---error ER_WRONG_STRING_LENGTH
-GRANT CREATE ON mysqltest.* TO 1234567890abcdefGHIKL@localhost;
-
---error ER_WRONG_STRING_LENGTH
-GRANT CREATE ON mysqltest.* TO some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY;
-
---error ER_WRONG_STRING_LENGTH
-REVOKE CREATE ON mysqltest.* FROM 1234567890abcdefGHIKL@localhost;
-
---error ER_WRONG_STRING_LENGTH
-REVOKE CREATE ON mysqltest.* FROM some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY;
-
-# Working with table-level privileges.
-
---error ER_WRONG_STRING_LENGTH
-GRANT CREATE ON t1 TO 1234567890abcdefGHIKL@localhost;
-
---error ER_WRONG_STRING_LENGTH
-GRANT CREATE ON t1 TO some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY;
-
---error ER_WRONG_STRING_LENGTH
-REVOKE CREATE ON t1 FROM 1234567890abcdefGHIKL@localhost;
-
---error ER_WRONG_STRING_LENGTH
-REVOKE CREATE ON t1 FROM some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY;
-
-# Working with routine-level privileges.
-
---error ER_WRONG_STRING_LENGTH
-GRANT EXECUTE ON PROCEDURE p1 TO 1234567890abcdefGHIKL@localhost;
-
---error ER_WRONG_STRING_LENGTH
-GRANT EXECUTE ON PROCEDURE p1 TO some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY;
-
---error ER_WRONG_STRING_LENGTH
-REVOKE EXECUTE ON PROCEDURE p1 FROM 1234567890abcdefGHIKL@localhost;
-
---error ER_WRONG_STRING_LENGTH
-REVOKE EXECUTE ON PROCEDURE t1 FROM some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY;
---disable_query_log
-drop database pbxt;
---enable_query_log
---echo End of 5.0 tests
diff --git a/mysql-test/suite/pbxt/t/grant_cache.test b/mysql-test/suite/pbxt/t/grant_cache.test
deleted file mode 100644
index ce53a88ac0c..00000000000
--- a/mysql-test/suite/pbxt/t/grant_cache.test
+++ /dev/null
@@ -1,173 +0,0 @@
-# Grant tests not performed with embedded server
--- source include/not_embedded.inc
--- source include/have_query_cache.inc
-
---source include/add_anonymous_users.inc
-
-#
-# some statements have different results in ps-mode
-#
-let $actual1=4;
-let $actual2=5;
-if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`)
-{
- let $actual1=3;
- let $actual2=4;
-}
-
-#
-# Test grants with query cache
-#
---disable_warnings
-drop table if exists test.t1,mysqltest.t1,mysqltest.t2;
-drop database if exists mysqltest;
---enable_warnings
-
-set GLOBAL query_cache_size=1355776;
-
-reset query cache;
-flush status;
-connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
-connection root;
-show grants for current_user;
-show grants;
---disable_warnings
-create database if not exists mysqltest;
---enable_warnings
-
-create table mysqltest.t1 (a int,b int,c int);
-create table mysqltest.t2 (a int,b int,c int);
-insert into mysqltest.t1 values (1,1,1),(2,2,2);
-insert into mysqltest.t2 values (3,3,3);
-create table test.t1 (a char (10)) engine=myisam;
-insert into test.t1 values ("test.t1");
-select * from t1;
-connect (root2,localhost,root,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
-connection root2;
-# put queries in cache
-select * from t1;
-select a from t1;
-select c from t1;
-select * from t2;
-select * from mysqltest.t1,test.t1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_hits%";
-
-# Create the test users
-grant SELECT on mysqltest.* to mysqltest_1@localhost;
-grant SELECT on mysqltest.t1 to mysqltest_2@localhost;
-grant SELECT on test.t1 to mysqltest_2@localhost;
-grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost;
-
-# The following queries should be fetched from cache
-connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
-connection user1;
-show grants for current_user();
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_hits";
-show status like "Qcache_not_cached";
-select "user1";
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_hits";
-show status like "Qcache_not_cached";
-select * from t1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_hits";
-show status like "Qcache_not_cached";
-# The pre and end space are intentional
- select a from t1 ;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_hits";
-show status like "Qcache_not_cached";
-select c from t1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_hits";
-show status like "Qcache_not_cached";
-
-# Don't use '' as user because it will pick Unix login
-connect (unkuser,localhost,unkuser,,,$MASTER_MYPORT,$MASTER_MYSOCK);
-connection unkuser;
-show grants for current_user();
-
-# The following queries should be fetched from cache
-connect (user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
-connection user2;
-select "user2";
-select * from t1;
-select a from t1;
-select c from t1;
-select * from mysqltest.t1,test.t1;
---replace_result 127.0.0.1 localhost
---error 1142
-select * from t2;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_hits";
-show status like "Qcache_not_cached";
-
-# The following queries should not be fetched from cache
-connect (user3,localhost,mysqltest_3,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
-connection user3;
-select "user3";
---replace_result 127.0.0.1 localhost
---error 1142
-select * from t1;
-select a from t1;
---replace_result 127.0.0.1 localhost
---error 1143
-select c from t1;
---replace_result 127.0.0.1 localhost
---error 1142
-select * from t2;
---replace_result 127.0.0.1 localhost
---error 1143
-select mysqltest.t1.c from test.t1,mysqltest.t1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_hits";
---replace_result $actual1 4
-show status like "Qcache_not_cached";
-
-# Connect without a database
-connect (user4,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,$MASTER_MYSOCK);
-connection user4;
-select "user4";
-show grants;
---error 1046
-select a from t1;
-# The following query is not cached before (different database)
-select * from mysqltest.t1,test.t1;
-# Cache a query with 'no database'
-select a from mysqltest.t1;
-select a from mysqltest.t1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_hits";
---replace_result $actual2 5
-show status like "Qcache_not_cached";
-
-# Cleanup
-
-connection root;
-#
-# A temporary 4.1 workaround to make this test pass if
-# mysql was compiled with other than latin1 --with-charset=XXX.
-# Without "set names binary" the below queries fail with
-# "Illegal mix of collations" error.
-# In 5.0 we will change grant tables to use NCHAR(N) instead
-# of "CHAR(N) BINARY", and use cast-to-nchar: N'mysqltest_1'.
-#
-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");
-delete from mysql.columns_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
-flush privileges;
-drop table test.t1,mysqltest.t1,mysqltest.t2;
-drop database mysqltest;
-
-set GLOBAL query_cache_size=default;
-
---source include/delete_anonymous_users.inc
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/greedy_optimizer.test b/mysql-test/suite/pbxt/t/greedy_optimizer.test
deleted file mode 100644
index b3c05f4b3cd..00000000000
--- a/mysql-test/suite/pbxt/t/greedy_optimizer.test
+++ /dev/null
@@ -1,322 +0,0 @@
-#
-# A simple test of the greedy query optimization algorithm and the switches that
-# control the optimizationprocess.
-#
-
-#
-# Schema
-#
---disable_warnings
-drop table if exists t1,t2,t3,t4,t5,t6,t7;
---enable_warnings
-
-set @save_join_cache_level=@@join_cache_level;
-set join_cache_level=1;
-
-create table t1 (
- c11 integer,c12 integer,c13 integer,c14 integer,c15 integer,c16 integer,
- primary key (c11)
-);
-create table t2 (
- c21 integer,c22 integer,c23 integer,c24 integer,c25 integer,c26 integer
-);
-create table t3 (
- c31 integer,c32 integer,c33 integer,c34 integer,c35 integer,c36 integer,
- primary key (c31)
-);
-create table t4 (
- c41 integer,c42 integer,c43 integer,c44 integer,c45 integer,c46 integer
-);
-create table t5 (
- c51 integer,c52 integer,c53 integer,c54 integer,c55 integer,c56 integer,
- primary key (c51)
-);
-create table t6 (
- c61 integer,c62 integer,c63 integer,c64 integer,c65 integer,c66 integer
-);
-create table t7 (
- c71 integer,c72 integer,c73 integer,c74 integer,c75 integer,c76 integer,
- primary key (c71)
-);
-
-#
-# Data
-# cardinality(Ti) = cardinality(T(i-1)) + 3
-#
-insert into t1 values (1,2,3,4,5,6);
-insert into t1 values (2,2,3,4,5,6);
-insert into t1 values (3,2,3,4,5,6);
-
-insert into t2 values (1,2,3,4,5,6);
-insert into t2 values (2,2,3,4,5,6);
-insert into t2 values (3,2,3,4,5,6);
-insert into t2 values (4,2,3,4,5,6);
-insert into t2 values (5,2,3,4,5,6);
-insert into t2 values (6,2,3,4,5,6);
-
-insert into t3 values (1,2,3,4,5,6);
-insert into t3 values (2,2,3,4,5,6);
-insert into t3 values (3,2,3,4,5,6);
-insert into t3 values (4,2,3,4,5,6);
-insert into t3 values (5,2,3,4,5,6);
-insert into t3 values (6,2,3,4,5,6);
-insert into t3 values (7,2,3,4,5,6);
-insert into t3 values (8,2,3,4,5,6);
-insert into t3 values (9,2,3,4,5,6);
-
-insert into t4 values (1,2,3,4,5,6);
-insert into t4 values (2,2,3,4,5,6);
-insert into t4 values (3,2,3,4,5,6);
-insert into t4 values (4,2,3,4,5,6);
-insert into t4 values (5,2,3,4,5,6);
-insert into t4 values (6,2,3,4,5,6);
-insert into t4 values (7,2,3,4,5,6);
-insert into t4 values (8,2,3,4,5,6);
-insert into t4 values (9,2,3,4,5,6);
-insert into t4 values (10,2,3,4,5,6);
-insert into t4 values (11,2,3,4,5,6);
-insert into t4 values (12,2,3,4,5,6);
-
-insert into t5 values (1,2,3,4,5,6);
-insert into t5 values (2,2,3,4,5,6);
-insert into t5 values (3,2,3,4,5,6);
-insert into t5 values (4,2,3,4,5,6);
-insert into t5 values (5,2,3,4,5,6);
-insert into t5 values (6,2,3,4,5,6);
-insert into t5 values (7,2,3,4,5,6);
-insert into t5 values (8,2,3,4,5,6);
-insert into t5 values (9,2,3,4,5,6);
-insert into t5 values (10,2,3,4,5,6);
-insert into t5 values (11,2,3,4,5,6);
-insert into t5 values (12,2,3,4,5,6);
-insert into t5 values (13,2,3,4,5,6);
-insert into t5 values (14,2,3,4,5,6);
-insert into t5 values (15,2,3,4,5,6);
-
-insert into t6 values (1,2,3,4,5,6);
-insert into t6 values (2,2,3,4,5,6);
-insert into t6 values (3,2,3,4,5,6);
-insert into t6 values (4,2,3,4,5,6);
-insert into t6 values (5,2,3,4,5,6);
-insert into t6 values (6,2,3,4,5,6);
-insert into t6 values (7,2,3,4,5,6);
-insert into t6 values (8,2,3,4,5,6);
-insert into t6 values (9,2,3,4,5,6);
-insert into t6 values (10,2,3,4,5,6);
-insert into t6 values (11,2,3,4,5,6);
-insert into t6 values (12,2,3,4,5,6);
-insert into t6 values (13,2,3,4,5,6);
-insert into t6 values (14,2,3,4,5,6);
-insert into t6 values (15,2,3,4,5,6);
-insert into t6 values (16,2,3,4,5,6);
-insert into t6 values (17,2,3,4,5,6);
-insert into t6 values (18,2,3,4,5,6);
-
-insert into t7 values (1,2,3,4,5,6);
-insert into t7 values (2,2,3,4,5,6);
-insert into t7 values (3,2,3,4,5,6);
-insert into t7 values (4,2,3,4,5,6);
-insert into t7 values (5,2,3,4,5,6);
-insert into t7 values (6,2,3,4,5,6);
-insert into t7 values (7,2,3,4,5,6);
-insert into t7 values (8,2,3,4,5,6);
-insert into t7 values (9,2,3,4,5,6);
-insert into t7 values (10,2,3,4,5,6);
-insert into t7 values (11,2,3,4,5,6);
-insert into t7 values (12,2,3,4,5,6);
-insert into t7 values (13,2,3,4,5,6);
-insert into t7 values (14,2,3,4,5,6);
-insert into t7 values (15,2,3,4,5,6);
-insert into t7 values (16,2,3,4,5,6);
-insert into t7 values (17,2,3,4,5,6);
-insert into t7 values (18,2,3,4,5,6);
-insert into t7 values (19,2,3,4,5,6);
-insert into t7 values (20,2,3,4,5,6);
-insert into t7 values (21,2,3,4,5,6);
-
-#
-# The actual test begins here
-#
-
-# Check the default values for the optimizer paramters
-
-select @@optimizer_search_depth;
-select @@optimizer_prune_level;
-
-# This value swithes back to the old implementation of 'find_best()'
-# set optimizer_search_depth=63; - old (independent of the optimizer_prune_level)
-#
-# These are the values for the parameters that control the greedy optimizer
-# (total 6 combinations - 3 for optimizer_search_depth, 2 for optimizer_prune_level):
-#
-# set optimizer_search_depth=0; - automatic
-# set optimizer_search_depth=1; - min
-# set optimizer_search_depth=62; - max (default)
-#
-# set optimizer_prune_level=0 - exhaustive;
-# set optimizer_prune_level=1 - heuristic; # default
-
-
-#
-# Compile several queries with all combinations of the query
-# optimizer parameters. Each test query has two variants, where
-# in the second variant the tables in the FROM clause are in
-# inverse order to the tables in the first variant.
-# Due to pre-sorting of tables before compilation, there should
-# be no difference in the plans for each two such query variants.
-#
-
-# First, for reference compile the test queries with the 'old' optimization
-# procedure 'find_best'. Notice that 'find_best' does not depend on the
-# choice of heuristic.
-
-set optimizer_search_depth=63;
-select @@optimizer_search_depth;
-
-# 6-table join, chain
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, star
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, clique
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
-
-
-# Test the new optimization procedures
-
-set optimizer_prune_level=0;
-select @@optimizer_prune_level;
-
-set optimizer_search_depth=0;
-select @@optimizer_search_depth;
-
-# 6-table join, chain
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, star
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, clique
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
-
-set optimizer_search_depth=1;
-select @@optimizer_search_depth;
-
-# 6-table join, chain
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, star
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, clique
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
-
-set optimizer_search_depth=62;
-select @@optimizer_search_depth;
-
-# 6-table join, chain
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, star
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, clique
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
-
-
-set optimizer_prune_level=1;
-select @@optimizer_prune_level;
-
-set optimizer_search_depth=0;
-select @@optimizer_search_depth;
-
-# 6-table join, chain
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, star
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, clique
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
-
-set optimizer_search_depth=1;
-select @@optimizer_search_depth;
-
-# 6-table join, chain
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, star
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, clique
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
-
-set optimizer_search_depth=62;
-select @@optimizer_search_depth;
-
-# 6-table join, chain
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, star
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, clique
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
-
-drop table t1,t2,t3,t4,t5,t6,t7;
-
-set join_cache_level=@save_join_cache_level;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/group_by.test b/mysql-test/suite/pbxt/t/group_by.test
deleted file mode 100644
index 76be09cd201..00000000000
--- a/mysql-test/suite/pbxt/t/group_by.test
+++ /dev/null
@@ -1,787 +0,0 @@
-
-# Initialise
---disable_warnings
-drop table if exists t1,t2,t3;
---enable_warnings
-
-#
-# Simple test without tables
-
--- error 1111
-SELECT 1 FROM (SELECT 1) as a GROUP BY SUM(1);
-
-#
-# Test of group (Failed for Lars Hoss <lh@pbm.de>)
-#
-
-CREATE TABLE t1 (
- spID int(10) unsigned,
- userID int(10) unsigned,
- score smallint(5) unsigned,
- lsg char(40),
- date date
-);
-
-INSERT INTO t1 VALUES (1,1,1,'','0000-00-00');
-INSERT INTO t1 VALUES (2,2,2,'','0000-00-00');
-INSERT INTO t1 VALUES (2,1,1,'','0000-00-00');
-INSERT INTO t1 VALUES (3,3,3,'','0000-00-00');
-
-CREATE TABLE t2 (
- userID int(10) unsigned NOT NULL auto_increment,
- niName char(15),
- passwd char(8),
- mail char(50),
- isAukt enum('N','Y') DEFAULT 'N',
- vName char(30),
- nName char(40),
- adr char(60),
- plz char(5),
- ort char(35),
- land char(20),
- PRIMARY KEY (userID)
-);
-
-INSERT INTO t2 VALUES (1,'name','pass','mail','Y','v','n','adr','1','1','1');
-INSERT INTO t2 VALUES (2,'name','pass','mail','Y','v','n','adr','1','1','1');
-INSERT INTO t2 VALUES (3,'name','pass','mail','Y','v','n','adr','1','1','1');
-INSERT INTO t2 VALUES (4,'name','pass','mail','Y','v','n','adr','1','1','1');
-INSERT INTO t2 VALUES (5,'name','pass','mail','Y','v','n','adr','1','1','1');
-
-SELECT t2.userid, MIN(t1.score) FROM t1, t2 WHERE t1.userID=t2.userID GROUP BY t2.userid;
-SELECT t2.userid, MIN(t1.score) FROM t1, t2 WHERE t1.userID=t2.userID GROUP BY t2.userid ORDER BY NULL;
-SELECT t2.userid, MIN(t1.score) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2 GROUP BY t2.userid;
-SELECT t2.userid, MIN(t1.score+0.0) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2 GROUP BY t2.userid;
-SELECT t2.userid, MIN(t1.score+0.0) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2 GROUP BY t2.userid ORDER BY NULL;
-EXPLAIN SELECT t2.userid, MIN(t1.score+0.0) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2 GROUP BY t2.userid ORDER BY NULL;
-drop table t1,t2;
-
-#
-# Bug in GROUP BY, by Nikki Chumakov <nikki@saddam.cityline.ru>
-#
-
-CREATE TABLE t1 (
- PID int(10) unsigned NOT NULL auto_increment,
- payDate date DEFAULT '0000-00-00' NOT NULL,
- recDate datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
- URID int(10) unsigned DEFAULT '0' NOT NULL,
- CRID int(10) unsigned DEFAULT '0' NOT NULL,
- amount int(10) unsigned DEFAULT '0' NOT NULL,
- operator int(10) unsigned,
- method enum('unknown','cash','dealer','check','card','lazy','delayed','test') DEFAULT 'unknown' NOT NULL,
- DIID int(10) unsigned,
- reason char(1) binary DEFAULT '' NOT NULL,
- code_id int(10) unsigned,
- qty mediumint(8) unsigned DEFAULT '0' NOT NULL,
- PRIMARY KEY (PID),
- KEY URID (URID),
- KEY reason (reason),
- KEY method (method),
- KEY payDate (payDate)
-);
-
-INSERT INTO t1 VALUES (1,'1970-01-01','1997-10-17 00:00:00',2529,1,21000,11886,'check',0,'F',16200,6);
-
---error 1056
-SELECT COUNT(P.URID),SUM(P.amount),P.method, MIN(PP.recdate+0) > 19980501000000 AS IsNew FROM t1 AS P JOIN t1 as PP WHERE P.URID = PP.URID GROUP BY method,IsNew;
-
-drop table t1;
-
-#
-# Problem with GROUP BY + ORDER BY when no match
-# Tested with locking
-#
-
-CREATE TABLE t1 (
- cid mediumint(9) NOT NULL auto_increment,
- firstname varchar(32) DEFAULT '' NOT NULL,
- surname varchar(32) DEFAULT '' NOT NULL,
- PRIMARY KEY (cid)
-);
-INSERT INTO t1 VALUES (1,'That','Guy');
-INSERT INTO t1 VALUES (2,'Another','Gent');
-
-CREATE TABLE t2 (
- call_id mediumint(8) NOT NULL auto_increment,
- contact_id mediumint(8) DEFAULT '0' NOT NULL,
- PRIMARY KEY (call_id),
- KEY contact_id (contact_id)
-);
-
-lock tables t1 read,t2 write;
-
-INSERT INTO t2 VALUES (10,2);
-INSERT INTO t2 VALUES (18,2);
-INSERT INTO t2 VALUES (62,2);
-INSERT INTO t2 VALUES (91,2);
-INSERT INTO t2 VALUES (92,2);
-
-SELECT cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid;
-SELECT cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid ORDER BY NULL;
-SELECT HIGH_PRIORITY cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid ORDER BY surname, firstname;
-
-drop table t2;
-unlock tables;
-drop table t1;
-
-#
-# Test of group by bug in bugzilla
-#
-
-CREATE TABLE t1 (
- bug_id mediumint(9) NOT NULL auto_increment,
- groupset bigint(20) DEFAULT '0' NOT NULL,
- assigned_to mediumint(9) DEFAULT '0' NOT NULL,
- bug_file_loc text,
- bug_severity enum('blocker','critical','major','normal','minor','trivial','enhancement') DEFAULT 'blocker' NOT NULL,
- bug_status enum('','NEW','ASSIGNED','REOPENED','RESOLVED','VERIFIED','CLOSED') DEFAULT 'NEW' NOT NULL,
- creation_ts datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
- delta_ts timestamp,
- short_desc mediumtext,
- long_desc mediumtext,
- op_sys enum('All','Windows 3.1','Windows 95','Windows 98','Windows NT','Windows 2000','Linux','other') DEFAULT 'All' NOT NULL,
- priority enum('P1','P2','P3','P4','P5') DEFAULT 'P1' NOT NULL,
- product varchar(64) DEFAULT '' NOT NULL,
- rep_platform enum('All','PC','VTD-8','Other'),
- reporter mediumint(9) DEFAULT '0' NOT NULL,
- version varchar(16) DEFAULT '' NOT NULL,
- component varchar(50) DEFAULT '' NOT NULL,
- resolution enum('','FIXED','INVALID','WONTFIX','LATER','REMIND','DUPLICATE','WORKSFORME') DEFAULT '' NOT NULL,
- target_milestone varchar(20) DEFAULT '' NOT NULL,
- qa_contact mediumint(9) DEFAULT '0' NOT NULL,
- status_whiteboard mediumtext NOT NULL,
- votes mediumint(9) DEFAULT '0' NOT NULL,
- PRIMARY KEY (bug_id),
- KEY assigned_to (assigned_to),
- KEY creation_ts (creation_ts),
- KEY delta_ts (delta_ts),
- KEY bug_severity (bug_severity),
- KEY bug_status (bug_status),
- KEY op_sys (op_sys),
- KEY priority (priority),
- KEY product (product),
- KEY reporter (reporter),
- KEY version (version),
- KEY component (component),
- KEY resolution (resolution),
- KEY target_milestone (target_milestone),
- KEY qa_contact (qa_contact),
- KEY votes (votes)
-);
-
-INSERT INTO t1 VALUES (1,0,0,'','normal','','2000-02-10 09:25:12',20000321114747,'','','Linux','P1','TestProduct','PC',3,'other','TestComponent','','M1',0,'',0);
-INSERT INTO t1 VALUES (9,0,0,'','enhancement','','2000-03-10 11:49:36',20000321114747,'','','All','P5','AAAAA','PC',3,'2.00 CD - Pre','BBBBBBBBBBBBB - conversion','','',0,'',0);
-INSERT INTO t1 VALUES (10,0,0,'','enhancement','','2000-03-10 18:10:16',20000321114747,'','','All','P4','AAAAA','PC',3,'2.00 CD - Pre','BBBBBBBBBBBBB - conversion','','',0,'',0);
-INSERT INTO t1 VALUES (7,0,0,'','critical','','2000-03-09 10:50:21',20000321114747,'','','All','P1','AAAAA','PC',3,'2.00 CD - Pre','BBBBBBBBBBBBB - generic','','',0,'',0);
-INSERT INTO t1 VALUES (6,0,0,'','normal','','2000-03-09 10:42:44',20000321114747,'','','All','P2','AAAAA','PC',3,'2.00 CD - Pre','kkkkkkkkkkk lllllllllll','','',0,'',0);
-INSERT INTO t1 VALUES (8,0,0,'','major','','2000-03-09 11:32:14',20000321114747,'','','All','P3','AAAAA','PC',3,'2.00 CD - Pre','kkkkkkkkkkk lllllllllll','','',0,'',0);
-INSERT INTO t1 VALUES (5,0,0,'','enhancement','','2000-03-09 10:38:59',20000321114747,'','','All','P5','CCC/CCCCCC','PC',5,'7.00','Administration','','',0,'',0);
-INSERT INTO t1 VALUES (4,0,0,'','normal','','2000-03-08 18:32:14',20000321114747,'','','other','P2','TestProduct','Other',3,'other','TestComponent2','','',0,'',0);
-INSERT INTO t1 VALUES (3,0,0,'','normal','','2000-03-08 18:30:52',20000321114747,'','','other','P2','TestProduct','Other',3,'other','TestComponent','','',0,'',0);
-INSERT INTO t1 VALUES (2,0,0,'','enhancement','','2000-03-08 18:24:51',20000321114747,'','','All','P2','TestProduct','Other',4,'other','TestComponent2','','',0,'',0);
-INSERT INTO t1 VALUES (11,0,0,'','blocker','','2000-03-13 09:43:41',20000321114747,'','','All','P2','CCC/CCCCCC','PC',5,'7.00','DDDDDDDDD','','',0,'',0);
-INSERT INTO t1 VALUES (12,0,0,'','normal','','2000-03-13 16:14:31',20000321114747,'','','All','P2','AAAAA','PC',3,'2.00 CD - Pre','kkkkkkkkkkk lllllllllll','','',0,'',0);
-INSERT INTO t1 VALUES (13,0,0,'','normal','','2000-03-15 16:20:44',20000321114747,'','','other','P2','TestProduct','Other',3,'other','TestComponent','','',0,'',0);
-INSERT INTO t1 VALUES (14,0,0,'','blocker','','2000-03-15 18:13:47',20000321114747,'','','All','P1','AAAAA','PC',3,'2.00 CD - Pre','BBBBBBBBBBBBB - generic','','',0,'',0);
-INSERT INTO t1 VALUES (15,0,0,'','minor','','2000-03-16 18:03:28',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','DDDDDDDDD','','',0,'',0);
-INSERT INTO t1 VALUES (16,0,0,'','normal','','2000-03-16 18:33:41',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','Administration','','',0,'',0);
-INSERT INTO t1 VALUES (17,0,0,'','normal','','2000-03-16 18:34:18',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','Administration','','',0,'',0);
-INSERT INTO t1 VALUES (18,0,0,'','normal','','2000-03-16 18:34:56',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','Administration','','',0,'',0);
-INSERT INTO t1 VALUES (19,0,0,'','enhancement','','2000-03-16 18:35:34',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','Administration','','',0,'',0);
-INSERT INTO t1 VALUES (20,0,0,'','enhancement','','2000-03-16 18:36:23',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','Administration','','',0,'',0);
-INSERT INTO t1 VALUES (21,0,0,'','enhancement','','2000-03-16 18:37:23',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','Administration','','',0,'',0);
-INSERT INTO t1 VALUES (22,0,0,'','enhancement','','2000-03-16 18:38:16',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','Administration','','',0,'',0);
-INSERT INTO t1 VALUES (23,0,0,'','normal','','2000-03-16 18:58:12',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','DDDDDDDDD','','',0,'',0);
-INSERT INTO t1 VALUES (24,0,0,'','normal','','2000-03-17 11:08:10',20000321114747,'','','All','P2','AAAAAAAA-AAA','PC',3,'2.8','Web Interface','','',0,'',0);
-INSERT INTO t1 VALUES (25,0,0,'','normal','','2000-03-17 11:10:45',20000321114747,'','','All','P2','AAAAAAAA-AAA','PC',3,'2.8','Web Interface','','',0,'',0);
-INSERT INTO t1 VALUES (26,0,0,'','normal','','2000-03-17 11:15:47',20000321114747,'','','All','P2','AAAAAAAA-AAA','PC',3,'2.8','Web Interface','','',0,'',0);
-INSERT INTO t1 VALUES (27,0,0,'','normal','','2000-03-17 17:45:41',20000321114747,'','','All','P2','CCC/CCCCCC','PC',5,'7.00','DDDDDDDDD','','',0,'',0);
-INSERT INTO t1 VALUES (28,0,0,'','normal','','2000-03-20 09:51:45',20000321114747,'','','Windows NT','P2','TestProduct','PC',8,'other','TestComponent','','',0,'',0);
-INSERT INTO t1 VALUES (29,0,0,'','normal','','2000-03-20 11:15:09',20000321114747,'','','All','P5','AAAAAAAA-AAA','PC',3,'2.8','Web Interface','','',0,'',0);
-CREATE TABLE t2 (
- value tinytext,
- program varchar(64),
- initialowner tinytext NOT NULL,
- initialqacontact tinytext NOT NULL,
- description mediumtext NOT NULL
-);
-
-INSERT INTO t2 VALUES ('TestComponent','TestProduct','id0001','','');
-INSERT INTO t2 VALUES ('BBBBBBBBBBBBB - conversion','AAAAA','id0001','','');
-INSERT INTO t2 VALUES ('BBBBBBBBBBBBB - generic','AAAAA','id0001','','');
-INSERT INTO t2 VALUES ('TestComponent2','TestProduct','id0001','','');
-INSERT INTO t2 VALUES ('BBBBBBBBBBBBB - eeeeeeeee','AAAAA','id0001','','');
-INSERT INTO t2 VALUES ('kkkkkkkkkkk lllllllllll','AAAAA','id0001','','');
-INSERT INTO t2 VALUES ('Test Procedures','AAAAA','id0001','','');
-INSERT INTO t2 VALUES ('Documentation','AAAAA','id0003','','');
-INSERT INTO t2 VALUES ('DDDDDDDDD','CCC/CCCCCC','id0002','','');
-INSERT INTO t2 VALUES ('Eeeeeeee Lite','CCC/CCCCCC','id0002','','');
-INSERT INTO t2 VALUES ('Eeeeeeee Full','CCC/CCCCCC','id0002','','');
-INSERT INTO t2 VALUES ('Administration','CCC/CCCCCC','id0002','','');
-INSERT INTO t2 VALUES ('Distribution','CCC/CCCCCC','id0002','','');
-INSERT INTO t2 VALUES ('Setup','CCC/CCCCCC','id0002','','');
-INSERT INTO t2 VALUES ('Unspecified','CCC/CCCCCC','id0002','','');
-INSERT INTO t2 VALUES ('Web Interface','AAAAAAAA-AAA','id0001','','');
-INSERT INTO t2 VALUES ('Host communication','AAAAA','id0001','','');
-select value,description,bug_id from t2 left join t1 on t2.program=t1.product and t2.value=t1.component where program="AAAAA";
-select value,description,COUNT(bug_id) from t2 left join t1 on t2.program=t1.product and t2.value=t1.component where program="AAAAA" group by value;
-select value,description,COUNT(bug_id) from t2 left join t1 on t2.program=t1.product and t2.value=t1.component where program="AAAAA" group by value having COUNT(bug_id) IN (0,2);
-
-drop table t1,t2;
-
-#
-# Problem with functions and group functions when no matching rows
-#
-
-create table t1 (foo int);
-insert into t1 values (1);
-select 1+1, "a",count(*) from t1 where foo in (2);
-insert into t1 values (1);
-select 1+1,"a",count(*) from t1 where foo in (2);
-drop table t1;
-
-#
-# Test GROUP BY DESC
-
-CREATE TABLE t1 (
- spID int(10) unsigned,
- userID int(10) unsigned,
- score smallint(5) unsigned,
- key (spid),
- key (score)
-);
-
-INSERT INTO t1 VALUES (1,1,1),(2,2,2),(2,1,1),(3,3,3),(4,3,3),(5,3,3),(6,3,3),(7,3,3);
-explain select userid,count(*) from t1 group by userid desc;
-explain select userid,count(*) from t1 group by userid desc order by null;
-select userid,count(*) from t1 group by userid desc;
-select userid,count(*) from t1 group by userid desc having (count(*)+1) IN (4,3);
-select userid,count(*) from t1 group by userid desc having 3 IN (1,COUNT(*));
-explain select spid,count(*) from t1 where spid between 1 and 2 group by spid desc;
-explain select spid,count(*) from t1 where spid between 1 and 2 group by spid;
-explain select spid,count(*) from t1 where spid between 1 and 2 group by spid order by null;
-select spid,count(*) from t1 where spid between 1 and 2 group by spid;
-select spid,count(*) from t1 where spid between 1 and 2 group by spid desc;
-explain extended select sql_big_result spid,sum(userid) from t1 group by spid desc;
-explain select sql_big_result spid,sum(userid) from t1 group by spid desc order by null;
-select sql_big_result spid,sum(userid) from t1 group by spid desc;
-explain select sql_big_result score,count(*) from t1 group by score desc;
-explain select sql_big_result score,count(*) from t1 group by score desc order by null;
-select sql_big_result score,count(*) from t1 group by score desc;
-drop table t1;
-
-# not purely group_by bug, but group_by is involved...
-
-create table t1 (a date default null, b date default null);
-insert t1 values ('1999-10-01','2000-01-10'), ('1997-01-01','1998-10-01');
-select a,min(b) c,count(distinct rand()) from t1 group by a having c<a + interval 1 day;
-drop table t1;
-
-# Compare with hash keys
-
-CREATE TABLE t1 (a char(1));
-INSERT INTO t1 VALUES ('A'),('B'),('A'),('B'),('A'),('B'),(NULL),('a'),('b'),(NULL),('A'),('B'),(NULL);
-SELECT a FROM t1 GROUP BY a;
-SELECT a,count(*) FROM t1 GROUP BY a;
-SELECT a FROM t1 GROUP BY binary a;
-SELECT a,count(*) FROM t1 GROUP BY binary a;
-SELECT binary a FROM t1 GROUP BY 1;
-SELECT binary a,count(*) FROM t1 GROUP BY 1;
-# Do the same tests with MyISAM temporary tables
-SET SQL_BIG_TABLES=1;
-SELECT a FROM t1 GROUP BY a;
-SELECT a,count(*) FROM t1 GROUP BY a;
-SELECT a FROM t1 GROUP BY binary a;
-SELECT a,count(*) FROM t1 GROUP BY binary a;
-SELECT binary a FROM t1 GROUP BY 1;
-SELECT binary a,count(*) FROM t1 GROUP BY 1;
-SET SQL_BIG_TABLES=0;
-drop table t1;
-
-#
-# Test of key >= 256 bytes
-#
-
-CREATE TABLE t1 (
- `a` char(193) default NULL,
- `b` char(63) default NULL
-);
-INSERT INTO t1 VALUES ('abc','def'),('hij','klm');
-SELECT CONCAT(a, b) FROM t1 GROUP BY 1;
-SELECT CONCAT(a, b),count(*) FROM t1 GROUP BY 1;
-SELECT CONCAT(a, b),count(distinct a) FROM t1 GROUP BY 1;
-SELECT 1 FROM t1 GROUP BY CONCAT(a, b);
-INSERT INTO t1 values ('hij','klm');
-SELECT CONCAT(a, b),count(*) FROM t1 GROUP BY 1;
-DROP TABLE t1;
-
-#
-# Test problem with ORDER BY on a SUM() column
-#
-
-create table t1 (One int unsigned, Two int unsigned, Three int unsigned, Four int unsigned);
-insert into t1 values (1,2,1,4),(1,2,2,4),(1,2,3,4),(1,2,4,4),(1,1,1,4),(1,1,2,4),(1,1,3,4),(1,1,4,4),(1,3,1,4),(1,3,2,4),(1,3,3,4),(1,3,4,4);
-select One, Two, sum(Four) from t1 group by One,Two;
-drop table t1;
-
-create table t1 (id integer primary key not null auto_increment, gender char(1));
-insert into t1 values (NULL, 'M'), (NULL, 'F'),(NULL, 'F'),(NULL, 'F'),(NULL, 'M');
-create table t2 (user_id integer not null, date date);
-insert into t2 values (1, '2002-06-09'),(2, '2002-06-09'),(1, '2002-06-09'),(3, '2002-06-09'),(4, '2002-06-09'),(4, '2002-06-09');
-select u.gender as gender, count(distinct u.id) as dist_count, (count(distinct u.id)/5*100) as percentage from t1 u, t2 l where l.user_id = u.id group by u.gender;
-select u.gender as gender, count(distinct u.id) as dist_count, (count(distinct u.id)/5*100) as percentage from t1 u, t2 l where l.user_id = u.id group by u.gender order by percentage;
-drop table t1,t2;
-
-#
-# The GROUP BY returned rows in wrong order in 3.23.51
-#
-
-CREATE TABLE t1 (ID1 int, ID2 int, ID int NOT NULL AUTO_INCREMENT,PRIMARY KEY(ID
-));
-insert into t1 values (1,244,NULL),(2,243,NULL),(134,223,NULL),(185,186,NULL);
-SET @save_optimizer_switch=@@optimizer_switch;
-SET optimizer_switch='outer_join_with_cache=off';
-select S.ID as xID, S.ID1 as xID1 from t1 as S left join t1 as yS on S.ID1 between yS.ID1 and yS.ID2;
-select S.ID as xID, S.ID1 as xID1, repeat('*',count(distinct yS.ID)) as Level from t1 as S left join t1 as yS on S.ID1 between yS.ID1 and yS.ID2 group by xID order by xID1;
-SET optimizer_switch=@save_optimizer_switch;
-drop table t1;
-
-#
-# Problem with MAX and LEFT JOIN
-#
-
-CREATE TABLE t1 (
- pid int(11) unsigned NOT NULL default '0',
- c1id int(11) unsigned default NULL,
- c2id int(11) unsigned default NULL,
- value int(11) unsigned NOT NULL default '0',
- UNIQUE KEY pid2 (pid,c1id,c2id),
- UNIQUE KEY pid (pid,value)
-) ENGINE=MyISAM;
-
-INSERT INTO t1 VALUES (1, 1, NULL, 1),(1, 2, NULL, 2),(1, NULL, 3, 3),(1, 4, NULL, 4),(1, 5, NULL, 5);
-
-CREATE TABLE t2 (
- id int(11) unsigned NOT NULL default '0',
- active enum('Yes','No') NOT NULL default 'Yes',
- PRIMARY KEY (id)
-) ENGINE=MyISAM;
-
-INSERT INTO t2 VALUES (1, 'Yes'),(2, 'No'),(4, 'Yes'),(5, 'No');
-
-CREATE TABLE t3 (
- id int(11) unsigned NOT NULL default '0',
- active enum('Yes','No') NOT NULL default 'Yes',
- PRIMARY KEY (id)
-);
-INSERT INTO t3 VALUES (3, 'Yes');
-
-select * from t1 AS m LEFT JOIN t2 AS c1 ON m.c1id =
-c1.id AND c1.active = 'Yes' LEFT JOIN t3 AS c2 ON m.c2id = c2.id AND
-c2.active = 'Yes' WHERE m.pid=1 AND (c1.id IS NOT NULL OR c2.id IS NOT NULL);
-select max(value) from t1 AS m LEFT JOIN t2 AS c1 ON
-m.c1id = c1.id AND c1.active = 'Yes' LEFT JOIN t3 AS c2 ON m.c2id =
-c2.id AND c2.active = 'Yes' WHERE m.pid=1 AND (c1.id IS NOT NULL OR c2.id IS
-NOT NULL);
-drop table t1,t2,t3;
-
-#
-# Test bug in GROUP BY on BLOB that is NULL or empty
-#
-
-create table t1 (a blob null);
-insert into t1 values (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(""),(""),(""),("b");
-select a,count(*) from t1 group by a;
-set option sql_big_tables=1;
-select a,count(*) from t1 group by a;
-drop table t1;
-
-#
-# Test of GROUP BY ... ORDER BY NULL optimization
-#
-
-create table t1 (a int not null, b int not null);
-insert into t1 values (1,1),(1,2),(3,1),(3,2),(2,2),(2,1);
-create table t2 (a int not null, b int not null, key(a));
-insert into t2 values (1,3),(3,1),(2,2),(1,1);
-select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b;
-select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b ORDER BY NULL;
-explain select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b;
-explain select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b ORDER BY NULL;
-drop table t1,t2;
-
-#
-# group function arguments in some functions
-#
-
-create table t1 (a int, b int);
-insert into t1 values (1, 4),(10, 40),(1, 4),(10, 43),(1, 4),(10, 41),(1, 4),(10, 43),(1, 4);
-select a, MAX(b), INTERVAL (MAX(b), 1,3,10,30,39,40,50,60,100,1000) from t1 group by a;
-select a, MAX(b), CASE MAX(b) when 4 then 4 when 43 then 43 else 0 end from t1 group by a;
-select a, MAX(b), FIELD(MAX(b), '43', '4', '5') from t1 group by a;
-select a, MAX(b), CONCAT_WS(MAX(b), '43', '4', '5') from t1 group by a;
-select a, MAX(b), ELT(MAX(b), 'a', 'b', 'c', 'd', 'e', 'f') from t1 group by a;
-select a, MAX(b), MAKE_SET(MAX(b), 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h') from t1 group by a;
-drop table t1;
-
-#
-# Problem with group by and alias
-#
-
-create table t1 (id int not null, qty int not null);
-insert into t1 values (1,2),(1,3),(2,4),(2,5);
-select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sum(qty)>2 and cqty>1;
-select id, sum(qty) as sqty from t1 group by id having sqty>2 and count(qty)>1;
-select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sqty>2 and cqty>1;
-select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sum(qty)>2 and count(qty)>1;
-select count(*), case interval(qty,2,3,4,5,6,7,8) when -1 then NULL when 0 then "zero" when 1 then "one" when 2 then "two" end as category from t1 group by category;
-select count(*), interval(qty,2,3,4,5,6,7,8) as category from t1 group by category;
-drop table t1;
-#
-# Tests for bug #1355: 'Using filesort' is missing in EXPLAIN when ORDER BY
-# NULL is used.
-#
-CREATE TABLE t1 (
- userid int(10) unsigned,
- score smallint(5) unsigned,
- key (score)
-);
-INSERT INTO t1 VALUES (1,1),(2,2),(1,1),(3,3),(3,3),(3,3),(3,3),(3,3);
-# Here we select unordered GROUP BY into a temporary talbe,
-# and then sort it with filesort (GROUP BY in MySQL
-# implies sorted order of results)
-SELECT userid,count(*) FROM t1 GROUP BY userid DESC;
-EXPLAIN SELECT userid,count(*) FROM t1 GROUP BY userid DESC;
-DROP TABLE t1;
-CREATE TABLE t1 (
- i int(11) default NULL,
- j int(11) default NULL
-);
-INSERT INTO t1 VALUES (1,2),(2,3),(4,5),(3,5),(1,5),(23,5);
-SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL;
-explain SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL;
-DROP TABLE t1;
-
-#Test for BUG#6976: Aggregate functions have incorrect NULL-ness
-create table t1 (a int);
-insert into t1 values(null);
-select min(a) is null from t1;
-select min(a) is null or null from t1;
-select 1 and min(a) is null from t1;
-drop table t1;
-
-# Test for BUG#5400: GROUP_CONCAT returns everything twice.
-create table t1 ( col1 int, col2 int );
-insert into t1 values (1,1),(1,2),(1,3),(2,1),(2,2);
-select group_concat( distinct col1 ) as alias from t1
- group by col2 having alias like '%';
-
-drop table t1;
-
-#
-# Test BUG#8216 when referring in HAVING to n alias which is rand() function
-#
-
-create table t1 (a integer, b integer, c integer);
-insert into t1 (a,b) values (1,2),(1,3),(2,5);
-select a, 0.1*0+1 r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2=1;
-# rand(100)*10 will be < 2 only for the first row (of 6)
-select a, round(rand(100)*10) r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2<=2;
-select a,sum(b) from t1 where a=1 group by c;
-select a*sum(b) from t1 where a=1 group by c;
-select sum(a)*sum(b) from t1 where a=1 group by c;
-select a,sum(b) from t1 where a=1 group by c having a=1;
-select a as d,sum(b) from t1 where a=1 group by c having d=1;
-select sum(a)*sum(b) as d from t1 where a=1 group by c having d > 0;
-drop table t1;
-
-# Test for BUG#9213 GROUP BY query on utf-8 key returns wrong results
-create table t1(a int);
-insert into t1 values (0),(1),(2),(3),(4),(5),(6),(8),(9);
-create table t2 (
- a int,
- b varchar(200) NOT NULL,
- c varchar(50) NOT NULL,
- d varchar(100) NOT NULL,
- primary key (a,b(132),c,d),
- key a (a,b)
-) charset=utf8;
-
-insert into t2 select
- x3.a, -- 3
- concat('val-', x3.a + 3*x4.a), -- 12
- concat('val-', @a:=x3.a + 3*x4.a + 12*C.a), -- 120
- concat('val-', @a + 120*D.a)
-from t1 x3, t1 x4, t1 C, t1 D where x3.a < 3 and x4.a < 4 and D.a < 4;
-
-delete from t2 where a = 2 and b = 'val-2' order by a,b,c,d limit 30;
-# PBXT: row count may vary
---replace_column 9 #
-explain select c from t2 where a = 2 and b = 'val-2' group by c;
-select c from t2 where a = 2 and b = 'val-2' group by c;
-drop table t1,t2;
-
-# Test for BUG#9298 "Wrong handling of int4 unsigned columns in GROUP functions"
-# (the actual problem was with protocol code, not GROUP BY)
-create table t1 (b int4 unsigned not null);
-insert into t1 values(3000000000);
-select * from t1;
-select min(b) from t1;
-drop table t1;
-
-#
-# Test for bug #11088: GROUP BY a BLOB column with COUNT(DISTINCT column1)
-#
-
-CREATE TABLE t1 (id int PRIMARY KEY, user_id int, hostname longtext);
-
-INSERT INTO t1 VALUES
- (1, 7, 'cache-dtc-af05.proxy.aol.com'),
- (2, 3, 'what.ever.com'),
- (3, 7, 'cache-dtc-af05.proxy.aol.com'),
- (4, 7, 'cache-dtc-af05.proxy.aol.com');
-
-SELECT hostname, COUNT(DISTINCT user_id) as no FROM t1
- WHERE hostname LIKE '%aol%'
- GROUP BY hostname;
-
-DROP TABLE t1;
-
-#
-# Test for bug #8614: GROUP BY 'const' with DISTINCT
-#
-
-CREATE TABLE t1 (a int, b int);
-INSERT INTO t1 VALUES (1,2), (1,3);
-SELECT a, b FROM t1 GROUP BY 'const';
-SELECT DISTINCT a, b FROM t1 GROUP BY 'const';
-
-DROP TABLE t1;
-
-#
-# Test for bug #11385: GROUP BY for datetime converted to decimals
-#
-
-CREATE TABLE t1 (id INT, dt DATETIME);
-INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
-INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
-INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
-INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
-SELECT dt DIV 1 AS f, id FROM t1 GROUP BY f;
-
-DROP TABLE t1;
-
-#
-# Test for bug #11295: GROUP BY a BLOB column with COUNT(DISTINCT column1)
-# when the BLOB column takes NULL values
-#
-
-CREATE TABLE t1 (id varchar(20) NOT NULL);
-INSERT INTO t1 VALUES ('trans1'), ('trans2');
-CREATE TABLE t2 (id varchar(20) NOT NULL, err_comment blob NOT NULL);
-INSERT INTO t2 VALUES ('trans1', 'a problem');
-SELECT COUNT(DISTINCT(t1.id)), LEFT(err_comment, 256) AS comment
- FROM t1 LEFT JOIN t2 ON t1.id=t2.id GROUP BY comment;
-
-DROP TABLE t1, t2;
-
-#
-# Bug #12266 GROUP BY expression on DATE column produces result with
-# reduced length
-#
-create table t1 (f1 date);
-insert into t1 values('2005-06-06');
-insert into t1 values('2005-06-06');
-select date(left(f1+0,8)) from t1 group by 1;
-drop table t1;
-
-#
-# Test for bug #11414: crash on Windows for a simple GROUP BY query
-#
-
-CREATE TABLE t1 (n int);
-INSERT INTO t1 VALUES (1);
-SELECT n+1 AS n FROM t1 GROUP BY n;
-DROP TABLE t1;
-
-#
-# BUG#12695: Item_func_isnull::update_used_tables
-# did not update const_item_cache
-#
-create table t1(f1 varchar(5) key);
-insert into t1 values (1),(2);
-select sql_buffer_result max(f1) is null from t1;
-select sql_buffer_result max(f1)+1 from t1;
-drop table t1;
-
-#
-# BUG#14019-4.1-opt
-#
-CREATE TABLE t1(a INT); INSERT INTO t1 VALUES (1),(2);
-
-SELECT a FROM t1 GROUP BY 'a';
-SELECT a FROM t1 GROUP BY "a";
-SELECT a FROM t1 GROUP BY `a`;
-
-set sql_mode=ANSI_QUOTES;
-SELECT a FROM t1 GROUP BY "a";
-SELECT a FROM t1 GROUP BY 'a';
-SELECT a FROM t1 GROUP BY `a`;
-set sql_mode='';
-
-SELECT a FROM t1 HAVING 'a' > 1;
-SELECT a FROM t1 HAVING "a" > 1;
-SELECT a FROM t1 HAVING `a` > 1;
-
-SELECT a FROM t1 ORDER BY 'a' DESC;
-SELECT a FROM t1 ORDER BY "a" DESC;
-SELECT a FROM t1 ORDER BY `a` DESC;
-DROP TABLE t1;
-
-# End of 4.1 tests
-
-#
-# Bug#11211: Ambiguous column reference in GROUP BY.
-#
-
-create table t1 (c1 char(3), c2 char(3));
-create table t2 (c3 char(3), c4 char(3));
-insert into t1 values ('aaa', 'bb1'), ('aaa', 'bb2');
-insert into t2 values ('aaa', 'bb1'), ('aaa', 'bb2');
-
-# query with ambiguous column reference 'c2'
-select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4
-group by c2;
-show warnings;
-
-# this query has no ambiguity
-select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4
-group by t1.c1;
-
-show warnings;
-drop table t1, t2;
-
-#
-# Bug #20466: a view is mixing data when there's a trigger on the table
-#
-CREATE TABLE t1 (a tinyint(3), b varchar(255), PRIMARY KEY (a));
-
-INSERT INTO t1 VALUES (1,'-----'), (6,'Allemagne'), (17,'Autriche'),
- (25,'Belgique'), (54,'Danemark'), (62,'Espagne'), (68,'France');
-
-CREATE TABLE t2 (a tinyint(3), b tinyint(3), PRIMARY KEY (a), KEY b (b));
-
-INSERT INTO t2 VALUES (1,1), (2,1), (6,6), (18,17), (15,25), (16,25),
- (17,25), (10,54), (5,62),(3,68);
-
-CREATE VIEW v1 AS select t1.a, concat(t1.b,'') AS b, t1.b as real_b from t1;
-
-explain
-SELECT straight_join sql_no_cache v1.a, v1.b, v1.real_b from t2, v1
-where t2.b=v1.a GROUP BY t2.b;
-SELECT straight_join sql_no_cache v1.a, v1.b, v1.real_b from t2, v1
-where t2.b=v1.a GROUP BY t2.b;
-
-DROP VIEW v1;
-DROP TABLE t1,t2;
-
-#
-# Bug#22781: SQL_BIG_RESULT fails to influence sort plan
-#
-CREATE TABLE t1 (a INT PRIMARY KEY, b INT, key (b));
-
-INSERT INTO t1 VALUES (1, 1);
-INSERT INTO t1 SELECT a + 1 , MOD(a + 1 , 20) FROM t1;
-INSERT INTO t1 SELECT a + 2 , MOD(a + 2 , 20) FROM t1;
-INSERT INTO t1 SELECT a + 4 , MOD(a + 4 , 20) FROM t1;
-INSERT INTO t1 SELECT a + 8 , MOD(a + 8 , 20) FROM t1;
-INSERT INTO t1 SELECT a + 16, MOD(a + 16, 20) FROM t1;
-INSERT INTO t1 SELECT a + 32, MOD(a + 32, 20) FROM t1;
-INSERT INTO t1 SELECT a + 64, MOD(a + 64, 20) FROM t1;
-
-SELECT MIN(b), MAX(b) from t1;
-
-EXPLAIN SELECT b, sum(1) FROM t1 GROUP BY b;
-EXPLAIN SELECT SQL_BIG_RESULT b, sum(1) FROM t1 GROUP BY b;
-SELECT b, sum(1) FROM t1 GROUP BY b;
-SELECT SQL_BIG_RESULT b, sum(1) FROM t1 GROUP BY b;
-DROP TABLE t1;
-
-#
-# Bug #21174: Index degrades sort performance and
-# optimizer does not honor IGNORE INDEX.
-# a.k.a WL3527.
-#
-CREATE TABLE t1 (a INT, b INT,
- PRIMARY KEY (a),
- KEY i2(a,b));
-INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8);
-INSERT INTO t1 SELECT a + 8,b FROM t1;
-INSERT INTO t1 SELECT a + 16,b FROM t1;
-INSERT INTO t1 SELECT a + 32,b FROM t1;
-INSERT INTO t1 SELECT a + 64,b FROM t1;
-INSERT INTO t1 SELECT a + 128,b FROM t1 limit 16;
-ANALYZE TABLE t1;
-EXPLAIN SELECT a FROM t1 WHERE a < 2;
-EXPLAIN SELECT a FROM t1 WHERE a < 2 ORDER BY a;
-EXPLAIN SELECT a FROM t1 WHERE a < 2 GROUP BY a;
-EXPLAIN SELECT a FROM t1 IGNORE INDEX (PRIMARY,i2);
-EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR JOIN (PRIMARY,i2);
-EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR GROUP BY (PRIMARY,i2) GROUP BY a;
-EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY,i2) ORDER BY a;
-SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY,i2) ORDER BY a;
-EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY)
- IGNORE INDEX FOR GROUP BY (i2) GROUP BY a;
-EXPLAIN SELECT a FROM t1 IGNORE INDEX (PRIMARY) IGNORE INDEX FOR ORDER BY (i2);
-EXPLAIN SELECT a FROM t1 FORCE INDEX (i2);
-EXPLAIN SELECT a FROM t1 USE INDEX ();
-EXPLAIN SELECT a FROM t1 USE INDEX () USE INDEX (i2);
---error ER_WRONG_USAGE
-EXPLAIN SELECT a FROM t1
- FORCE INDEX (PRIMARY)
- IGNORE INDEX FOR GROUP BY (i2)
- IGNORE INDEX FOR ORDER BY (i2)
- USE INDEX (i2);
-EXPLAIN SELECT a FROM t1 USE INDEX (i2) USE INDEX ();
---error ER_PARSE_ERROR
-EXPLAIN SELECT a FROM t1 FORCE INDEX ();
---error ER_PARSE_ERROR
-EXPLAIN SELECT a FROM t1 IGNORE INDEX ();
-# disable the columns irrelevant to this test here. On some systems
-# without support for large files the rowid is shorter and its size affects
-# the cost calculations. This causes the optimizer to choose loose index
-# scan over normal index access.
---replace_column 4 # 7 # 9 # 10 #
-EXPLAIN SELECT a FROM t1 USE INDEX FOR JOIN (i2)
- USE INDEX FOR GROUP BY (i2) GROUP BY a;
-EXPLAIN SELECT a FROM t1 FORCE INDEX FOR JOIN (i2)
- FORCE INDEX FOR GROUP BY (i2) GROUP BY a;
-EXPLAIN SELECT a FROM t1 USE INDEX () IGNORE INDEX (i2);
-EXPLAIN SELECT a FROM t1 IGNORE INDEX (i2) USE INDEX ();
-
-EXPLAIN SELECT a FROM t1
- USE INDEX FOR GROUP BY (i2)
- USE INDEX FOR ORDER BY (i2)
- USE INDEX FOR JOIN (i2);
-
-EXPLAIN SELECT a FROM t1
- USE INDEX FOR JOIN (i2)
- USE INDEX FOR JOIN (i2)
- USE INDEX FOR JOIN (i2,i2);
-
-EXPLAIN SELECT 1 FROM t1 WHERE a IN
- (SELECT a FROM t1 USE INDEX (i2) IGNORE INDEX (i2));
-
-CREATE TABLE t2 (a INT, b INT, KEY(a));
-INSERT INTO t2 VALUES (1, 1), (2, 2), (3,3), (4,4);
-EXPLAIN SELECT a, SUM(b) FROM t2 GROUP BY a LIMIT 2;
-EXPLAIN SELECT a, SUM(b) FROM t2 IGNORE INDEX (a) GROUP BY a LIMIT 2;
-
-EXPLAIN SELECT 1 FROM t2 WHERE a IN
- (SELECT a FROM t1 USE INDEX (i2) IGNORE INDEX (i2));
-
-DROP TABLE t1, t2;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/group_min_max.test b/mysql-test/suite/pbxt/t/group_min_max.test
deleted file mode 100644
index 3241e23a903..00000000000
--- a/mysql-test/suite/pbxt/t/group_min_max.test
+++ /dev/null
@@ -1,948 +0,0 @@
-#
-# Test file for WL#1724 (Min/Max Optimization for Queries with Group By Clause).
-# The queries in this file test query execution via QUICK_GROUP_MIN_MAX_SELECT.
-#
-
-#
-# TODO:
-# Add queries with:
-# - C != const
-# - C IS NOT NULL
-# - HAVING clause
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (
- a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(64) default ' '
-);
-
-insert into t1 (a1, a2, b, c, d) values
-('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'),
-('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'),
-('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'),
-('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'),
-('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'),
-('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'),
-('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'),
-('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'),
-('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'),
-('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'),
-('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'),
-('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4'),
-('d','a','a','a411','xy1'),('d','a','a','b411','xy2'),('d','a','a','c411','xy3'),('d','a','a','d411','xy4'),
-('d','a','b','e412','xy1'),('d','a','b','f412','xy2'),('d','a','b','g412','xy3'),('d','a','b','h412','xy4'),
-('d','b','a','i421','xy1'),('d','b','a','j421','xy2'),('d','b','a','k421','xy3'),('d','b','a','l421','xy4'),
-('d','b','b','m422','xy1'),('d','b','b','n422','xy2'),('d','b','b','o422','xy3'),('d','b','b','p422','xy4'),
-('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'),
-('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'),
-('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'),
-('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'),
-('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'),
-('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'),
-('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'),
-('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'),
-('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'),
-('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'),
-('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'),
-('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4'),
-('d','a','a','a411','xy1'),('d','a','a','b411','xy2'),('d','a','a','c411','xy3'),('d','a','a','d411','xy4'),
-('d','a','b','e412','xy1'),('d','a','b','f412','xy2'),('d','a','b','g412','xy3'),('d','a','b','h412','xy4'),
-('d','b','a','i421','xy1'),('d','b','a','j421','xy2'),('d','b','a','k421','xy3'),('d','b','a','l421','xy4'),
-('d','b','b','m422','xy1'),('d','b','b','n422','xy2'),('d','b','b','o422','xy3'),('d','b','b','p422','xy4');
-
-create index idx_t1_0 on t1 (a1);
-create index idx_t1_1 on t1 (a1,a2,b,c);
-create index idx_t1_2 on t1 (a1,a2,b);
-analyze table t1;
-
-# t2 is the same as t1, but with some NULLs in the MIN/MAX column, and
-# one more nullable attribute
-
---disable_warnings
-drop table if exists t2;
---enable_warnings
-
-create table t2 (
- a1 char(64), a2 char(64) not null, b char(16), c char(16), d char(16), dummy char(64) default ' '
-);
-insert into t2 select * from t1;
-# add few rows with NULL's in the MIN/MAX column
-insert into t2 (a1, a2, b, c, d) values
-('a','a',NULL,'a777','xyz'),('a','a',NULL,'a888','xyz'),('a','a',NULL,'a999','xyz'),
-('a','a','a',NULL,'xyz'),
-('a','a','b',NULL,'xyz'),
-('a','b','a',NULL,'xyz'),
-('c','a',NULL,'c777','xyz'),('c','a',NULL,'c888','xyz'),('c','a',NULL,'c999','xyz'),
-('d','b','b',NULL,'xyz'),
-('e','a','a',NULL,'xyz'),('e','a','a',NULL,'xyz'),('e','a','a',NULL,'xyz'),('e','a','a',NULL,'xyz'),
-('e','a','b',NULL,'xyz'),('e','a','b',NULL,'xyz'),('e','a','b',NULL,'xyz'),('e','a','b',NULL,'xyz'),
-('a','a',NULL,'a777','xyz'),('a','a',NULL,'a888','xyz'),('a','a',NULL,'a999','xyz'),
-('a','a','a',NULL,'xyz'),
-('a','a','b',NULL,'xyz'),
-('a','b','a',NULL,'xyz'),
-('c','a',NULL,'c777','xyz'),('c','a',NULL,'c888','xyz'),('c','a',NULL,'c999','xyz'),
-('d','b','b',NULL,'xyz'),
-('e','a','a',NULL,'xyz'),('e','a','a',NULL,'xyz'),('e','a','a',NULL,'xyz'),('e','a','a',NULL,'xyz'),
-('e','a','b',NULL,'xyz'),('e','a','b',NULL,'xyz'),('e','a','b',NULL,'xyz'),('e','a','b',NULL,'xyz');
-
-create index idx_t2_0 on t2 (a1);
-create index idx_t2_1 on t2 (a1,a2,b,c);
-create index idx_t2_2 on t2 (a1,a2,b);
-analyze table t2;
-
-# Table t3 is the same as t1, but with smaller column lenghts.
-# This allows to test different branches of the cost computation procedure
-# when the number of keys per block are less than the number of keys in the
-# sub-groups formed by predicates over non-group attributes.
-
---disable_warnings
-drop table if exists t3;
---enable_warnings
-
-create table t3 (
- a1 char(1), a2 char(1), b char(1), c char(4) not null, d char(3), dummy char(1) default ' '
-);
-
-insert into t3 (a1, a2, b, c, d) values
-('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'),
-('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'),
-('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'),
-('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'),
-('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'),
-('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'),
-('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'),
-('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'),
-('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'),
-('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'),
-('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'),
-('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4');
-insert into t3 (a1, a2, b, c, d) values
-('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'),
-('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'),
-('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'),
-('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'),
-('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'),
-('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'),
-('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'),
-('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'),
-('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'),
-('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'),
-('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'),
-('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4');
-insert into t3 (a1, a2, b, c, d) values
-('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'),
-('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'),
-('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'),
-('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'),
-('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'),
-('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'),
-('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'),
-('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'),
-('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'),
-('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'),
-('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'),
-('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4');
-insert into t3 (a1, a2, b, c, d) values
-('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'),
-('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'),
-('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'),
-('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'),
-('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'),
-('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'),
-('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'),
-('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'),
-('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'),
-('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'),
-('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'),
-('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4');
-
-create index idx_t3_0 on t3 (a1);
-create index idx_t3_1 on t3 (a1,a2,b,c);
-create index idx_t3_2 on t3 (a1,a2,b);
-analyze table t3;
-
-
-#
-# Queries without a WHERE clause. These queries do not use ranges.
-#
-
-# plans
-explain select a1, min(a2) from t1 group by a1;
-explain select a1, max(a2) from t1 group by a1;
-explain select a1, min(a2), max(a2) from t1 group by a1;
-explain select a1, a2, b, min(c), max(c) from t1 group by a1,a2,b;
-explain select a1,a2,b,max(c),min(c) from t1 group by a1,a2,b;
---replace_column 7 # 9 #
-explain select a1,a2,b,max(c),min(c) from t2 group by a1,a2,b;
-# Select fields in different order
-explain select min(a2), a1, max(a2), min(a2), a1 from t1 group by a1;
-explain select a1, b, min(c), a1, max(c), b, a2, max(c), max(c) from t1 group by a1, a2, b;
-explain select min(a2) from t1 group by a1;
-explain select a2, min(c), max(c) from t1 group by a1,a2,b;
-
-# queries
-select a1, min(a2) from t1 group by a1;
-select a1, max(a2) from t1 group by a1;
-select a1, min(a2), max(a2) from t1 group by a1;
-select a1, a2, b, min(c), max(c) from t1 group by a1,a2,b;
-select a1,a2,b,max(c),min(c) from t1 group by a1,a2,b;
-select a1,a2,b,max(c),min(c) from t2 group by a1,a2,b;
-# Select fields in different order
-select min(a2), a1, max(a2), min(a2), a1 from t1 group by a1;
-select a1, b, min(c), a1, max(c), b, a2, max(c), max(c) from t1 group by a1, a2, b;
-select min(a2) from t1 group by a1;
-select a2, min(c), max(c) from t1 group by a1,a2,b;
-
-#
-# Queries with a where clause
-#
-
-# A) Preds only over the group 'A' attributes
-# plans
-explain select a1,a2,b,min(c),max(c) from t1 where a1 < 'd' group by a1,a2,b;
-explain select a1,a2,b,min(c),max(c) from t1 where a1 >= 'b' group by a1,a2,b;
-explain select a1,a2,b, max(c) from t1 where a1 >= 'c' or a1 < 'b' group by a1,a2,b;
-explain select a1, max(c) from t1 where a1 >= 'c' or a1 < 'b' group by a1,a2,b;
-explain select a1,a2,b,min(c),max(c) from t1 where a1 >= 'c' or a2 < 'b' group by a1,a2,b;
-explain select a1,a2,b, max(c) from t1 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b;
-explain select a1,a2,b,min(c),max(c) from t1 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b;
-explain select a1,a2,b, max(c) from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') group by a1,a2,b;
-explain select a1,a2,b,min(c),max(c) from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') group by a1,a2,b;
-explain select a1,min(c),max(c) from t1 where a1 >= 'b' group by a1,a2,b;
-explain select a1, max(c) from t1 where a1 in ('a','b','d') group by a1,a2,b;
-
---replace_column 9 #
-explain select a1,a2,b, max(c) from t2 where a1 < 'd' group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b,min(c),max(c) from t2 where a1 < 'd' group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b,min(c),max(c) from t2 where a1 >= 'b' group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b, max(c) from t2 where a1 >= 'c' or a1 < 'b' group by a1,a2,b;
---replace_column 9 #
-explain select a1, max(c) from t2 where a1 >= 'c' or a1 < 'b' group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b,min(c),max(c) from t2 where a1 >= 'c' or a2 < 'b' group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b, max(c) from t2 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b,min(c),max(c) from t2 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b, max(c) from t2 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b,min(c),max(c) from t2 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') group by a1,a2,b;
---replace_column 9 #
-explain select a1,min(c),max(c) from t2 where a1 >= 'b' group by a1,a2,b;
---replace_column 9 #
-explain select a1, max(c) from t2 where a1 in ('a','b','d') group by a1,a2,b;
-
-# queries
-select a1,a2,b,min(c),max(c) from t1 where a1 < 'd' group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t1 where a1 >= 'b' group by a1,a2,b;
-select a1,a2,b, max(c) from t1 where a1 >= 'c' or a1 < 'b' group by a1,a2,b;
-select a1, max(c) from t1 where a1 >= 'c' or a1 < 'b' group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t1 where a1 >= 'c' or a2 < 'b' group by a1,a2,b;
-select a1,a2,b, max(c) from t1 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t1 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b;
-select a1,a2,b, max(c) from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') group by a1,a2,b;
-select a1,min(c),max(c) from t1 where a1 >= 'b' group by a1,a2,b;
-select a1, max(c) from t1 where a1 in ('a','b','d') group by a1,a2,b;
-
-select a1,a2,b, max(c) from t2 where a1 < 'd' group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t2 where a1 < 'd' group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t2 where a1 >= 'b' group by a1,a2,b;
-select a1,a2,b, max(c) from t2 where a1 >= 'c' or a1 < 'b' group by a1,a2,b;
-select a1, max(c) from t2 where a1 >= 'c' or a1 < 'b' group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t2 where a1 >= 'c' or a2 < 'b' group by a1,a2,b;
-select a1,a2,b, max(c) from t2 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t2 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b;
-select a1,a2,b, max(c) from t2 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t2 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') group by a1,a2,b;
-select a1,min(c),max(c) from t2 where a1 >= 'b' group by a1,a2,b;
-select a1, max(c) from t2 where a1 in ('a','b','d') group by a1,a2,b;
-
-# B) Equalities only over the non-group 'B' attributes
-# plans
-explain select a1,a2,b,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1;
-explain select a1,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1;
-explain select a1,a2,b, max(c) from t1 where (b = 'b') group by a1,a2;
-explain select a1,a2,b,min(c),max(c) from t1 where (b = 'b') group by a1,a2;
-explain select a1,a2, max(c) from t1 where (b = 'b') group by a1,a2;
-
-explain select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') group by a1;
-explain select a1,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') group by a1;
-explain select a1,a2,b, max(c) from t2 where (b = 'b') group by a1,a2;
-explain select a1,a2,b,min(c),max(c) from t2 where (b = 'b') group by a1,a2;
-explain select a1,a2, max(c) from t2 where (b = 'b') group by a1,a2;
-
-# these queries test case 2) in TRP_GROUP_MIN_MAX::update_cost()
-explain select a1,a2,b,max(c),min(c) from t3 where (a2 = 'a') and (b = 'b') group by a1;
-explain select a1,max(c),min(c) from t3 where (a2 = 'a') and (b = 'b') group by a1;
-
-# queries
-select a1,a2,b,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1;
-select a1,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1;
-select a1,a2,b, max(c) from t1 where (b = 'b') group by a1,a2;
-select a1,a2,b,min(c),max(c) from t1 where (b = 'b') group by a1,a2;
-select a1,a2, max(c) from t1 where (b = 'b') group by a1,a2;
-
-select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') group by a1;
-select a1,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') group by a1;
-select a1,a2,b, max(c) from t2 where (b = 'b') group by a1,a2;
-select a1,a2,b,min(c),max(c) from t2 where (b = 'b') group by a1,a2;
-select a1,a2, max(c) from t2 where (b = 'b') group by a1,a2;
-
-# these queries test case 2) in TRP_GROUP_MIN_MAX::update_cost()
-select a1,a2,b,max(c),min(c) from t3 where (a2 = 'a') and (b = 'b') group by a1;
-select a1,max(c),min(c) from t3 where (a2 = 'a') and (b = 'b') group by a1;
-
-
-# IS NULL (makes sense for t2 only)
-# plans
-explain select a1,a2,b,min(c) from t2 where (a2 = 'a') and b is NULL group by a1;
-explain select a1,a2,b,max(c) from t2 where (a2 = 'a') and b is NULL group by a1;
-explain select a1,a2,b,min(c) from t2 where b is NULL group by a1,a2;
-explain select a1,a2,b,max(c) from t2 where b is NULL group by a1,a2;
-explain select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2;
-explain select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2;
-# queries
-select a1,a2,b,min(c) from t2 where (a2 = 'a') and b is NULL group by a1;
-select a1,a2,b,max(c) from t2 where (a2 = 'a') and b is NULL group by a1;
-select a1,a2,b,min(c) from t2 where b is NULL group by a1,a2;
-select a1,a2,b,max(c) from t2 where b is NULL group by a1,a2;
-select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2;
-select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2;
-
-# C) Range predicates for the MIN/MAX attribute
-# plans
---replace_column 9 #
-explain select a1,a2,b, max(c) from t1 where (c > 'b1') group by a1,a2,b;
-explain select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') group by a1,a2,b;
-explain select a1,a2,b, max(c) from t1 where (c > 'f123') group by a1,a2,b;
-explain select a1,a2,b,min(c),max(c) from t1 where (c > 'f123') group by a1,a2,b;
-explain select a1,a2,b, max(c) from t1 where (c < 'a0') group by a1,a2,b;
-explain select a1,a2,b,min(c),max(c) from t1 where (c < 'a0') group by a1,a2,b;
-explain select a1,a2,b, max(c) from t1 where (c < 'k321') group by a1,a2,b;
-explain select a1,a2,b,min(c),max(c) from t1 where (c < 'k321') group by a1,a2,b;
-explain select a1,a2,b, max(c) from t1 where (c < 'a0') or (c > 'b1') group by a1,a2,b;
-explain select a1,a2,b,min(c),max(c) from t1 where (c < 'a0') or (c > 'b1') group by a1,a2,b;
-explain select a1,a2,b, max(c) from t1 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
-explain select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
-explain select a1,a2,b,min(c),max(c) from t1 where (c > 'b111') and (c <= 'g112') group by a1,a2,b;
-explain select a1,a2,b,min(c),max(c) from t1 where (c < 'c5') or (c = 'g412') or (c = 'k421') group by a1,a2,b;
-explain select a1,a2,b,min(c),max(c) from t1 where ((c > 'b111') and (c <= 'g112')) or ((c > 'd000') and (c <= 'i110')) group by a1,a2,b;
-explain select a1,a2,b,min(c),max(c) from t1 where (c between 'b111' and 'g112') or (c between 'd000' and 'i110') group by a1,a2,b;
-
---replace_column 9 #
-explain select a1,a2,b, max(c) from t2 where (c > 'b1') group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b,min(c),max(c) from t2 where (c > 'b1') group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b, max(c) from t2 where (c > 'f123') group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b,min(c),max(c) from t2 where (c > 'f123') group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b, max(c) from t2 where (c < 'a0') group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b,min(c),max(c) from t2 where (c < 'a0') group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b, max(c) from t2 where (c < 'k321') group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b,min(c),max(c) from t2 where (c < 'k321') group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b, max(c) from t2 where (c < 'a0') or (c > 'b1') group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b,min(c),max(c) from t2 where (c < 'a0') or (c > 'b1') group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b, max(c) from t2 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b,min(c),max(c) from t2 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b,min(c),max(c) from t2 where (c > 'b111') and (c <= 'g112') group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b,min(c),max(c) from t2 where (c < 'c5') or (c = 'g412') or (c = 'k421') group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b,min(c),max(c) from t2 where ((c > 'b111') and (c <= 'g112')) or ((c > 'd000') and (c <= 'i110')) group by a1,a2,b;
-
-# queries
-select a1,a2,b, max(c) from t1 where (c > 'b1') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') group by a1,a2,b;
-select a1,a2,b, max(c) from t1 where (c > 'f123') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t1 where (c > 'f123') group by a1,a2,b;
-select a1,a2,b, max(c) from t1 where (c < 'a0') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t1 where (c < 'a0') group by a1,a2,b;
-select a1,a2,b, max(c) from t1 where (c < 'k321') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t1 where (c < 'k321') group by a1,a2,b;
-select a1,a2,b, max(c) from t1 where (c < 'a0') or (c > 'b1') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t1 where (c < 'a0') or (c > 'b1') group by a1,a2,b;
-select a1,a2,b, max(c) from t1 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t1 where (c > 'b111') and (c <= 'g112') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t1 where (c < 'c5') or (c = 'g412') or (c = 'k421') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t1 where ((c > 'b111') and (c <= 'g112')) or ((c > 'd000') and (c <= 'i110')) group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t1 where (c between 'b111' and 'g112') or (c between 'd000' and 'i110') group by a1,a2,b;
-
-select a1,a2,b, max(c) from t2 where (c > 'b1') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t2 where (c > 'b1') group by a1,a2,b;
-select a1,a2,b, max(c) from t2 where (c > 'f123') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t2 where (c > 'f123') group by a1,a2,b;
-select a1,a2,b, max(c) from t2 where (c < 'a0') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t2 where (c < 'a0') group by a1,a2,b;
-select a1,a2,b, max(c) from t2 where (c < 'k321') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t2 where (c < 'k321') group by a1,a2,b;
-select a1,a2,b, max(c) from t2 where (c < 'a0') or (c > 'b1') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t2 where (c < 'a0') or (c > 'b1') group by a1,a2,b;
-select a1,a2,b, max(c) from t2 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t2 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t2 where (c > 'b111') and (c <= 'g112') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t2 where (c < 'c5') or (c = 'g412') or (c = 'k421') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t2 where ((c > 'b111') and (c <= 'g112')) or ((c > 'd000') and (c <= 'i110')) group by a1,a2,b;
-
-# analyze the sub-select
-explain select a1,a2,b,min(c),max(c) from t1
-where exists ( select * from t2 where t2.c = t1.c )
-group by a1,a2,b;
-
-# the sub-select is unrelated to MIN/MAX
-explain select a1,a2,b,min(c),max(c) from t1
-where exists ( select * from t2 where t2.c > 'b1' )
-group by a1,a2,b;
-
-
-# A,B,C) Predicates referencing mixed classes of attributes
-# plans
-explain select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
-explain select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (c > 'b111') group by a1,a2,b;
-explain select a1,a2,b,min(c),max(c) from t1 where (a2 >= 'b') and (b = 'a') and (c > 'b111') group by a1,a2,b;
-explain select a1,a2,b,min(c) from t1 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c < 'h112') or (c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122')) group by a1,a2,b;
-explain select a1,a2,b,min(c) from t1 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122') or (c < 'h112') or (c = 'c111')) group by a1,a2,b;
-explain select a1,a2,b,min(c) from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
-explain select a1,a2,b,min(c) from t1 where (ord(a1) > 97) and (ord(a2) + ord(a1) > 194) and (b = 'c') group by a1,a2,b;
-
---replace_column 9 #
-explain select a1,a2,b,min(c),max(c) from t2 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b,min(c),max(c) from t2 where (a1 >= 'c' or a2 < 'b') and (c > 'b111') group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b,min(c),max(c) from t2 where (a2 >= 'b') and (b = 'a') and (c > 'b111') group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b,min(c) from t2 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c < 'h112') or (c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122')) group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b,min(c) from t2 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122') or (c < 'h112') or (c = 'c111')) group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b,min(c) from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
-
-# queries
-select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (c > 'b111') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t1 where (a2 >= 'b') and (b = 'a') and (c > 'b111') group by a1,a2,b;
-select a1,a2,b,min(c) from t1 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c < 'h112') or (c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122')) group by a1,a2,b;
-select a1,a2,b,min(c) from t1 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122') or (c < 'h112') or (c = 'c111')) group by a1,a2,b;
-select a1,a2,b,min(c) from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
-select a1,a2,b,min(c) from t1 where (ord(a1) > 97) and (ord(a2) + ord(a1) > 194) and (b = 'c') group by a1,a2,b;
-
-select a1,a2,b,min(c),max(c) from t2 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t2 where (a1 >= 'c' or a2 < 'b') and (c > 'b111') group by a1,a2,b;
-select a1,a2,b,min(c),max(c) from t2 where (a2 >= 'b') and (b = 'a') and (c > 'b111') group by a1,a2,b;
-select a1,a2,b,min(c) from t2 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c < 'h112') or (c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122')) group by a1,a2,b;
-select a1,a2,b,min(c) from t2 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122') or (c < 'h112') or (c = 'c111')) group by a1,a2,b;
-select a1,a2,b,min(c) from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
-
-
-#
-# GROUP BY queries without MIN/MAX
-#
-
-# plans
-explain select a1,a2,b from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
-explain select a1,a2,b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
-explain select a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
-explain select a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
-
---replace_column 9 #
-explain select a1,a2,b from t2 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
---replace_column 9 #
-explain select a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
-
-# queries
-select a1,a2,b from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
-select a1,a2,b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
-select a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
-select a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
-
-select a1,a2,b from t2 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
-select a1,a2,b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
-select a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
-select a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
-
-#
-# DISTINCT queries
-#
-
-# plans
-explain select distinct a1,a2,b from t1;
-explain select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a');
-explain extended select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
-explain select distinct a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
-explain select distinct b from t1 where (a2 >= 'b') and (b = 'a');
-
---replace_column 9 #
-explain select distinct a1,a2,b from t2;
---replace_column 9 #
-explain select distinct a1,a2,b from t2 where (a2 >= 'b') and (b = 'a');
-explain extended select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
---replace_column 9 #
-explain select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
-explain select distinct b from t2 where (a2 >= 'b') and (b = 'a');
-
-# queries
-select distinct a1,a2,b from t1;
-select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a');
-select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
-select distinct a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
-select distinct b from t1 where (a2 >= 'b') and (b = 'a');
-
-select distinct a1,a2,b from t2;
-select distinct a1,a2,b from t2 where (a2 >= 'b') and (b = 'a');
-select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
-select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
-select distinct b from t2 where (a2 >= 'b') and (b = 'a');
-
-# BUG #6303
-select distinct t_00.a1
-from t1 t_00
-where exists ( select * from t2 where a1 = t_00.a1 );
-
-# BUG #8532 - SELECT DISTINCT a, a causes server to crash
-select distinct a1,a1 from t1;
-select distinct a2,a1,a2,a1 from t1;
-select distinct t1.a1,t2.a1 from t1,t2;
-
-
-#
-# DISTINCT queries with GROUP-BY
-#
-
-# plans
-explain select distinct a1,a2,b from t1;
-explain select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
-explain select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
-explain select distinct a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
-explain select distinct b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
-
---replace_column 9 #
-explain select distinct a1,a2,b from t2;
---replace_column 9 #
-explain select distinct a1,a2,b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
---replace_column 9 #
-explain select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
---replace_column 9 #
-explain select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
---replace_column 9 #
-explain select distinct b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
-
-# queries
-select distinct a1,a2,b from t1;
-select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
-select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
-select distinct a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
-select distinct b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
-
-select distinct a1,a2,b from t2;
-select distinct a1,a2,b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
-select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
-select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
-select distinct b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
-
-
-#
-# COUNT (DISTINCT cols) queries
-#
-
-explain select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
-explain select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
-explain extended select count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
-explain select count(distinct b) from t1 where (a2 >= 'b') and (b = 'a');
-explain extended select ord(a1) + count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a');
-
-select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
-select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
-select count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
-select count(distinct b) from t1 where (a2 >= 'b') and (b = 'a');
-select ord(a1) + count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a');
-
-#
-# Queries with expressions in the select clause
-#
-
-explain select a1,a2,b, concat(min(c), max(c)) from t1 where a1 < 'd' group by a1,a2,b;
-explain select concat(a1,min(c)),b from t1 where a1 < 'd' group by a1,a2,b;
-explain select concat(a1,min(c)),b,max(c) from t1 where a1 < 'd' group by a1,a2,b;
-explain select concat(a1,a2),b,min(c),max(c) from t1 where a1 < 'd' group by a1,a2,b;
-explain select concat(ord(min(b)),ord(max(b))),min(b),max(b) from t1 group by a1,a2;
-
-select a1,a2,b, concat(min(c), max(c)) from t1 where a1 < 'd' group by a1,a2,b;
-select concat(a1,min(c)),b from t1 where a1 < 'd' group by a1,a2,b;
-select concat(a1,min(c)),b,max(c) from t1 where a1 < 'd' group by a1,a2,b;
-select concat(a1,a2),b,min(c),max(c) from t1 where a1 < 'd' group by a1,a2,b;
-select concat(ord(min(b)),ord(max(b))),min(b),max(b) from t1 group by a1,a2;
-
-
-#
-# Negative examples: queries that should NOT be treated as optimizable by
-# QUICK_GROUP_MIN_MAX_SELECT
-#
-
-# select a non-indexed attribute
-explain select a1,a2,b,d,min(c),max(c) from t1 group by a1,a2,b;
-
-explain select a1,a2,b,d from t1 group by a1,a2,b;
-
-# predicate that references an attribute that is after the MIN/MAX argument
-# in the index
-explain extended select a1,a2,min(b),max(b) from t1
-where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2;
-
-# predicate that references a non-indexed attribute
-explain extended select a1,a2,b,min(c),max(c) from t1
-where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy2') group by a1,a2,b;
-
-explain extended select a1,a2,b,c from t1
-where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy2') group by a1,a2,b,c;
-
-# non-equality predicate for a non-group select attribute
-explain select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') or (b < 'b') group by a1;
-explain extended select a1,a2,b from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2,b;
-
-# non-group field with an equality predicate that references a keypart after the
-# MIN/MAX argument
-explain select a1,a2,min(b),c from t2 where (a2 = 'a') and (c = 'a111') group by a1;
-select a1,a2,min(b),c from t2 where (a2 = 'a') and (c = 'a111') group by a1;
-
-# disjunction for a non-group select attribute
-explain select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') or (b = 'a') group by a1;
-
-# non-range predicate for the MIN/MAX attribute
-explain select a1,a2,b,min(c),max(c) from t2
-where (c > 'a000') and (c <= 'd999') and (c like '_8__') group by a1,a2,b;
-
-# not all attributes are indexed by one index
-explain select a1, a2, b, c, min(d), max(d) from t1 group by a1,a2,b,c;
-
-# other aggregate functions than MIN/MAX
-explain select a1,a2,count(a2) from t1 group by a1,a2,b;
-explain extended select a1,a2,count(a2) from t1 where (a1 > 'a') group by a1,a2,b;
-explain extended select sum(ord(a1)) from t1 where (a1 > 'a') group by a1,a2,b;
-
-
-#
-# Bug #16710: select distinct doesn't return all it should
-#
-
-explain select distinct(a1) from t1 where ord(a2) = 98;
-select distinct(a1) from t1 where ord(a2) = 98;
-
-#
-# BUG#11044: DISTINCT or GROUP BY queries with equality predicates instead of MIN/MAX.
-#
-
-explain select a1 from t1 where a2 = 'b' group by a1;
-select a1 from t1 where a2 = 'b' group by a1;
-
-explain select distinct a1 from t1 where a2 = 'b';
-select distinct a1 from t1 where a2 = 'b';
-
-#
-# Bug #12672: primary key implcitly included in every innodb index
-#
-# Test case moved to group_min_max_innodb
-
-
-#
-# Bug #6142: a problem with the empty innodb table
-#
-# Test case moved to group_min_max_innodb
-
-
-#
-# Bug #9798: group by with rollup
-#
-# Test case moved to group_min_max_innodb
-
-
-#
-# Bug #13293 Wrongly used index results in endless loop.
-#
-# Test case moved to group_min_max_innodb
-
-
-drop table t1,t2,t3;
-
-#
-# Bug #14920 Ordering aggregated result sets with composite primary keys
-# corrupts resultset
-#
-create table t1 (c1 int not null,c2 int not null, primary key(c1,c2));
-insert into t1 (c1,c2) values
-(10,1),(10,2),(10,3),(20,4),(20,5),(20,6),(30,7),(30,8),(30,9);
-select distinct c1, c2 from t1 order by c2;
-select c1,min(c2) as c2 from t1 group by c1 order by c2;
-select c1,c2 from t1 group by c1,c2 order by c2;
-drop table t1;
-
-#
-# Bug #16203: Analysis for possible min/max optimization erroneously
-# returns impossible range
-#
-
-CREATE TABLE t1 (a varchar(5), b int(11), PRIMARY KEY (a,b));
-INSERT INTO t1 VALUES ('AA',1), ('AA',2), ('AA',3), ('BB',1), ('AA',4);
-OPTIMIZE TABLE t1;
-
-SELECT a FROM t1 WHERE a='AA' GROUP BY a;
-SELECT a FROM t1 WHERE a='BB' GROUP BY a;
-
-EXPLAIN SELECT a FROM t1 WHERE a='AA' GROUP BY a;
-EXPLAIN SELECT a FROM t1 WHERE a='BB' GROUP BY a;
-
-SELECT DISTINCT a FROM t1 WHERE a='BB';
-SELECT DISTINCT a FROM t1 WHERE a LIKE 'B%';
-SELECT a FROM t1 WHERE a LIKE 'B%' GROUP BY a;
-
-DROP TABLE t1;
-
-
-#
-# Bug #15102: select distinct returns empty result, select count
-# distinct > 0 (correct)
-#
-
-CREATE TABLE t1 (
- a int(11) NOT NULL DEFAULT '0',
- b varchar(16) COLLATE latin1_general_ci NOT NULL DEFAULT '',
- PRIMARY KEY (a,b)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
-
-delimiter |;
-
-CREATE PROCEDURE a(x INT)
-BEGIN
- DECLARE rnd INT;
- DECLARE cnt INT;
-
- WHILE x > 0 DO
- SET rnd= x % 100;
- SET cnt = (SELECT COUNT(*) FROM t1 WHERE a = rnd);
- INSERT INTO t1(a,b) VALUES (rnd, CAST(cnt AS CHAR));
- SET x= x - 1;
- END WHILE;
-END|
-
-DELIMITER ;|
-
-CALL a(1000);
-
-SELECT a FROM t1 WHERE a=0;
-SELECT DISTINCT a FROM t1 WHERE a=0;
-SELECT COUNT(DISTINCT a) FROM t1 WHERE a=0;
-
-DROP TABLE t1;
-DROP PROCEDURE a;
-
-#
-# Bug #18068: SELECT DISTINCT
-#
-
-CREATE TABLE t1 (a varchar(64) NOT NULL default '', PRIMARY KEY(a));
-
-INSERT INTO t1 (a) VALUES
- (''), ('CENTRAL'), ('EASTERN'), ('GREATER LONDON'),
- ('NORTH CENTRAL'), ('NORTH EAST'), ('NORTH WEST'), ('SCOTLAND'),
- ('SOUTH EAST'), ('SOUTH WEST'), ('WESTERN');
-
-EXPLAIN SELECT DISTINCT a,a FROM t1 ORDER BY a;
-SELECT DISTINCT a,a FROM t1 ORDER BY a;
-
-DROP TABLE t1;
-
-#
-# Bug #21007: NATURAL JOIN (any JOIN (2 x NATURAL JOIN)) crashes the server
-#
-
-CREATE TABLE t1 (id1 INT, id2 INT);
-CREATE TABLE t2 (id2 INT, id3 INT, id5 INT);
-CREATE TABLE t3 (id3 INT, id4 INT);
-CREATE TABLE t4 (id4 INT);
-CREATE TABLE t5 (id5 INT, id6 INT);
-CREATE TABLE t6 (id6 INT);
-
-INSERT INTO t1 VALUES(1,1);
-INSERT INTO t2 VALUES(1,1,1);
-INSERT INTO t3 VALUES(1,1);
-INSERT INTO t4 VALUES(1);
-INSERT INTO t5 VALUES(1,1);
-INSERT INTO t6 VALUES(1);
-
-# original bug query
-SELECT * FROM
-t1
- NATURAL JOIN
-(t2 JOIN (t3 NATURAL JOIN t4, t5 NATURAL JOIN t6)
- ON (t3.id3 = t2.id3 AND t5.id5 = t2.id5));
-
-# inner join swapped
-SELECT * FROM
-t1
- NATURAL JOIN
-(((t3 NATURAL JOIN t4) join (t5 NATURAL JOIN t6) on t3.id4 = t5.id5) JOIN t2
- ON (t3.id3 = t2.id3 AND t5.id5 = t2.id5));
-
-# one join less, no ON cond
-SELECT * FROM t1 NATURAL JOIN ((t3 join (t5 NATURAL JOIN t6)) JOIN t2);
-
-# wrong error message: 'id2' - ambiguous column
-SELECT * FROM
-(t2 JOIN (t3 NATURAL JOIN t4, t5 NATURAL JOIN t6)
- ON (t3.id3 = t2.id3 AND t5.id5 = t2.id5))
- NATURAL JOIN
-t1;
-SELECT * FROM
-(t2 JOIN ((t3 NATURAL JOIN t4) join (t5 NATURAL JOIN t6)))
- NATURAL JOIN
-t1;
-
-DROP TABLE t1,t2,t3,t4,t5,t6;
-
-#
-# Bug#22342: No results returned for query using max and group by
-#
-CREATE TABLE t1 (a int, b int, PRIMARY KEY (a,b), KEY b (b));
-INSERT INTO t1 VALUES (1,1),(1,2),(1,0),(1,3);
-
-explain SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a;
-SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a;
-SELECT MIN(b), a FROM t1 WHERE b > 1 AND a = 1 GROUP BY a;
-CREATE TABLE t2 (a int, b int, c int, PRIMARY KEY (a,b,c));
-INSERT INTO t2 SELECT a,b,b FROM t1;
-explain SELECT MIN(c) FROM t2 WHERE b = 2 and a = 1 and c > 1 GROUP BY a;
-SELECT MIN(c) FROM t2 WHERE b = 2 and a = 1 and c > 1 GROUP BY a;
-
-DROP TABLE t1,t2;
-
-#
-# Bug#24156: Loose index scan not used with CREATE TABLE ...SELECT and similar statements
-#
-
-CREATE TABLE t1 (a INT, b INT, INDEX (a,b));
-INSERT INTO t1 (a, b) VALUES (1,1), (1,2), (1,3), (1,4), (1,5),
- (2,2), (2,3), (2,1), (3,1), (4,1), (4,2), (4,3), (4,4), (4,5), (4,6);
-EXPLAIN SELECT max(b), a FROM t1 GROUP BY a;
-FLUSH STATUS;
-SELECT max(b), a FROM t1 GROUP BY a;
-SHOW STATUS LIKE 'handler_read__e%';
-EXPLAIN SELECT max(b), a FROM t1 GROUP BY a;
-FLUSH STATUS;
-CREATE TABLE t2 SELECT max(b), a FROM t1 GROUP BY a;
-SHOW STATUS LIKE 'handler_read__e%';
-FLUSH STATUS;
-SELECT * FROM (SELECT max(b), a FROM t1 GROUP BY a) b;
-SHOW STATUS LIKE 'handler_read__e%';
-FLUSH STATUS;
-(SELECT max(b), a FROM t1 GROUP BY a) UNION
- (SELECT max(b), a FROM t1 GROUP BY a);
-SHOW STATUS LIKE 'handler_read__e%';
-EXPLAIN (SELECT max(b), a FROM t1 GROUP BY a) UNION
- (SELECT max(b), a FROM t1 GROUP BY a);
-
-EXPLAIN SELECT (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) x
- FROM t1 AS t1_outer;
-EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE EXISTS
- (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2);
-EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE
- (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12;
-EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE
- a IN (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2);
-EXPLAIN SELECT 1 FROM t1 AS t1_outer GROUP BY a HAVING
- a > (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2);
-EXPLAIN SELECT 1 FROM t1 AS t1_outer1 JOIN t1 AS t1_outer2
- ON t1_outer1.a = (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2)
- AND t1_outer1.b = t1_outer2.b;
-EXPLAIN SELECT (SELECT (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) x
- FROM t1 AS t1_outer) x2 FROM t1 AS t1_outer2;
-
-CREATE TABLE t3 LIKE t1;
-FLUSH STATUS;
-INSERT INTO t3 SELECT a,MAX(b) FROM t1 GROUP BY a;
-SHOW STATUS LIKE 'handler_read__e%';
-DELETE FROM t3;
-FLUSH STATUS;
-INSERT INTO t3 SELECT 1, (SELECT MAX(b) FROM t1 GROUP BY a HAVING a < 2)
- FROM t1 LIMIT 1;
-SHOW STATUS LIKE 'handler_read__e%';
-FLUSH STATUS;
-DELETE FROM t3 WHERE (SELECT MAX(b) FROM t1 GROUP BY a HAVING a < 2) > 10000;
-SHOW STATUS LIKE 'handler_read__e%';
-FLUSH STATUS;
---error ER_SUBQUERY_NO_1_ROW
-DELETE FROM t3 WHERE (SELECT (SELECT MAX(b) FROM t1 GROUP BY a HAVING a < 2) x
- FROM t1) > 10000;
-SHOW STATUS LIKE 'handler_read__e%';
-
-DROP TABLE t1,t2,t3;
-
-#
-# Bug#25602: queries with DISTINCT and SQL_BIG_RESULT hint
-# for which loose scan optimization is applied
-#
-
-CREATE TABLE t1 (a int, INDEX idx(a));
-INSERT INTO t1 VALUES
- (4), (2), (1), (2), (4), (2), (1), (4),
- (4), (2), (1), (2), (2), (4), (1), (4);
-
-EXPLAIN SELECT DISTINCT(a) FROM t1;
-SELECT DISTINCT(a) FROM t1;
-EXPLAIN SELECT SQL_BIG_RESULT DISTINCT(a) FROM t1;
-SELECT SQL_BIG_RESULT DISTINCT(a) FROM t1;
-
-DROP TABLE t1;
-
-#
-# Bug #32268: Indexed queries give bogus MIN and MAX results
-#
-
-CREATE TABLE t1 (a INT, b INT);
-INSERT INTO t1 (a, b) VALUES (1,1), (1,2), (1,3);
-INSERT INTO t1 SELECT a + 1, b FROM t1;
-INSERT INTO t1 SELECT a + 2, b FROM t1;
-
-EXPLAIN
-SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a ORDER BY a DESC;
-SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a ORDER BY a DESC;
-
-CREATE INDEX break_it ON t1 (a, b);
-
-EXPLAIN
-SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a ORDER BY a;
-SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a ORDER BY a;
-
-EXPLAIN
-SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a ORDER BY a DESC;
-SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a ORDER BY a DESC;
-
-EXPLAIN
-SELECT a, MIN(b), MAX(b), AVG(b) FROM t1 GROUP BY a ORDER BY a DESC;
-SELECT a, MIN(b), MAX(b), AVG(b) FROM t1 GROUP BY a ORDER BY a DESC;
-
-DROP TABLE t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/having.test b/mysql-test/suite/pbxt/t/having.test
deleted file mode 100644
index 5ee6ddb8a60..00000000000
--- a/mysql-test/suite/pbxt/t/having.test
+++ /dev/null
@@ -1,412 +0,0 @@
-# test of problems with having (Reported by Mark Rogers)
-#
-
---disable_warnings
-drop table if exists t1,t2,t3;
---enable_warnings
-
-create table t1 (a int);
-select count(a) as b from t1 where a=0 having b > 0;
-insert into t1 values (null);
-select count(a) as b from t1 where a=0 having b > 0;
-select count(a) as b from t1 where a=0 having b >=0;
-explain extended select count(a) as b from t1 where a=0 having b >=0;
-drop table t1;
-
-#
-# Test of problem with HAVING and AVG()
-#
-
-CREATE TABLE t1 (
- raw_id int(10) NOT NULL default '0',
- chr_start int(10) NOT NULL default '0',
- chr_end int(10) NOT NULL default '0',
- raw_start int(10) NOT NULL default '0',
- raw_end int(10) NOT NULL default '0',
- raw_ori int(2) NOT NULL default '0'
-);
-
-INSERT INTO t1 VALUES (469713,1,164123,1,164123,1),(317330,164124,317193,101,153170,1),(469434,317194,375620,101,58527,1),(591816,375621,484273,1,108653,1),(591807,484274,534671,91,50488,1),(318885,534672,649362,101,114791,1),(318728,649363,775520,102,126259,1),(336829,775521,813997,101,38577,1),(317740,813998,953227,101,139330,1),(1,813998,953227,101,139330,1);
-
-CREATE TABLE t2 (
- id int(10) unsigned NOT NULL default '0',
- contig_id int(10) unsigned NOT NULL default '0',
- seq_start int(10) NOT NULL default '0',
- seq_end int(10) NOT NULL default '0',
- strand tinyint(2) NOT NULL default '0',
- KEY id (id)
-);
-INSERT INTO t2 VALUES (133195,469713,61327,61384,1),(133196,469713,64113,64387,1),(133197,1,1,1,0),(133197,1,1,1,-2);
-SELECT e.id,
- MIN( IF(sgp.raw_ori=1,
- (e.seq_start+sgp.chr_start-sgp.raw_start),
- (sgp.chr_start+sgp.raw_end-e.seq_end))) as start,
- MAX( IF(sgp.raw_ori=1,
- (e.seq_end+sgp.chr_start-sgp.raw_start),
- (sgp.chr_start+sgp.raw_end-e.seq_start))) as end,
- AVG(IF (sgp.raw_ori=1,e.strand,(-e.strand))) as chr_strand
-FROM t1 sgp,
- t2 e
-WHERE sgp.raw_id=e.contig_id
-GROUP BY e.id
-HAVING chr_strand= -1 and end >= 0
- AND start <= 999660;
-drop table t1,t2;
-
-#
-# Test problem with having and MAX() IS NOT NULL
-#
-
-CREATE TABLE t1 (Fld1 int(11) default NULL,Fld2 int(11) default NULL);
-INSERT INTO t1 VALUES (1,10),(1,20),(2,NULL),(2,NULL),(3,50);
-select Fld1, max(Fld2) as q from t1 group by Fld1 having q is not null;
-select Fld1, max(Fld2) from t1 group by Fld1 having max(Fld2) is not null;
-select Fld1, max(Fld2) from t1 group by Fld1 having avg(Fld2) is not null;
-select Fld1, max(Fld2) from t1 group by Fld1 having std(Fld2) is not null;
-select Fld1, max(Fld2) from t1 group by Fld1 having variance(Fld2) is not null;
-drop table t1;
-
-#
-# Test problem with count(distinct) in having
-#
-create table t1 (id int not null, qty int not null);
-insert into t1 values (1,2),(1,3),(2,4),(2,5);
-select id, sum(qty) as sqty from t1 group by id having sqty>2;
-select sum(qty) as sqty from t1 group by id having count(id) > 0;
-select sum(qty) as sqty from t1 group by id having count(distinct id) > 0;
-drop table t1;
-
-#
-# Test case for Bug #4358 Problem with HAVING clause that uses alias from the
-# select list and TEXT field
-#
-
-CREATE TABLE t1 (
- `id` bigint(20) NOT NULL default '0',
- `description` text
-) ENGINE=MyISAM;
-
-CREATE TABLE t2 (
- `id` bigint(20) NOT NULL default '0',
- `description` varchar(20)
-) ENGINE=MyISAM;
-
-INSERT INTO t1 VALUES (1, 'test');
-INSERT INTO t2 VALUES (1, 'test');
-
-CREATE TABLE t3 (
- `id` bigint(20) NOT NULL default '0',
- `order_id` bigint(20) NOT NULL default '0'
-) ENGINE=MyISAM;
-
-select
- a.id, a.description,
- count(b.id) as c
-from t1 a left join t3 b on a.id=b.order_id
-group by a.id, a.description
-having (a.description is not null) and (c=0);
-
-select
- a.*,
- count(b.id) as c
-from t2 a left join t3 b on a.id=b.order_id
-group by a.id, a.description
-having (a.description is not null) and (c=0);
-
-INSERT INTO t1 VALUES (2, 'test2');
-
-select
- a.id, a.description,
- count(b.id) as c
-from t1 a left join t3 b on a.id=b.order_id
-group by a.id, a.description
-having (a.description is not null) and (c=0);
-drop table t1,t2,t3;
-
-#
-# Bug #14274: HAVING clause containing only set function
-#
-
-CREATE TABLE t1 (a int);
-INSERT INTO t1 VALUES (3), (4), (1), (3), (1);
-
-SELECT SUM(a) FROM t1 GROUP BY a HAVING SUM(a)>0;
-SELECT SUM(a) FROM t1 GROUP BY a HAVING SUM(a);
-
-DROP TABLE t1;
-
-#
-# Bug #14927: HAVING clause containing constant false conjunct
-#
-
-CREATE TABLE t1 (a int);
-INSERT INTO t1 VALUES (1), (2), (1), (3), (2), (1);
-
-SELECT a FROM t1 GROUP BY a HAVING a > 1;
-SELECT a FROM t1 GROUP BY a HAVING 1 != 1 AND a > 1;
-SELECT 0 AS x, a FROM t1 GROUP BY x,a HAVING x=1 AND a > 1;
-
-EXPLAIN SELECT a FROM t1 GROUP BY a HAVING 1 != 1 AND a > 1;
-EXPLAIN SELECT 0 AS x, a FROM t1 GROUP BY x,a HAVING x=1 AND a > 1;
-
-DROP table t1;
-
-# End of 4.1 tests
-
-#
-# Tests for WL#1972 CORRECT EVALUATION OF COLUMN REFERENCES IN THE HAVING CLAUSE
-# Per the SAP VERI tests and WL#1972, MySQL must ensure that HAVING can
-# correctly evaluate column references from the GROUP BY clause, even if the
-# same references are not also found in the select list.
-#
-
-# set global sql_mode='ansi';
-# set session sql_mode='ansi';
-
-create table t1 (col1 int, col2 varchar(5), col_t1 int);
-create table t2 (col1 int, col2 varchar(5), col_t2 int);
-create table t3 (col1 int, col2 varchar(5), col_t3 int);
-
-insert into t1 values(10,'hello',10);
-insert into t1 values(20,'hello',20);
-insert into t1 values(30,'hello',30);
-insert into t1 values(10,'bye',10);
-insert into t1 values(10,'sam',10);
-insert into t1 values(10,'bob',10);
-
-insert into t2 select * from t1;
-insert into t3 select * from t1;
-
-select count(*) from t1 group by col1 having col1 = 10;
-select count(*) as count_col1 from t1 group by col1 having col1 = 10;
-select count(*) as count_col1 from t1 as tmp1 group by col1 having col1 = 10;
-select count(*) from t1 group by col2 having col2 = 'hello';
---error 1054
-select count(*) from t1 group by col2 having col1 = 10;
-select col1 as count_col1 from t1 as tmp1 group by col1 having col1 = 10;
-select col1 as count_col1 from t1 as tmp1 group by col1 having count_col1 = 10;
-select col1 as count_col1 from t1 as tmp1 group by count_col1 having col1 = 10;
-# ANSI: should return SQLSTATE 42000 Syntax error or access violation
-# MySQL: returns 10 - because of GROUP BY name resolution
-select col1 as count_col1 from t1 as tmp1 group by count_col1 having count_col1 = 10;
-# ANSI: should return SQLSTATE 42000 Syntax error or access violation
-# MySQL: returns 10 - because of GROUP BY name resolution
-select col1 as count_col1,col2 from t1 as tmp1 group by col1,col2 having col1 = 10;
-select col1 as count_col1,col2 from t1 as tmp1 group by col1,col2 having count_col1 = 10;
-select col1 as count_col1,col2 from t1 as tmp1 group by col1,col2 having col2 = 'hello';
-select col1 as count_col1,col2 as group_col2 from t1 as tmp1 group by col1,col2 having group_col2 = 'hello';
---error 1064
-select sum(col1) as co12 from t1 group by col2 having col2 10;
-select sum(col1) as co2, count(col2) as cc from t1 group by col1 having col1 =10;
---error 1054
-select t2.col2 from t2 group by t2.col1, t2.col2 having t1.col1 <= 10;
-
-
-#
-# queries with nested sub-queries
-#
-
-# the having column is resolved in the same query
-select t1.col1 from t1
-where t1.col2 in
- (select t2.col2 from t2
- group by t2.col1, t2.col2 having t2.col1 <= 10);
-
-select t1.col1 from t1
-where t1.col2 in
- (select t2.col2 from t2
- group by t2.col1, t2.col2
- having t2.col1 <=
- (select min(t3.col1) from t3));
-
-# the having column is resolved in the SELECT clause of the outer query -
-# works in ANSI
-select t1.col1 from t1
-where t1.col2 in
- (select t2.col2 from t2
- group by t2.col1, t2.col2 having t1.col1 <= 10);
-
-# the having column is resolved in the SELECT clause of the outer query -
-# error in ANSI, works with MySQL extension
-select t1.col1 as tmp_col from t1
-where t1.col2 in
- (select t2.col2 from t2
- group by t2.col1, t2.col2 having tmp_col <= 10);
-
-# the having column is resolved in the FROM clause of the outer query -
-# works in ANSI
-select t1.col1 from t1
-where t1.col2 in
- (select t2.col2 from t2
- group by t2.col1, t2.col2 having col_t1 <= 10);
-
-# Item_field must be resolved in the same way as Item_ref
-select sum(col1) from t1
-group by col_t1
-having (select col_t1 from t2 where col_t1 = col_t2 order by col_t2 limit 1);
-
-# nested queries with HAVING, inner having column resolved in outer FROM clause
-# the outer having column is not referenced in GROUP BY which results in an error
---error 1054
-select t1.col1 from t1
-where t1.col2 in
- (select t2.col2 from t2
- group by t2.col1, t2.col2 having col_t1 <= 10)
-having col_t1 <= 20;
-
-# both having columns are resolved in the GROUP clause of the outer query
-select t1.col1 from t1
-where t1.col2 in
- (select t2.col2 from t2
- group by t2.col1, t2.col2 having col_t1 <= 10)
-group by col_t1
-having col_t1 <= 20;
-
-#
-# nested HAVING clauses
-#
-
-# non-correlated subqueries
-select col_t1, sum(col1) from t1
-group by col_t1
-having col_t1 > 10 and
- exists (select sum(t2.col1) from t2
- group by t2.col2 having t2.col2 > 'b');
-
-# correlated subqueries - inner having column 't1.col2' resolves to
-# the outer FROM clause, which cannot be used because the outer query
-# is grouped
---error 1054
-select sum(col1) from t1
-group by col_t1
-having col_t1 in (select sum(t2.col1) from t2
- group by t2.col2, t2.col1 having t2.col1 = t1.col1);
-
-# correlated subqueries - inner having column 'col_t1' resolves to
-# the outer GROUP clause
-select sum(col1) from t1
-group by col_t1
-having col_t1 in (select sum(t2.col1) from t2
- group by t2.col2, t2.col1 having t2.col1 = col_t1);
-
-#
-# queries with joins and ambiguous column names
-#
---error 1052
-select t1.col1, t2.col1 from t1, t2 where t1.col1 = t2.col1
-group by t1.col1, t2.col1 having col1 = 2;
-
---error 1052
-select t1.col1*10+t2.col1 from t1,t2 where t1.col1=t2.col1
-group by t1.col1, t2.col1 having col1 = 2;
-
-drop table t1, t2, t3;
-
-# More queries to test ANSI compatibility
-create table t1 (s1 int);
-insert into t1 values (1),(2),(3);
-
-select count(*) from t1 group by s1 having s1 is null;
-
-# prepared statements prints warnings too early
---disable_ps_protocol
-select s1*0 as s1 from t1 group by s1 having s1 <> 0;
---enable_ps_protocol
-
-# ANSI requires: 3 rows
-# MySQL returns: 0 rows - because of GROUP BY name resolution
-
-select s1*0 from t1 group by s1 having s1 = 0;
-
-select s1 from t1 group by 1 having 1 = 0;
-
-select count(s1) from t1 group by s1 having count(1+1)=2;
-# ANSI requires: 3 rows
-# MySQL returns: 0 rows - because of GROUP BY name resolution
-
-select count(s1) from t1 group by s1 having s1*0=0;
-
--- error 1052
-select * from t1 a, t1 b group by a.s1 having s1 is null;
-# ANSI requires: 0 rows
-# MySQL returns:
-# "ERROR 1052 (23000): Column 's1' in having clause is ambiguous"
-# I think the column is ambiguous in ANSI too.
-# It is the same as:
-# select a.s1, b.s1 from t1 a, t1 b group by a.s1 having s1 is null;
-# currently we first check SELECT, thus s1 is ambiguous.
-
-drop table t1;
-
-create table t1 (s1 char character set latin1 collate latin1_german1_ci);
-insert into t1 values ('ü'),('y');
-
-select s1,count(s1) from t1
-group by s1 collate latin1_swedish_ci having s1 = 'y';
-# ANSI requires: 1 row, with count(s1) = 2
-# MySQL returns: 1 row, with count(s1) = 1
-
-drop table t1;
-
-
-#
-# Bug #15917: unexpected complain for a name in having clause
-# when the server is run on Windows or with --lower-case-table-names=1
-#
-
---disable_warnings
-DROP SCHEMA IF EXISTS HU;
---enable_warnings
-CREATE SCHEMA HU ;
-USE HU ;
-
-CREATE TABLE STAFF
- (EMPNUM CHAR(3) NOT NULL UNIQUE,
- EMPNAME CHAR(20),
- GRADE DECIMAL(4),
- CITY CHAR(15));
-
-CREATE TABLE PROJ
- (PNUM CHAR(3) NOT NULL UNIQUE,
- PNAME CHAR(20),
- PTYPE CHAR(6),
- BUDGET DECIMAL(9),
- CITY CHAR(15));
-
-INSERT INTO STAFF VALUES ('E1','Alice',12,'Deale');
-INSERT INTO STAFF VALUES ('E2','Betty',10,'Vienna');
-INSERT INTO STAFF VALUES ('E3','Carmen',13,'Vienna');
-INSERT INTO STAFF VALUES ('E4','Don',12,'Deale');
-INSERT INTO STAFF VALUES ('E5','Ed',13,'Akron');
-
-INSERT INTO PROJ VALUES ('P1','MXSS','Design',10000,'Deale');
-INSERT INTO PROJ VALUES ('P2','CALM','Code',30000,'Vienna');
-INSERT INTO PROJ VALUES ('P3','SDP','Test',30000,'Tampa');
-INSERT INTO PROJ VALUES ('P4','SDP','Design',20000,'Deale');
-INSERT INTO PROJ VALUES ('P5','IRM','Test',10000,'Vienna');
-INSERT INTO PROJ VALUES ('P6','PAYR','Design',50000,'Deale');
-
-SELECT EMPNUM, GRADE*1000
- FROM HU.STAFF WHERE GRADE * 1000 >
- ANY (SELECT SUM(BUDGET) FROM HU.PROJ
- GROUP BY CITY, PTYPE
- HAVING HU.PROJ.CITY = HU.STAFF.CITY);
-
-DROP SCHEMA HU;
-USE test;
-#
-# Bug#18739: non-standard HAVING extension was allowed in strict ANSI sql mode.
-#
-create table t1(f1 int);
-select f1 from t1 having max(f1)=f1;
-select f1 from t1 group by f1 having max(f1)=f1;
-set session sql_mode='ONLY_FULL_GROUP_BY';
---error ER_NON_GROUPING_FIELD_USED
-select f1 from t1 having max(f1)=f1;
-select f1 from t1 group by f1 having max(f1)=f1;
-set session sql_mode='';
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/heap.test.THIS b/mysql-test/suite/pbxt/t/heap.test.THIS
deleted file mode 100644
index 452bcb754d3..00000000000
--- a/mysql-test/suite/pbxt/t/heap.test.THIS
+++ /dev/null
@@ -1,476 +0,0 @@
-#
-# Test of heap tables.
-#
-
---disable_warnings
-drop table if exists t1,t2,t3;
---enable_warnings
-
-create table t1 (a int not null,b int not null, primary key (a)) engine=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100;
-insert into t1 values(1,1),(2,2),(3,3),(4,4);
-delete from t1 where a=1 or a=0;
-#show table status like "t1";
-show keys from t1;
-select * from t1;
-select * from t1 where a=4;
-update t1 set b=5 where a=4;
-update t1 set b=b+1 where a>=3;
-replace t1 values (3,3);
-select * from t1;
-alter table t1 add c int not null, add key (c,a);
-drop table t1;
-
-create table t1 (a int not null,b int not null, primary key (a)) engine=memory comment="testing heaps";
-insert into t1 values(1,1),(2,2),(3,3),(4,4);
-delete from t1 where a > 0;
-select * from t1;
-drop table t1;
-
-create table t1 (a int not null,b int not null, primary key (a)) engine=heap comment="testing heaps";
-insert into t1 values(1,1),(2,2),(3,3),(4,4);
-alter table t1 modify a int not null auto_increment, engine=myisam, comment="new myisam table";
-#show table status like "t1";
-select * from t1;
-drop table t1;
-
-create table t1 (a int not null) engine=heap;
-insert into t1 values (869751),(736494),(226312),(802616),(728912);
-select * from t1 where a > 736494;
-alter table t1 add unique uniq_id(a);
-select * from t1 where a > 736494;
-select * from t1 where a = 736494;
-select * from t1 where a=869751 or a=736494;
-select * from t1 where a in (869751,736494,226312,802616);
-alter table t1 engine=myisam;
-explain select * from t1 where a in (869751,736494,226312,802616);
-drop table t1;
-
-create table t1 (x int not null, y int not null, key x (x), unique y (y))
-engine=heap;
-insert into t1 values (1,1),(2,2),(1,3),(2,4),(2,5),(2,6);
-select * from t1 where x=1;
-select * from t1,t1 as t2 where t1.x=t2.y;
-explain select * from t1,t1 as t2 where t1.x=t2.y;
-drop table t1;
-
-create table t1 (a int) engine=heap;
-insert into t1 values(1);
-select max(a) from t1;
-drop table t1;
-
-CREATE TABLE t1 ( a int not null default 0, b int not null default 0, key(a), key(b) ) ENGINE=HEAP;
-insert into t1 values(1,1),(1,2),(2,3),(1,3),(1,4),(1,5),(1,6);
-select * from t1 where a=1;
-insert into t1 values(1,1),(1,2),(2,3),(1,3),(1,4),(1,5),(1,6);
-select * from t1 where a=1;
-drop table t1;
-
-create table t1 (id int unsigned not null, primary key (id)) engine=HEAP;
-insert into t1 values(1);
-select max(id) from t1;
-insert into t1 values(2);
-select max(id) from t1;
-replace into t1 values(1);
-drop table t1;
-
-create table t1 (n int) engine=heap;
-drop table t1;
-
-create table t1 (n int) engine=heap;
-drop table if exists t1;
-
-# Test of non unique index
-
-CREATE table t1(f1 int not null,f2 char(20) not
-null,index(f2)) engine=heap;
-INSERT into t1 set f1=12,f2="bill";
-INSERT into t1 set f1=13,f2="bill";
-INSERT into t1 set f1=14,f2="bill";
-INSERT into t1 set f1=15,f2="bill";
-INSERT into t1 set f1=16,f2="ted";
-INSERT into t1 set f1=12,f2="ted";
-INSERT into t1 set f1=12,f2="ted";
-INSERT into t1 set f1=12,f2="ted";
-INSERT into t1 set f1=12,f2="ted";
-delete from t1 where f2="bill";
-select * from t1;
-drop table t1;
-
-#
-# Test when using part key searches
-#
-
-create table t1 (btn char(10) not null, key(btn)) engine=heap;
-insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i");
-explain select * from t1 where btn like "q%";
-select * from t1 where btn like "q%";
-alter table t1 add column new_col char(1) not null, add key (btn,new_col), drop key btn;
-update t1 set new_col=left(btn,1);
-explain select * from t1 where btn="a";
-explain select * from t1 where btn="a" and new_col="a";
-drop table t1;
-
-#
-# Test of NULL keys
-#
-
-CREATE TABLE t1 (
- a int default NULL,
- b int default NULL,
- KEY a (a),
- UNIQUE b (b)
-) engine=heap;
-INSERT INTO t1 VALUES (NULL,99),(99,NULL),(1,1),(2,2),(1,3);
-SELECT * FROM t1 WHERE a=NULL;
-explain SELECT * FROM t1 WHERE a IS NULL;
-SELECT * FROM t1 WHERE a<=>NULL;
-SELECT * FROM t1 WHERE b=NULL;
-explain SELECT * FROM t1 WHERE b IS NULL;
-SELECT * FROM t1 WHERE b<=>NULL;
-
---error ER_DUP_ENTRY
-INSERT INTO t1 VALUES (1,3);
-DROP TABLE t1;
-
-CREATE TABLE t1 (
- a int default NULL,
- key a (a)
-) ENGINE=HEAP;
-INSERT INTO t1 VALUES (10), (10), (10);
-EXPLAIN SELECT * FROM t1 WHERE a=10;
-SELECT * FROM t1 WHERE a=10;
-DROP TABLE t1;
-
-#
-# Test when deleting all rows
-#
-
-CREATE TABLE t1 (a int not null, primary key(a)) engine=heap;
-INSERT into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11);
-DELETE from t1 where a < 100;
-SELECT * from t1;
-DROP TABLE t1;
-
-#
-# Bug#4411 Server hangs when trying to SELECT MAX(id) from an empty HEAP table
-#
-CREATE TABLE `job_titles` (
- `job_title_id` int(6) unsigned NOT NULL default '0',
- `job_title` char(18) NOT NULL default '',
- PRIMARY KEY (`job_title_id`),
- UNIQUE KEY `job_title_id` (`job_title_id`,`job_title`)
-) ENGINE=HEAP;
-
-SELECT MAX(job_title_id) FROM job_titles;
-
-DROP TABLE job_titles;
-
-#
-# Test of delete with NOT NULL
-# (Bug #6082)
-#
-
-CREATE TABLE t1 (a INT NOT NULL, B INT, KEY(B)) ENGINE=HEAP;
-INSERT INTO t1 VALUES(1,1), (1,NULL);
-SELECT * FROM t1 WHERE B is not null;
-DROP TABLE t1;
-
-#
-# Bug #6748
-# heap_rfirst() doesn't work (and never did!)
-#
-CREATE TABLE t1 (pseudo char(35) PRIMARY KEY, date int(10) unsigned NOT NULL) ENGINE=HEAP;
-INSERT INTO t1 VALUES ('massecot',1101106491),('altec',1101106492),('stitch+',1101106304),('Seb Corgan',1101106305),('beerfilou',1101106263),('flaker',1101106529),('joce8',5),('M4vrick',1101106418),('gabay008',1101106525),('Vamp irX',1101106291),('ZoomZip',1101106546),('rip666',1101106502),('CBP ',1101106397),('guezpard',1101106496);
-DELETE FROM t1 WHERE date<1101106546;
-SELECT * FROM t1;
-DROP TABLE t1;
-
-#
-# Bug #6878: a problem with small length records
-#
-
-create table t1(a char(2)) engine=memory;
-insert into t1 values (NULL), (NULL);
-delete from t1 where a is null;
-insert into t1 values ('2'), ('3');
-select * from t1;
-drop table t1;
-
-#
-# Test varchar
-# We can't use varchar.inc becasue heap doesn't support blob's
-#
-
-let $default=`select @@storage_engine`;
-set storage_engine=HEAP;
-
-#
-# Simple basic test that endspace is saved
-#
-
-create table t1 (v varchar(10), c char(10), t varchar(50));
-insert into t1 values('+ ', '+ ', '+ ');
-set @a=repeat(' ',20);
-insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
-select concat('*',v,'*',c,'*',t,'*') from t1;
-
-# Check how columns are copied
-show create table t1;
-create table t2 like t1;
-show create table t2;
-create table t3 select * from t1;
-show create table t3;
-alter table t1 modify c varchar(10);
-show create table t1;
-alter table t1 modify v char(10);
-show create table t1;
-alter table t1 modify t varchar(10);
-show create table t1;
-select concat('*',v,'*',c,'*',t,'*') from t1;
-drop table t1,t2,t3;
-
-#
-# Testing of keys
-#
-create table t1 (v varchar(10), c char(10), t varchar(50), key(v), key(c), key(t(10)));
-show create table t1;
-disable_query_log;
-let $1=10;
-while ($1)
-{
- let $2=27;
- eval set @space=repeat(' ',10-$1);
- while ($2)
- {
- eval set @char=char(ascii('a')+$2-1);
- insert into t1 values(concat(@char,@space),concat(@char,@space),concat(@char,@space));
- dec $2;
- }
- dec $1;
-}
-enable_query_log;
-select count(*) from t1;
-insert into t1 values(concat('a',char(1)),concat('a',char(1)),concat('a',char(1)));
-select count(*) from t1 where v='a';
-select count(*) from t1 where c='a';
-select count(*) from t1 where t='a';
-select count(*) from t1 where v='a ';
-select count(*) from t1 where c='a ';
-select count(*) from t1 where t='a ';
-select count(*) from t1 where v between 'a' and 'a ';
-select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
-select count(*) from t1 where v like 'a%';
-select count(*) from t1 where c like 'a%';
-select count(*) from t1 where t like 'a%';
-select count(*) from t1 where v like 'a %';
-explain select count(*) from t1 where v='a ';
-explain select count(*) from t1 where c='a ';
-explain select count(*) from t1 where t='a ';
-explain select count(*) from t1 where v like 'a%';
-explain select count(*) from t1 where v between 'a' and 'a ';
-explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
-
---error ER_DUP_ENTRY
-alter table t1 add unique(v);
-select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a' order by length(concat('*',v,'*',c,'*',t,'*'));
-explain select * from t1 where v='a';
-
-# GROUP BY
-
-select v,count(*) from t1 group by v limit 10;
-select v,count(t) from t1 group by v limit 10;
-select v,count(c) from t1 group by v limit 10;
-select sql_big_result trim(v),count(t) from t1 group by v limit 10;
-select sql_big_result trim(v),count(c) from t1 group by v limit 10;
-select c,count(*) from t1 group by c limit 10;
-select c,count(t) from t1 group by c limit 10;
-select sql_big_result c,count(t) from t1 group by c limit 10;
-select t,count(*) from t1 group by t limit 10;
-select t,count(t) from t1 group by t limit 10;
-select sql_big_result trim(t),count(t) from t1 group by t limit 10;
-drop table t1;
-
-#
-# Test unique keys
-#
-
-create table t1 (a char(10), unique (a));
-insert into t1 values ('a');
---error ER_DUP_ENTRY
-insert into t1 values ('a ');
-
-alter table t1 modify a varchar(10);
---error ER_DUP_ENTRY
-insert into t1 values ('a '),('a '),('a '),('a ');
---error ER_DUP_ENTRY
-insert into t1 values ('a ');
---error ER_DUP_ENTRY
-insert into t1 values ('a ');
---error ER_DUP_ENTRY
-insert into t1 values ('a ');
-update t1 set a='a ' where a like 'a ';
-update t1 set a='a ' where a like 'a ';
-drop table t1;
-
-#
-# Testing of btree keys
-#
-
-create table t1 (v varchar(10), c char(10), t varchar(50), key using btree (v), key using btree (c), key using btree (t(10)));
-show create table t1;
-disable_query_log;
-let $1=10;
-while ($1)
-{
- let $2=27;
- eval set @space=repeat(' ',10-$1);
- while ($2)
- {
- eval set @char=char(ascii('a')+$2-1);
- insert into t1 values(concat(@char,@space),concat(@char,@space),concat(@char,@space));
- dec $2;
- }
- dec $1;
-}
-enable_query_log;
-select count(*) from t1;
-insert into t1 values(concat('a',char(1)),concat('a',char(1)),concat('a',char(1)));
-select count(*) from t1 where v='a';
-select count(*) from t1 where c='a';
-select count(*) from t1 where t='a';
-select count(*) from t1 where v='a ';
-select count(*) from t1 where c='a ';
-select count(*) from t1 where t='a ';
-select count(*) from t1 where v between 'a' and 'a ';
---replace_column 9 #
-select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
---replace_column 9 #
-explain select count(*) from t1 where v='a ';
---replace_column 9 #
-explain select count(*) from t1 where c='a ';
---replace_column 9 #
-explain select count(*) from t1 where t='a ';
---replace_column 9 #
-explain select count(*) from t1 where v like 'a%';
---replace_column 9 #
-explain select count(*) from t1 where v between 'a' and 'a ';
---replace_column 9 #
-explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
-
---error ER_DUP_ENTRY
-alter table t1 add unique(v);
-select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a' order by length(concat('*',v,'*',c,'*',t,'*'));
-# Number of rows is not constant for b-trees keys
---replace_column 9 #
-explain select * from t1 where v='a';
-
-drop table t1;
-
-#
-# Test unique btree keys
-#
-
-create table t1 (a char(10), unique using btree (a)) engine=heap;
-insert into t1 values ('a');
---error ER_DUP_ENTRY
-insert into t1 values ('a ');
-
-alter table t1 modify a varchar(10);
---error ER_DUP_ENTRY
-insert into t1 values ('a '),('a '),('a '),('a ');
---error ER_DUP_ENTRY
-insert into t1 values ('a ');
---error ER_DUP_ENTRY
-insert into t1 values ('a ');
---error ER_DUP_ENTRY
-insert into t1 values ('a ');
-update t1 set a='a ' where a like 'a ';
-update t1 set a='a ' where a like 'a ';
-drop table t1;
-
-#
-# test show create table
-#
-
-create table t1 (v varchar(10), c char(10), t varchar(50), key(v(5)), key(c(5)), key(t(5)));
-show create table t1;
-drop table t1;
-
-create table t1 (v varchar(65530), key(v(10)));
-show create table t1;
-insert into t1 values(repeat('a',65530));
-select length(v) from t1 where v=repeat('a',65530);
-drop table t1;
-
-#
-# Reset varchar test
-#
-eval set storage_engine=$default;
-
-#
-# Bug #8489: Strange auto_increment behaviour
-#
-
-create table t1 (a bigint unsigned auto_increment primary key, b int,
- key (b, a)) engine=heap;
-insert t1 (b) values (1),(1),(1),(1),(1),(1),(1),(1);
-select * from t1;
-drop table t1;
-
-create table t1 (a int not null, b int not null auto_increment,
- primary key(a, b), key(b)) engine=heap;
-insert t1 (a) values (1),(1),(1),(1),(1),(1),(1),(1);
-select * from t1;
-drop table t1;
-
---error 1075
-create table t1 (a int not null, b int not null auto_increment,
- primary key(a, b)) engine=heap;
-
-#
-# Bug #10566: Verify that we can create a prefixed key with length > 255
-#
-create table t1 (c char(255), primary key(c(90)));
-insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
---error ER_DUP_ENTRY
-insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
-drop table t1;
-
-#
-# Bug 12796: Record doesn't show when selecting through index
-#
-CREATE TABLE t1 (a int, key(a)) engine=heap;
-insert into t1 values (0);
-delete from t1;
-select * from t1;
-insert into t1 values (0), (1);
-select * from t1 where a = 0;
-drop table t1;
-
-# End of 4.1 tests
-
-#
-# Bug #3094: Row format of memory tables should always be reported as Fixed
-#
-create table t1 (c char(10)) engine=memory;
-create table t2 (c varchar(10)) engine=memory;
---replace_column 8 # 12 #
-show table status like 't_';
-drop table t1, t2;
-
-#
-# BUG#18233 - Memory tables INDEX USING HASH (a,b) returns 1 row on
-# SELECT WHERE a= AND b=
-#
-CREATE TABLE t1(a VARCHAR(1), b VARCHAR(2), c VARCHAR(256),
- KEY(a), KEY(b), KEY(c)) ENGINE=MEMORY;
-INSERT INTO t1 VALUES('a','aa',REPEAT('a', 256)),('a','aa',REPEAT('a',256));
-SELECT COUNT(*) FROM t1 WHERE a='a';
-SELECT COUNT(*) FROM t1 WHERE b='aa';
-SELECT COUNT(*) FROM t1 WHERE c=REPEAT('a',256);
-DROP TABLE t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 5.0 tests
diff --git a/mysql-test/suite/pbxt/t/heap_auto_increment.test b/mysql-test/suite/pbxt/t/heap_auto_increment.test
deleted file mode 100644
index 016bc946209..00000000000
--- a/mysql-test/suite/pbxt/t/heap_auto_increment.test
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# Test of auto_increment; The test for BDB tables is in bdb.test
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (a int not null auto_increment,b int, primary key (a)) engine=heap auto_increment=3;
-insert into t1 values (1,1),(NULL,3),(NULL,4);
-delete from t1 where a=4;
-insert into t1 values (NULL,5),(NULL,6);
-select * from t1;
-delete from t1 where a=6;
-#show table status like "t1";
-replace t1 values (3,1);
-ALTER TABLE t1 add c int;
-replace t1 values (3,3,3);
-insert into t1 values (NULL,7,7);
-update t1 set a=8,b=b+1,c=c+1 where a=7;
-insert into t1 values (NULL,9,9);
-select * from t1;
-drop table t1;
-
-create table t1 (
- skey tinyint unsigned NOT NULL auto_increment PRIMARY KEY,
- sval char(20)
-) engine=heap;
-insert into t1 values (NULL, "hello");
-insert into t1 values (NULL, "hey");
-select * from t1;
-select _rowid,t1._rowid,skey,sval from t1;
-drop table t1;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/heap_btree.test b/mysql-test/suite/pbxt/t/heap_btree.test
deleted file mode 100644
index fa30bb80e21..00000000000
--- a/mysql-test/suite/pbxt/t/heap_btree.test
+++ /dev/null
@@ -1,207 +0,0 @@
-#
-# Test of heap tables.
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (a int not null,b int not null, primary key using BTREE (a)) engine=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100;
-insert into t1 values(1,1),(2,2),(3,3),(4,4);
-delete from t1 where a=1 or a=0;
-#show table status like "t1";
-show keys from t1;
-select * from t1;
-select * from t1 where a=4;
-update t1 set b=5 where a=4;
-update t1 set b=b+1 where a>=3;
-replace t1 values (3,3);
-select * from t1;
-alter table t1 add c int not null, add key using BTREE (c,a);
-drop table t1;
-
-create table t1 (a int not null,b int not null, primary key using BTREE (a)) engine=heap comment="testing heaps";
-insert into t1 values(-2,-2),(-1,-1),(0,0),(1,1),(2,2),(3,3),(4,4);
-delete from t1 where a > -3;
-select * from t1;
-drop table t1;
-
-create table t1 (a int not null,b int not null, primary key using BTREE (a)) engine=heap comment="testing heaps";
-insert into t1 values(1,1),(2,2),(3,3),(4,4);
-alter table t1 modify a int not null auto_increment, engine=myisam, comment="new myisam table";
-#show table status like "t1";
-select * from t1;
-drop table t1;
-
-create table t1 (a int not null) engine=heap;
-insert into t1 values (869751),(736494),(226312),(802616),(728912);
-select * from t1 where a > 736494;
-alter table t1 add unique uniq_id using BTREE (a);
-select * from t1 where a > 736494;
-select * from t1 where a = 736494;
-select * from t1 where a=869751 or a=736494;
-select * from t1 where a in (869751,736494,226312,802616);
-alter table t1 engine=myisam;
-explain select * from t1 where a in (869751,736494,226312,802616);
-drop table t1;
-
-create table t1 (x int not null, y int not null, key x using BTREE (x,y), unique y using BTREE (y))
-engine=heap;
-insert into t1 values (1,1),(2,2),(1,3),(2,4),(2,5),(2,6);
-explain select * from t1 where x=1;
-select * from t1 where x=1;
-select * from t1,t1 as t2 where t1.x=t2.y;
-explain select * from t1,t1 as t2 where t1.x=t2.y;
-drop table t1;
-
-create table t1 (a int) engine=heap;
-insert into t1 values(1);
-select max(a) from t1;
-drop table t1;
-
-CREATE TABLE t1 ( a int not null default 0, b int not null default 0, key using BTREE (a,b), key using BTREE (b) ) ENGINE=HEAP;
-insert into t1 values(1,1),(1,2),(2,3),(1,3),(1,4),(1,5),(1,6);
-select * from t1 where a=1;
-insert into t1 values(1,1),(1,2),(2,3),(1,3),(1,4),(1,5),(1,6);
-select * from t1 where a=1;
---replace_result 0 x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 x 11 x 12 x 13 x 14 x
-explain select * from t1 where a=1 order by a,b;
---replace_result 0 x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 x 11 x 12 x 13 x 14 x
-explain select * from t1 where a=1 order by b;
-select * from t1 where b=1;
---replace_result 0 x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 x 11 x 12 x 13 x 14 x
-explain select * from t1 where b=1;
-drop table t1;
-
-create table t1 (id int unsigned not null, primary key using BTREE (id)) engine=HEAP;
-insert into t1 values(1);
-select max(id) from t1;
-insert into t1 values(2);
-select max(id) from t1;
-replace into t1 values(1);
-drop table t1;
-
-create table t1 (n int) engine=heap;
-drop table t1;
-
-create table t1 (n int) engine=heap;
-drop table if exists t1;
-
-# Test of non unique index
-
-CREATE table t1(f1 int not null,f2 char(20) not
-null,index(f2)) engine=heap;
-INSERT into t1 set f1=12,f2="bill";
-INSERT into t1 set f1=13,f2="bill";
-INSERT into t1 set f1=14,f2="bill";
-INSERT into t1 set f1=15,f2="bill";
-INSERT into t1 set f1=16,f2="ted";
-INSERT into t1 set f1=12,f2="ted";
-INSERT into t1 set f1=12,f2="ted";
-INSERT into t1 set f1=12,f2="ted";
-INSERT into t1 set f1=12,f2="ted";
-delete from t1 where f2="bill";
-select * from t1;
-drop table t1;
-
-#
-# Test when using part key searches
-#
-
-create table t1 (btn char(10) not null, key using BTREE (btn)) engine=heap;
-insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i");
-explain select * from t1 where btn like "i%";
---replace_column 9 #
-explain select * from t1 where btn like "h%";
-explain select * from t1 where btn like "a%";
-explain select * from t1 where btn like "b%";
-# For the following the BTREE MAY notice that there is no possible matches
-select * from t1 where btn like "ff%";
-select * from t1 where btn like " %";
-select * from t1 where btn like "q%";
-alter table t1 add column new_col char(1) not null, add key using BTREE (btn,new_col), drop key btn;
-update t1 set new_col=left(btn,1);
-explain select * from t1 where btn="a";
-explain select * from t1 where btn="a" and new_col="a";
-drop table t1;
-
-#
-# Test of NULL keys
-#
-
-CREATE TABLE t1 (
- a int default NULL,
- b int default NULL,
- KEY a using BTREE (a),
- UNIQUE b using BTREE (b)
-) engine=heap;
-INSERT INTO t1 VALUES (NULL,99),(99,NULL),(1,1),(2,2),(1,3);
-SELECT * FROM t1 WHERE a=NULL;
-explain SELECT * FROM t1 WHERE a IS NULL;
-SELECT * FROM t1 WHERE a<=>NULL;
-SELECT * FROM t1 WHERE b=NULL;
-explain SELECT * FROM t1 WHERE b IS NULL;
-SELECT * FROM t1 WHERE b<=>NULL;
-
---error ER_DUP_ENTRY
-INSERT INTO t1 VALUES (1,3);
-DROP TABLE t1;
-
-CREATE TABLE t1 (a int, b int, c int, key using BTREE (a, b, c)) engine=heap;
-INSERT INTO t1 VALUES (1, NULL, NULL), (1, 1, NULL), (1, NULL, 1);
-SELECT * FROM t1 WHERE a=1 and b IS NULL;
-SELECT * FROM t1 WHERE a=1 and c IS NULL;
-SELECT * FROM t1 WHERE a=1 and b IS NULL and c IS NULL;
-DROP TABLE t1;
-
-#
-# Test when deleting all rows
-#
-
-CREATE TABLE t1 (a int not null, primary key using BTREE (a)) engine=heap;
-INSERT into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11);
-DELETE from t1 where a < 100;
-SELECT * from t1;
-DROP TABLE t1;
-
-#
-# Bug #9719: problem with delete
-#
-
-create table t1(a int not null, key using btree(a)) engine=heap;
-insert into t1 values (2), (2), (2), (1), (1), (3), (3), (3), (3);
-select a from t1 where a > 2 order by a;
-delete from t1 where a < 4;
-select a from t1 order by a;
-insert into t1 values (2), (2), (2), (1), (1), (3), (3), (3), (3);
-select a from t1 where a > 4 order by a;
-delete from t1 where a > 4;
-select a from t1 order by a;
-select a from t1 where a > 3 order by a;
-delete from t1 where a >= 2;
-select a from t1 order by a;
-drop table t1;
-
---echo End of 4.1 tests
-
-#
-# BUG#18160 - Memory-/HEAP Table endless growing indexes
-#
-CREATE TABLE t1(val INT, KEY USING BTREE(val)) ENGINE=memory;
-INSERT INTO t1 VALUES(0);
---replace_result 37 21
-SELECT INDEX_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME='t1';
-UPDATE t1 SET val=1;
---replace_result 37 21
-SELECT INDEX_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME='t1';
-DROP TABLE t1;
-
-#
-# BUG#12873 - BTREE index on MEMORY table with multiple NULL values doesn't
-# work properly
-#
-CREATE TABLE t1 (a INT, UNIQUE USING BTREE(a)) ENGINE=MEMORY;
-INSERT INTO t1 VALUES(NULL),(NULL);
-DROP TABLE t1;
-
---echo End of 5.0 tests
diff --git a/mysql-test/suite/pbxt/t/heap_hash.test b/mysql-test/suite/pbxt/t/heap_hash.test
deleted file mode 100644
index 33a589cc52b..00000000000
--- a/mysql-test/suite/pbxt/t/heap_hash.test
+++ /dev/null
@@ -1,266 +0,0 @@
-#
-# Test of heap tables.
-#
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-create table t1 (a int not null,b int not null, primary key using HASH (a)) engine=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100;
-insert into t1 values(1,1),(2,2),(3,3),(4,4);
-delete from t1 where a=1 or a=0;
-#show table status like "t1";
-show keys from t1;
-select * from t1;
-select * from t1 where a=4;
-update t1 set b=5 where a=4;
-update t1 set b=b+1 where a>=3;
-replace t1 values (3,3);
-select * from t1;
-alter table t1 add c int not null, add key using HASH (c,a);
-drop table t1;
-
-create table t1 (a int not null,b int not null, primary key using HASH (a)) engine=heap comment="testing heaps";
-insert into t1 values(1,1),(2,2),(3,3),(4,4);
-delete from t1 where a > 0;
-select * from t1;
-drop table t1;
-
-create table t1 (a int not null,b int not null, primary key using HASH (a)) engine=heap comment="testing heaps";
-insert into t1 values(1,1),(2,2),(3,3),(4,4);
-alter table t1 modify a int not null auto_increment, engine=myisam, comment="new myisam table";
-#show table status like "t1";
-select * from t1;
-drop table t1;
-
-create table t1 (a int not null) engine=heap;
-insert into t1 values (869751),(736494),(226312),(802616),(728912);
-select * from t1 where a > 736494;
-alter table t1 add unique uniq_id using HASH (a);
-select * from t1 where a > 736494;
-select * from t1 where a = 736494;
-select * from t1 where a=869751 or a=736494;
-select * from t1 where a in (869751,736494,226312,802616);
-alter table t1 engine=myisam;
-explain select * from t1 where a in (869751,736494,226312,802616);
-drop table t1;
-
-create table t1 (x int not null, y int not null, key x using HASH (x), unique y using HASH (y))
-engine=heap;
-insert into t1 values (1,1),(2,2),(1,3),(2,4),(2,5),(2,6);
-select * from t1 where x=1;
-select * from t1,t1 as t2 where t1.x=t2.y;
-explain select * from t1,t1 as t2 where t1.x=t2.y;
-drop table t1;
-
-create table t1 (a int) engine=heap;
-insert into t1 values(1);
-select max(a) from t1;
-drop table t1;
-
-CREATE TABLE t1 ( a int not null default 0, b int not null default 0, key using HASH (a), key using HASH (b) ) ENGINE=HEAP;
-insert into t1 values(1,1),(1,2),(2,3),(1,3),(1,4),(1,5),(1,6);
-select * from t1 where a=1;
-insert into t1 values(1,1),(1,2),(2,3),(1,3),(1,4),(1,5),(1,6);
-select * from t1 where a=1;
-drop table t1;
-
-create table t1 (id int unsigned not null, primary key using HASH (id)) engine=HEAP;
-insert into t1 values(1);
-select max(id) from t1;
-insert into t1 values(2);
-select max(id) from t1;
-replace into t1 values(1);
-drop table t1;
-
-create table t1 (n int) engine=heap;
-drop table t1;
-
-create table t1 (n int) engine=heap;
-drop table if exists t1;
-
-# Test of non unique index
-
-CREATE table t1(f1 int not null,f2 char(20) not
-null,index(f2)) engine=heap;
-INSERT into t1 set f1=12,f2="bill";
-INSERT into t1 set f1=13,f2="bill";
-INSERT into t1 set f1=14,f2="bill";
-INSERT into t1 set f1=15,f2="bill";
-INSERT into t1 set f1=16,f2="ted";
-INSERT into t1 set f1=12,f2="ted";
-INSERT into t1 set f1=12,f2="ted";
-INSERT into t1 set f1=12,f2="ted";
-INSERT into t1 set f1=12,f2="ted";
-delete from t1 where f2="bill";
-select * from t1;
-drop table t1;
-
-#
-# Test when using part key searches
-#
-
-create table t1 (btn char(10) not null, key using HASH (btn)) engine=heap;
-insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i");
-explain select * from t1 where btn like "q%";
-select * from t1 where btn like "q%";
-alter table t1 add column new_col char(1) not null, add key using HASH (btn,new_col), drop key btn;
-update t1 set new_col=left(btn,1);
-explain select * from t1 where btn="a";
-explain select * from t1 where btn="a" and new_col="a";
-drop table t1;
-
-#
-# Test of NULL keys
-#
-
-CREATE TABLE t1 (
- a int default NULL,
- b int default NULL,
- KEY a using HASH (a),
- UNIQUE b using HASH (b)
-) engine=heap;
-INSERT INTO t1 VALUES (NULL,99),(99,NULL),(1,1),(2,2),(1,3);
-SELECT * FROM t1 WHERE a=NULL;
-explain SELECT * FROM t1 WHERE a IS NULL;
-SELECT * FROM t1 WHERE a<=>NULL;
-SELECT * FROM t1 WHERE b=NULL;
-explain SELECT * FROM t1 WHERE b IS NULL;
-SELECT * FROM t1 WHERE b<=>NULL;
-
---error ER_DUP_ENTRY
-INSERT INTO t1 VALUES (1,3);
-DROP TABLE t1;
-
-#
-# Test when deleting all rows
-#
-
-CREATE TABLE t1 (a int not null, primary key using HASH (a)) engine=heap;
-INSERT into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11);
-DELETE from t1 where a < 100;
-SELECT * from t1;
-DROP TABLE t1;
-
-
-#
-# Hash index # records estimate test
-#
-create table t1
-(
- a char(8) not null,
- b char(20) not null,
- c int not null,
- key (a)
-) engine=heap;
-
-insert into t1 values ('aaaa', 'prefill-hash=5',0);
-insert into t1 values ('aaab', 'prefill-hash=0',0);
-insert into t1 values ('aaac', 'prefill-hash=7',0);
-insert into t1 values ('aaad', 'prefill-hash=2',0);
-insert into t1 values ('aaae', 'prefill-hash=1',0);
-insert into t1 values ('aaaf', 'prefill-hash=4',0);
-insert into t1 values ('aaag', 'prefill-hash=3',0);
-insert into t1 values ('aaah', 'prefill-hash=6',0);
-
-explain select * from t1 where a='aaaa';
-explain select * from t1 where a='aaab';
-explain select * from t1 where a='aaac';
-explain select * from t1 where a='aaad';
-insert into t1 select * from t1;
-
-# avoid statistics differences between normal and ps-protocol tests
-flush tables;
-explain select * from t1 where a='aaaa';
-explain select * from t1 where a='aaab';
-explain select * from t1 where a='aaac';
-explain select * from t1 where a='aaad';
-
-# a known effect: table reload causes statistics to be updated:
-flush tables;
-explain select * from t1 where a='aaaa';
-explain select * from t1 where a='aaab';
-explain select * from t1 where a='aaac';
-explain select * from t1 where a='aaad';
-
-# Check if delete_all_rows() updates #hash_buckets
-create table t2 as select * from t1;
-delete from t1;
-insert into t1 select * from t2;
-explain select * from t1 where a='aaaa';
-explain select * from t1 where a='aaab';
-explain select * from t1 where a='aaac';
-explain select * from t1 where a='aaad';
-drop table t1, t2;
-
-
-# Btree and hash index use costs.
-create table t1 (
- id int unsigned not null primary key auto_increment,
- name varchar(20) not null,
- index heap_idx(name),
- index btree_idx using btree(name)
-) engine=heap;
-
-create table t2 (
- id int unsigned not null primary key auto_increment,
- name varchar(20) not null,
- index btree_idx using btree(name),
- index heap_idx(name)
-) engine=heap;
-
-insert into t1 (name) values ('Matt'), ('Lilu'), ('Corbin'), ('Carly'),
- ('Suzy'), ('Hoppy'), ('Burrito'), ('Mimi'), ('Sherry'), ('Ben'), ('Phil'),
- ('Emily'), ('Mike');
-insert into t2 select * from t1;
-explain select * from t1 where name='matt';
-explain select * from t2 where name='matt';
-
-explain select * from t1 where name='Lilu';
-explain select * from t2 where name='Lilu';
-
-explain select * from t1 where name='Phil';
-explain select * from t2 where name='Phil';
-
-explain select * from t1 where name='Lilu';
-explain select * from t2 where name='Lilu';
-
-insert into t1 (name) select name from t2;
-insert into t1 (name) select name from t2;
-insert into t1 (name) select name from t2;
-insert into t1 (name) select name from t2;
-insert into t1 (name) select name from t2;
-insert into t1 (name) select name from t2;
-flush tables;
-select count(*) from t1 where name='Matt';
-explain select * from t1 ignore index (btree_idx) where name='matt';
-show index from t1;
-
-show index from t1;
-
-create table t3
-(
- a varchar(20) not null,
- b varchar(20) not null,
- key (a,b)
-) engine=heap;
-insert into t3 select name, name from t1;
-show index from t3;
-show index from t3;
-
-# test rec_per_key use for joins.
-explain select * from t1 ignore key(btree_idx), t3 where t1.name='matt' and t3.a = concat('',t1.name) and t3.b=t1.name;
-
-drop table t1, t2, t3;
-
-# Fix for BUG#8371: wrong rec_per_key value for hash index on temporary table
-create temporary table t1 ( a int, index (a) ) engine=memory;
-insert into t1 values (1),(2),(3),(4),(5);
-select a from t1 where a in (1,3);
-explain select a from t1 where a in (1,3);
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/help.test b/mysql-test/suite/pbxt/t/help.test
deleted file mode 100644
index 766c3da5b07..00000000000
--- a/mysql-test/suite/pbxt/t/help.test
+++ /dev/null
@@ -1,141 +0,0 @@
-# category: topic: keyword:
-#
-# impossible_category_1
-# impossible_function_1
-# impossible_function_5
-# impossible_function_2
-# impossible_function_1
-# impossible_category_2
-# impossible_function_3
-# impossible_function_6
-# impossible_function_4
-# impossible_function_6
-# impossible_category_3
-# impossible_function_7
-
-insert into mysql.help_category(help_category_id,name)values(10001,'impossible_category_1');
-select @category1_id:= 10001;
-insert into mysql.help_category(help_category_id,name)values(10002,'impossible_category_2');
-select @category2_id:= 10002;
-insert into mysql.help_category(help_category_id,name,parent_category_id)values(10003,'impossible_category_3',@category2_id);
-select @category3_id:= 10003;
-
-insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10101,'impossible_function_1',@category1_id,'description of \n impossible_function1\n','example of \n impossible_function1');
-select @topic1_id:= 10101;
-insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10102,'impossible_function_2',@category1_id,'description of \n impossible_function2\n','example of \n impossible_function2');
-select @topic2_id:= 10102;
-insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10103,'impossible_function_3',@category2_id,'description of \n impossible_function3\n','example of \n impossible_function3');
-select @topic3_id:= 10103;
-insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10104,'impossible_function_4',@category2_id,'description of \n impossible_function4\n','example of \n impossible_function4');
-select @topic4_id:= 10104;
-insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10105,'impossible_function_7',@category3_id,'description of \n impossible_function5\n','example of \n impossible_function7');
-select @topic5_id:= 10105;
-
-insert into mysql.help_keyword(help_keyword_id,name)values(10201,'impossible_function_1');
-select @keyword1_id:= 10201;
-insert into mysql.help_keyword(help_keyword_id,name)values(10202,'impossible_function_5');
-select @keyword2_id:= 10202;
-insert into mysql.help_keyword(help_keyword_id,name)values(10203,'impossible_function_6');
-select @keyword3_id:= 10203;
-
-insert into mysql.help_relation(help_keyword_id,help_topic_id)values(@keyword1_id,@topic2_id);
-insert into mysql.help_relation(help_keyword_id,help_topic_id)values(@keyword2_id,@topic1_id);
-insert into mysql.help_relation(help_keyword_id,help_topic_id)values(@keyword3_id,@topic3_id);
-insert into mysql.help_relation(help_keyword_id,help_topic_id)values(@keyword3_id,@topic4_id);
-
-##############
-help 'function_of_my_dream';
-help '%possible_f%';
-help 'impossible_func%';
-help 'impossible_category%';
-help 'impossible_%';
-
-help '%function_1';
-help '%function_2';
-help '%function_3';
-help '%function_4';
-help '%function_5';
-help '%function_6';
-help '%function_7';
-
-help '%category_2';
-help 'impossible_function_1';
-help 'impossible_category_1';
-##############
-
---disable_warnings
-alter table mysql.help_relation engine=innodb;
-alter table mysql.help_keyword engine=innodb;
-alter table mysql.help_topic engine=innodb;
-alter table mysql.help_category engine=innodb;
---enable_warnings
-
-##############
-help 'function_of_my_dream';
-help '%possible_f%';
-help 'impossible_func%';
-help 'impossible_category%';
-help 'impossible_%';
-
-help '%function_1';
-help '%function_2';
-help '%function_3';
-help '%function_4';
-help '%function_5';
-help '%function_6';
-help '%function_7';
-
-help '%category_2';
-help 'impossible_function_1';
-help 'impossible_category_1';
-##############
-
-alter table mysql.help_relation engine=myisam;
-alter table mysql.help_keyword engine=myisam;
-alter table mysql.help_topic engine=myisam;
-alter table mysql.help_category engine=myisam;
-
-delete from mysql.help_topic where help_topic_id=@topic1_id;
-delete from mysql.help_topic where help_topic_id=@topic2_id;
-delete from mysql.help_topic where help_topic_id=@topic3_id;
-delete from mysql.help_topic where help_topic_id=@topic4_id;
-delete from mysql.help_topic where help_topic_id=@topic5_id;
-
-delete from mysql.help_category where help_category_id=@category3_id;
-delete from mysql.help_category where help_category_id=@category2_id;
-delete from mysql.help_category where help_category_id=@category1_id;
-
-delete from mysql.help_keyword where help_keyword_id=@keyword1_id;
-delete from mysql.help_keyword where help_keyword_id=@keyword2_id;
-delete from mysql.help_keyword where help_keyword_id=@keyword3_id;
-
-delete from mysql.help_relation where help_keyword_id=@keyword1_id and help_topic_id=@topic2_id;
-delete from mysql.help_relation where help_keyword_id=@keyword2_id and help_topic_id=@topic1_id;
-delete from mysql.help_relation where help_keyword_id=@keyword3_id and help_topic_id=@topic3_id;
-delete from mysql.help_relation where help_keyword_id=@keyword3_id and help_topic_id=@topic4_id;
-
---echo End of 4.1 tests.
-
-#
-# Test that we can use HELP even under LOCK TABLES. See bug#9953:
-# CONVERT_TZ requires mysql.time_zone_name to be locked.
-#
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-CREATE TABLE t1 (i INT);
-
-LOCK TABLES t1 WRITE;
-
-HELP no_such_topic;
-
-UNLOCK TABLES;
-
-DROP TABLE t1;
-
-
---disable_query_log
-drop database pbxt;
---enable_query_log
---echo End of 5.1 tests.
diff --git a/mysql-test/suite/pbxt/t/insert.test b/mysql-test/suite/pbxt/t/insert.test
deleted file mode 100644
index 2ba41e12f71..00000000000
--- a/mysql-test/suite/pbxt/t/insert.test
+++ /dev/null
@@ -1,241 +0,0 @@
-#
-# Test of refering to old values
-#
-
---disable_warnings
-drop table if exists t1,t2,t3;
---enable_warnings
-
-create table t1 (a int not null);
-insert into t1 values (1);
-insert into t1 values (a+2);
-insert into t1 values (a+3),(a+4);
-insert into t1 values (5),(a+6);
-select * from t1;
-drop table t1;
-
-#
-# Test of duplicate key values with packed keys
-#
-
-create table t1 (id int not null auto_increment primary key, username varchar(32) not null, unique (username));
-insert into t1 values (0,"mysql");
-insert into t1 values (0,"mysql ab");
-insert into t1 values (0,"mysql a");
-insert into t1 values (0,"r1manic");
-insert into t1 values (0,"r1man");
-drop table t1;
-
-#
-# Test insert syntax
-#
-
-create table t1 (a int not null auto_increment, primary key (a), t timestamp, c char(10) default "hello", i int);
-insert into t1 values (default,default,default,default), (default,default,default,default), (4,0,"a",5),(default,default,default,default);
-select a,t>0,c,i from t1;
-truncate table t1;
-insert into t1 set a=default,t=default,c=default;
-insert into t1 set a=default,t=default,c=default,i=default;
-insert into t1 set a=4,t=0,c="a",i=5;
-insert into t1 set a=5,t=0,c="a",i=null;
-insert into t1 set a=default,t=default,c=default,i=default;
-select a,t>0,c,i from t1;
-drop table t1;
-
-#
-# Test problem with bulk insert and auto_increment on second part keys
-#
-
-create table t1 (sid char(20), id int(2) NOT NULL auto_increment, key(sid, id));
-insert into t1 values ('skr',NULL),('skr',NULL),('test',NULL);
-select * from t1;
-insert into t1 values ('rts',NULL),('rts',NULL),('test',NULL);
-select * from t1;
-drop table t1;
-
-#
-#Test of behaviour with INSERT VALUES (NULL)
-#
-
-create table t1 (id int NOT NULL DEFAULT 8);
--- error 1048
-insert into t1 values(NULL);
-insert into t1 values (1), (NULL), (2);
-select * from t1;
-drop table t1;
-
-#
-# Test if insert ... select distinct
-#
-
-create table t1 (email varchar(50));
-insert into t1 values ('sasha@mysql.com'),('monty@mysql.com'),('foo@hotmail.com'),('foo@aol.com'),('bar@aol.com');
-create table t2(id int not null auto_increment primary key, t2 varchar(50), unique(t2));
-# PBXT: DELAYED not supported
-#insert delayed into t2 (t2) select distinct substring(email, locate('@', email)+1) from t1;
-insert into t2 (t2) select distinct substring(email, locate('@', email)+1) from t1;
-select * from t2;
-drop table t1,t2;
-
-#
-# Test of mysqld crash with fully qualified column names
-#
-
---disable_warnings
-drop database if exists mysqltest;
---enable_warnings
-create database mysqltest;
-use mysqltest;
-create table t1 (c int);
-insert into mysqltest.t1 set mysqltest.t1.c = '1';
-drop database mysqltest;
-use test;
-
-#
-# Test of wrong values for float data (bug #2082)
-#
-
-# PS gives sligthly different numbers for max-float/max-double
---disable_ps_protocol
-create table t1(number int auto_increment primary key, original_value varchar(50), f_double double, f_float float, f_double_7_2 double(7,2), f_float_4_3 float (4,3), f_double_u double unsigned, f_float_u float unsigned, f_double_15_1_u double(15,1) unsigned, f_float_3_1_u float (3,1) unsigned);
-
-set @value= "aa";
-insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
---query_vertical select * from t1 where number =last_insert_id()
-
-set @value= "1aa";
-insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
---query_vertical select * from t1 where number =last_insert_id()
-
-set @value= "aa1";
-insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
---query_vertical select * from t1 where number =last_insert_id()
-
-set @value= "1e+1111111111a";
-insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
---query_vertical select * from t1 where number =last_insert_id()
-
-set @value= "-1e+1111111111a";
-insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
---query_vertical select * from t1 where number =last_insert_id()
-
---error 1367
-set @value= 1e+1111111111;
---error 1367
-set @value= -1e+1111111111;
-
-
-set @value= 1e+111;
-insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
---query_vertical select * from t1 where number =last_insert_id()
-
-set @value= -1e+111;
-insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
---query_vertical select * from t1 where number =last_insert_id()
-
-set @value= 1;
-insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
---query_vertical select * from t1 where number =last_insert_id()
-
-set @value= -1;
-insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
---query_vertical select * from t1 where number =last_insert_id()
-
-drop table t1;
---enable_ps_protocol
-
-# End of 4.1 tests
-
-#
-# Test automatic result buffering with INSERT INTO t1 ... SELECT ... FROM t1
-#
-
-create table t1(id1 int not null auto_increment primary key, t char(12));
-create table t2(id2 int not null, t char(12));
-create table t3(id3 int not null, t char(12), index(id3));
-disable_query_log;
-let $1 = 100;
-while ($1)
- {
- let $2 = 5;
- eval insert into t1(t) values ('$1');
- while ($2)
- {
- eval insert into t2(id2,t) values ($1,'$2');
- let $3 = 10;
- while ($3)
- {
- eval insert into t3(id3,t) values ($1,'$2');
- dec $3;
- }
- dec $2;
- }
- dec $1;
- }
-enable_query_log;
-select count(*) from t2;
-insert into t2 select t1.* from t1, t2 t, t3 where t1.id1 = t.id2 and t.id2 = t3.id3;
-select count(*) from t2;
-drop table t1,t2,t3;
-
-#
-# Test different cases of duplicate fields
-#
-
-create table t1 (a int, b int);
-insert into t1 (a,b) values (a,b);
-insert into t1 SET a=1, b=a+1;
-insert into t1 (a,b) select 1,2;
-INSERT INTO t1 ( a ) SELECT 0 ON DUPLICATE KEY UPDATE a = a + VALUES (a);
-prepare stmt1 from ' replace into t1 (a,a) select 100, ''hundred'' ';
---error 1110
-execute stmt1;
---error 1110
-insert into t1 (a,b,b) values (1,1,1);
---error 1136
-insert into t1 (a,a) values (1,1,1);
---error 1110
-insert into t1 (a,a) values (1,1);
---error 1110
-insert into t1 SET a=1,b=2,a=1;
---error 1110
-insert into t1 (b,b) select 1,2;
---error 1110
-INSERT INTO t1 (b,b) SELECT 0,0 ON DUPLICATE KEY UPDATE a = a + VALUES (a);
-drop table t1;
-
-#
-# Test for values returned by ROW_COUNT() function
-# (and thus for values returned by mysql_affected_rows())
-# for various forms of INSERT
-#
-create table t1 (id int primary key, data int);
-insert into t1 values (1, 1), (2, 2), (3, 3);
-select row_count();
-insert ignore into t1 values (1, 1);
-select row_count();
-# Reports that 2 rows are affected (1 deleted + 1 inserted)
-replace into t1 values (1, 11);
-select row_count();
-replace into t1 values (4, 4);
-select row_count();
-# Reports that 2 rows are affected. This conforms to documentation.
-# (Useful for differentiating inserts from updates).
-insert into t1 values (2, 2) on duplicate key update data= data + 10;
-select row_count();
-insert into t1 values (5, 5) on duplicate key update data= data + 10;
-select row_count();
-drop table t1;
-
-# Test of INSERT IGNORE and re-using auto_increment values
-create table t1 (id int primary key auto_increment, data int, unique(data));
-insert ignore into t1 values(NULL,100),(NULL,110),(NULL,120);
-insert ignore into t1 values(NULL,10),(NULL,20),(NULL,110),(NULL,120),(NULL,100),(NULL,90);
-insert ignore into t1 values(NULL,130),(NULL,140),(500,110),(550,120),(450,100),(NULL,150);
-select * from t1 order by id;
-
-
---disable_query_log
-drop table if exists t1;
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/insert_select.test b/mysql-test/suite/pbxt/t/insert_select.test
deleted file mode 100644
index 7adb6290c10..00000000000
--- a/mysql-test/suite/pbxt/t/insert_select.test
+++ /dev/null
@@ -1,272 +0,0 @@
-#
-# Problem with INSERT ... SELECT
-#
-
---disable_warnings
-drop table if exists t1,t2,t3;
---enable_warnings
-
-create table t1 (bandID MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY, payoutID SMALLINT UNSIGNED NOT NULL);
-insert into t1 (bandID,payoutID) VALUES (1,6),(2,6),(3,4),(4,9),(5,10),(6,1),(7,12),(8,12);
-create table t2 (payoutID SMALLINT UNSIGNED NOT NULL PRIMARY KEY);
-insert into t2 (payoutID) SELECT DISTINCT payoutID FROM t1;
---error ER_DUP_ENTRY
-insert into t2 (payoutID) SELECT payoutID+10 FROM t1;
-insert ignore into t2 (payoutID) SELECT payoutID+10 FROM t1;
-select * from t2;
-drop table t1,t2;
-
-#
-# bug in bulk insert optimization
-# test case by Fournier Jocelyn <joc@presence-pc.com>
-#
-
-CREATE TABLE `t1` (
- `numeropost` bigint(20) unsigned NOT NULL default '0',
- `icone` tinyint(4) unsigned NOT NULL default '0',
- `numreponse` bigint(20) unsigned NOT NULL auto_increment,
- `contenu` text NOT NULL,
- `pseudo` varchar(50) NOT NULL default '',
- `date` datetime NOT NULL default '0000-00-00 00:00:00',
- `ip` bigint(11) NOT NULL default '0',
- `signature` tinyint(1) unsigned NOT NULL default '0',
- PRIMARY KEY (`numeropost`,`numreponse`)
- ,KEY `ip` (`ip`),
- KEY `date` (`date`),
- KEY `pseudo` (`pseudo`),
- KEY `numreponse` (`numreponse`)
-) ENGINE=MyISAM;
-
-CREATE TABLE `t2` (
- `numeropost` bigint(20) unsigned NOT NULL default '0',
- `icone` tinyint(4) unsigned NOT NULL default '0',
- `numreponse` bigint(20) unsigned NOT NULL auto_increment,
- `contenu` text NOT NULL,
- `pseudo` varchar(50) NOT NULL default '',
- `date` datetime NOT NULL default '0000-00-00 00:00:00',
- `ip` bigint(11) NOT NULL default '0',
- `signature` tinyint(1) unsigned NOT NULL default '0',
- PRIMARY KEY (`numeropost`,`numreponse`),
- KEY `ip` (`ip`),
- KEY `date` (`date`),
- KEY `pseudo` (`pseudo`),
- KEY `numreponse` (`numreponse`)
-) ENGINE=MyISAM;
-
-INSERT INTO t2
-(numeropost,icone,numreponse,contenu,pseudo,date,ip,signature) VALUES
-(9,1,56,'test','joce','2001-07-25 13:50:53'
-,3649052399,0);
-
-
-INSERT INTO t1 (numeropost,icone,contenu,pseudo,date,signature,ip)
-SELECT 1618,icone,contenu,pseudo,date,signature,ip FROM t2
-WHERE numeropost=9 ORDER BY numreponse ASC;
-
-show variables like '%bulk%';
-
-INSERT INTO t1 (numeropost,icone,contenu,pseudo,date,signature,ip)
-SELECT 1718,icone,contenu,pseudo,date,signature,ip FROM t2
-WHERE numeropost=9 ORDER BY numreponse ASC;
-
-DROP TABLE t1,t2;
-
-#
-# Test of insert ... select from same table
-#
-
-create table t1 (a int not null);
-create table t2 (a int not null);
-insert into t1 values (1);
-insert into t1 values (a+2);
-insert into t1 values (a+3);
-insert into t1 values (4),(a+5);
-insert into t1 select * from t1;
-select * from t1;
-insert into t1 select * from t1 as t2;
-select * from t1;
-insert into t2 select * from t1 as t2;
-select * from t1;
-insert into t1 select t2.a from t1,t2;
-select * from t1;
---error 1066
-insert into t1 select * from t1,t1;
-drop table t1,t2;
-
-#
-# test replace ... select
-#
-
-create table t1 (a int not null primary key, b char(10));
-create table t2 (a int not null, b char(10));
-insert into t1 values (1,"t1:1"),(3,"t1:3");
-insert into t2 values (2,"t2:2"), (3,"t2:3");
---error ER_DUP_ENTRY
-insert into t1 select * from t2;
-select * from t1;
-# REPLACE .. SELECT is not yet supported by PS
-replace into t1 select * from t2;
---sorted_result
-select * from t1;
-drop table t1,t2;
-
-#
-# Test that caused uninitialized memory access in auto_increment_key update
-#
-
-CREATE TABLE t1 ( USID INTEGER UNSIGNED, ServerID TINYINT UNSIGNED, State ENUM ('unknown', 'Access-Granted', 'Session-Active', 'Session-Closed' ) NOT NULL DEFAULT 'unknown', SessionID CHAR(32), User CHAR(32) NOT NULL DEFAULT '<UNKNOWN>', NASAddr INTEGER UNSIGNED, NASPort INTEGER UNSIGNED, NASPortType INTEGER UNSIGNED, ConnectSpeed INTEGER UNSIGNED, CarrierType CHAR(32), CallingStationID CHAR(32), CalledStationID CHAR(32), AssignedAddr INTEGER UNSIGNED, SessionTime INTEGER UNSIGNED, PacketsIn INTEGER UNSIGNED, OctetsIn INTEGER UNSIGNED, PacketsOut INTEGER UNSIGNED, OctetsOut INTEGER UNSIGNED, TerminateCause INTEGER UNSIGNED, UnauthTime TINYINT UNSIGNED, AccessRequestTime DATETIME, AcctStartTime DATETIME, AcctLastTime DATETIME, LastModification TIMESTAMP NOT NULL);
-CREATE TABLE t2 ( USID INTEGER UNSIGNED AUTO_INCREMENT, ServerID TINYINT UNSIGNED, State ENUM ('unknown', 'Access-Granted', 'Session-Active', 'Session-Closed' ) NOT NULL DEFAULT 'unknown', SessionID CHAR(32), User TEXT NOT NULL, NASAddr INTEGER UNSIGNED, NASPort INTEGER UNSIGNED, NASPortType INTEGER UNSIGNED, ConnectSpeed INTEGER UNSIGNED, CarrierType CHAR(32), CallingStationID CHAR(32), CalledStationID CHAR(32), AssignedAddr INTEGER UNSIGNED, SessionTime INTEGER UNSIGNED, PacketsIn INTEGER UNSIGNED, OctetsIn INTEGER UNSIGNED, PacketsOut INTEGER UNSIGNED, OctetsOut INTEGER UNSIGNED, TerminateCause INTEGER UNSIGNED, UnauthTime TINYINT UNSIGNED, AccessRequestTime DATETIME, AcctStartTime DATETIME, AcctLastTime DATETIME, LastModification TIMESTAMP NOT NULL, INDEX(USID,ServerID,NASAddr,SessionID), INDEX(AssignedAddr));
-INSERT INTO t1 VALUES (39,42,'Access-Granted','46','491721000045',2130706433,17690,NULL,NULL,'Localnet','491721000045','49172200000',754974766,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2003-07-18 00:11:21',NULL,NULL,20030718001121);
-INSERT INTO t2 SELECT USID, ServerID, State, SessionID, User, NASAddr, NASPort, NASPortType, ConnectSpeed, CarrierType, CallingStationID, CalledStationID, AssignedAddr, SessionTime, PacketsIn, OctetsIn, PacketsOut, OctetsOut, TerminateCause, UnauthTime, AccessRequestTime, AcctStartTime, AcctLastTime, LastModification from t1 LIMIT 1;
-drop table t1,t2;
-
-#
-# Another problem from Bug #2012
-#
-
-CREATE TABLE t1(
- Month date NOT NULL,
- Type tinyint(3) unsigned NOT NULL auto_increment,
- Field int(10) unsigned NOT NULL,
- Count int(10) unsigned NOT NULL,
- UNIQUE KEY Month (Month,Type,Field)
-);
-
-insert into t1 Values
-(20030901, 1, 1, 100),
-(20030901, 1, 2, 100),
-(20030901, 2, 1, 100),
-(20030901, 2, 2, 100),
-(20030901, 3, 1, 100);
-
-select * from t1;
-
-Select null, Field, Count From t1 Where Month=20030901 and Type=2;
-
-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;
-
-select * from t2;
-
-drop table t1, t2;
-
-#
-# BUG#6034 - Error code 124: Wrong medium type
-#
-CREATE TABLE t1 (
- ID int(11) NOT NULL auto_increment,
- NO int(11) NOT NULL default '0',
- SEQ int(11) NOT NULL default '0',
- PRIMARY KEY (ID),
- KEY t1$NO (SEQ,NO)
-) ENGINE=MyISAM;
-INSERT INTO t1 (SEQ, NO) SELECT "1" AS SEQ, IF(MAX(NO) IS NULL, 0, MAX(NO)) + 1 AS NO FROM t1 WHERE (SEQ = 1);
-select SQL_BUFFER_RESULT * from t1 WHERE (SEQ = 1);
-drop table t1;
-
-#
-# Bug#10886 - Have to restore default values after update ON DUPLICATE KEY
-#
-create table t1 (f1 int);
-create table t2 (ff1 int unique, ff2 int default 1);
-insert into t1 values (1),(1),(2);
-insert into t2(ff1) select f1 from t1 on duplicate key update ff2=ff2+1;
-select * from t2;
-drop table t1, t2;
-#
-# BUGS #9728 - 'Decreased functionality in "on duplicate key update"'
-# #8147 - 'a column proclaimed ambigous in INSERT ... SELECT .. ON
-# DUPLICATE'
-#
-create table t1 (a int unique);
-create table t2 (a int, b int);
-create table t3 (c int, d int);
-insert into t1 values (1),(2);
-insert into t2 values (1,2);
-insert into t3 values (1,6),(3,7);
-select * from t1;
-insert into t1 select a from t2 on duplicate key update a= t1.a + t2.b;
-select * from t1;
-insert into t1 select a+1 from t2 on duplicate key update t1.a= t1.a + t2.b+1;
-select * from t1;
-insert into t1 select t3.c from t3 on duplicate key update a= a + t3.d;
-select * from t1;
-insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= a + 10;
-
-#Some error cases
---error 1052
-insert into t1 select t2.a from t2 on duplicate key update a= a + t2.b;
---error 1054
-insert into t1 select t2.a from t2 on duplicate key update t2.a= a + t2.b;
---error 1054
-insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= t1.a + t2.b;
-drop table t1,t2,t3;
-
-#
-# Bug #12695 Item_func_isnull::update_used_tables() did not update
-# const_item_cache
-create table t1(f1 varchar(5) key);
-insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1;
-insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1;
-insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1;
-select * from t1;
-drop table t1;
-
-#
-# Bug #13392 values() fails with 'ambiguous' or returns NULL
-# with ON DUPLICATE and SELECT
-create table t1(x int, y int);
-create table t2(x int, z int);
-insert into t1(x,y) select x,z from t2 on duplicate key update x=values(x);
---error 1054
-insert into t1(x,y) select x,z from t2 on duplicate key update x=values(z);
---error 1054
-insert into t1(x,y) select x,z from t2 on duplicate key update x=values(t2.x);
-drop table t1,t2;
-
-#
-# Bug #9676: INSERT INTO x SELECT .. FROM x LIMIT 1; slows down with big
-# tables
-#
-
-#Note: not an exsaustive test : just a check of the code path.
-CREATE TABLE t1 (a int PRIMARY KEY);
-INSERT INTO t1 values (1), (2);
-
-INSERT INTO t1 SELECT a + 2 FROM t1 LIMIT 1;
-
-DROP TABLE t1;
-
-# End of 4.1 tests
-
-#
-# Bug #18080: INSERT ... SELECT ... JOIN results in ambiguous field list error
-#
-CREATE TABLE t1 (x int, y int);
-CREATE TABLE t2 (z int, y int);
-CREATE TABLE t3 (a int, b int);
-INSERT INTO t3 (SELECT x, y FROM t1 JOIN t2 USING (y) WHERE z = 1);
-DROP TABLE IF EXISTS t1,t2,t3;
-
-#
-# Bug #21774: Column count doesn't match value count at row x
-#
-CREATE DATABASE bug21774_1;
-CREATE DATABASE bug21774_2;
-
-CREATE TABLE bug21774_1.t1(id VARCHAR(10) NOT NULL,label VARCHAR(255));
-CREATE TABLE bug21774_2.t1(id VARCHAR(10) NOT NULL,label VARCHAR(255));
-CREATE TABLE bug21774_1.t2(id VARCHAR(10) NOT NULL,label VARCHAR(255));
-
-INSERT INTO bug21774_2.t1 SELECT t1.* FROM bug21774_1.t1;
-
-use bug21774_1;
-INSERT INTO bug21774_2.t1 SELECT t1.* FROM t1;
-
-DROP DATABASE bug21774_1;
-DROP DATABASE bug21774_2;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/insert_update.test b/mysql-test/suite/pbxt/t/insert_update.test
deleted file mode 100644
index 1a6fb5f2d90..00000000000
--- a/mysql-test/suite/pbxt/t/insert_update.test
+++ /dev/null
@@ -1,147 +0,0 @@
---disable_warnings
-DROP TABLE IF EXISTS t1, t2;
---enable_warnings
-
-CREATE TABLE t1 (a INT, b INT, c INT, UNIQUE (A), UNIQUE(B));
-INSERT t1 VALUES (1,2,10), (3,4,20);
-INSERT t1 VALUES (5,6,30) ON DUPLICATE KEY UPDATE c=c+100;
-SELECT * FROM t1;
-INSERT t1 VALUES (5,7,40) ON DUPLICATE KEY UPDATE c=c+100;
-SELECT * FROM t1;
-INSERT t1 VALUES (8,4,50) ON DUPLICATE KEY UPDATE c=c+1000;
-SELECT * FROM t1 order by a; # PBXT required ORDER for consistant result
-INSERT t1 VALUES (1,4,60) ON DUPLICATE KEY UPDATE c=c+10000;
-SELECT * FROM t1 order by a; # PBXT required ORDER for consistant result
--- error ER_DUP_ENTRY
-INSERT t1 VALUES (1,9,70) ON DUPLICATE KEY UPDATE c=c+100000, b=4;
-SELECT * FROM t1 order by a; # PBXT required ORDER for consistant result
-TRUNCATE TABLE t1;
-INSERT t1 VALUES (1,2,10), (3,4,20);
-INSERT t1 VALUES (5,6,30), (7,4,40), (8,9,60) ON DUPLICATE KEY UPDATE c=c+100;
-SELECT * FROM t1;
-INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0;
-SELECT * FROM t1 order by a; # PBXT required ORDER for consistant result
-INSERT t1 VALUES (2,1,11), (7,4,40) ON DUPLICATE KEY UPDATE c=c+VALUES(a);
-SELECT *, VALUES(a) FROM t1 order by a; # PBXT required ORDER for consistant result
---replace_column 9 ROWS
-explain extended SELECT *, VALUES(a) FROM t1;
---replace_column 9 ROWS
-explain extended select * from t1 where values(a);
-DROP TABLE t1;
-
-#
-# test for Bug #2709 "Affected Rows for ON DUPL.KEY undocumented,
-# perhaps illogical"
-#
-create table t1(a int primary key, b int);
-insert into t1 values(1,1),(2,2),(3,3),(4,4),(5,5);
-select * from t1;
-
---enable_info
-insert into t1 values(4,14),(5,15),(6,16),(7,17),(8,18)
- on duplicate key update b=b+10;
---disable_info
-
-select * from t1;
-
-enable_info;
-replace into t1 values(5,25),(6,26),(7,27),(8,28),(9,29);
-disable_info;
-
-select * from t1 order by a; # PBXT required for consistent order
-drop table t1;
-
-# WorkLog #2274 - enable INSERT .. SELECT .. UPDATE syntax
-# Same tests as beginning of this test except that insert source
-# is a result from a select statement
-#
-CREATE TABLE t1 (a INT, b INT, c INT, UNIQUE (A), UNIQUE(B));
-INSERT t1 VALUES (1,2,10), (3,4,20);
-INSERT t1 SELECT 5,6,30 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100;
-SELECT * FROM t1 order by a; # PBXT required ORDER for consistant result
-INSERT t1 SELECT 5,7,40 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100;
-SELECT * FROM t1 order by a; # PBXT required ORDER for consistant result
-INSERT t1 SELECT 8,4,50 FROM DUAL ON DUPLICATE KEY UPDATE c=c+1000;
-SELECT * FROM t1 order by a; # PBXT required ORDER for consistant result
-INSERT t1 SELECT 1,4,60 FROM DUAL ON DUPLICATE KEY UPDATE c=c+10000;
-SELECT * FROM t1 order by a; # PBXT required ORDER for consistant result
--- error ER_DUP_ENTRY
-INSERT t1 SELECT 1,9,70 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100000, b=4;
-SELECT * FROM t1 order by a; # PBXT required ORDER for consistant result
-TRUNCATE TABLE t1;
-INSERT t1 VALUES (1,2,10), (3,4,20);
-CREATE TABLE t2 (a INT, b INT, c INT, d INT);
-# column names deliberately clash with columns in t1 (Bug#8147)
-INSERT t2 VALUES (5,6,30,1), (7,4,40,1), (8,9,60,1);
-INSERT t2 VALUES (2,1,11,2), (7,4,40,2);
-INSERT t1 SELECT a,b,c FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=t1.c+100;
-SELECT * FROM t1;
-INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0;
-SELECT * FROM t1 order by a; # PBXT required ORDER for consistant result
---error 1052
-INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a);
-INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=t1.c+VALUES(t1.a);
-SELECT *, VALUES(a) FROM t1 order by a; # PBXT required ORDER for consistant result
-DROP TABLE t1;
-DROP TABLE t2;
-
-#
-# Bug#9725 - "disapearing query/hang" and "unknown error" with "on duplicate key update"
-# INSERT INGORE...UPDATE gives bad error or breaks protocol.
-#
-create table t1 (a int not null unique) engine=myisam;
-insert into t1 values (1),(2);
-insert ignore into t1 select 1 on duplicate key update a=2;
-select * from t1;
-insert ignore into t1 select a from t1 as t2 on duplicate key update a=t1.a+1 ;
-select * from t1;
-insert into t1 select 1 on duplicate key update a=2;
-select * from t1;
---error 1052
-insert into t1 select a from t1 on duplicate key update a=a+1 ;
---error 1052
-insert ignore into t1 select a from t1 on duplicate key update a=t1.a+1 ;
-drop table t1;
-
-#
-# Bug#10109 - INSERT .. SELECT ... ON DUPLICATE KEY UPDATE fails
-# Bogus "Duplicate columns" error message
-#
-
-CREATE TABLE t1 (
- a BIGINT(20) NOT NULL DEFAULT 0,
- PRIMARY KEY (a)
-) ENGINE=MyISAM;
-
-INSERT INTO t1 ( a ) SELECT 0 ON DUPLICATE KEY UPDATE a = a + VALUES (a) ;
-
-DROP TABLE t1;
-
-#
-# Bug#21555: incorrect behavior with INSERT ... ON DUPL KEY UPDATE and VALUES
-#
-
-
-# End of 4.1 tests
-CREATE TABLE t1
-(
- a BIGINT UNSIGNED,
- b BIGINT UNSIGNED,
- PRIMARY KEY (a)
-);
-
-INSERT INTO t1 VALUES (45, 1) ON DUPLICATE KEY UPDATE b =
- IF(VALUES(b) > t1.b, VALUES(b), t1.b);
-SELECT * FROM t1;
-INSERT INTO t1 VALUES (45, 2) ON DUPLICATE KEY UPDATE b =
- IF(VALUES(b) > t1.b, VALUES(b), t1.b);
-SELECT * FROM t1;
-INSERT INTO t1 VALUES (45, 1) ON DUPLICATE KEY UPDATE b =
- IF(VALUES(b) > t1.b, VALUES(b), t1.b);
-SELECT * FROM t1;
-
-DROP TABLE t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/join.test b/mysql-test/suite/pbxt/t/join.test
deleted file mode 100644
index fe73c67a6a3..00000000000
--- a/mysql-test/suite/pbxt/t/join.test
+++ /dev/null
@@ -1,659 +0,0 @@
-#
-# Initialization
---disable_warnings
-drop table if exists t1,t2,t3;
---enable_warnings
-
-SET @save_optimizer_switch=@@optimizer_switch;
-SET optimizer_switch='outer_join_with_cache=off';
-
-#
-# Test different join syntaxes
-#
-
-CREATE TABLE t1 (S1 INT);
-CREATE TABLE t2 (S1 INT);
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (2);
-SELECT * FROM t1 JOIN t2;
-SELECT * FROM t1 INNER JOIN t2;
-SELECT * from t1 JOIN t2 USING (S1);
-SELECT * FROM t1 INNER JOIN t2 USING (S1);
-SELECT * from t1 CROSS JOIN t2;
-SELECT * from t1 LEFT JOIN t2 USING(S1);
-SELECT * from t1 LEFT JOIN t2 ON(t2.S1=2);
-SELECT * from t1 RIGHT JOIN t2 USING(S1);
-SELECT * from t1 RIGHT JOIN t2 ON(t1.S1=1);
-drop table t1,t2;
-
-#
-# This failed for lia Perminov
-#
-
-create table t1 (id int primary key);
-create table t2 (id int);
-insert into t1 values (75);
-insert into t1 values (79);
-insert into t1 values (78);
-insert into t1 values (77);
-replace into t1 values (76);
-replace into t1 values (76);
-insert into t1 values (104);
-insert into t1 values (103);
-insert into t1 values (102);
-insert into t1 values (101);
-insert into t1 values (105);
-insert into t1 values (106);
-insert into t1 values (107);
-
-insert into t2 values (107),(75),(1000);
-
-select t1.id, t2.id from t1, t2 where t2.id = t1.id;
-select t1.id, count(t2.id) from t1,t2 where t2.id = t1.id group by t1.id;
-select t1.id, count(t2.id) from t1,t2 where t2.id = t1.id group by t2.id;
-
-#
-# Test problems with impossible ON or WHERE
-#
-select t1.id,t2.id from t2 left join t1 on t1.id>=74 and t1.id<=0 where t2.id=75 and t1.id is null;
-explain select t1.id,t2.id from t2 left join t1 on t1.id>=74 and t1.id<=0 where t2.id=75 and t1.id is null;
-explain select t1.id, t2.id from t1, t2 where t2.id = t1.id and t1.id <0 and t1.id > 0;
-drop table t1,t2;
-
-#
-# problem with join
-#
-
-CREATE TABLE t1 (
- id int(11) NOT NULL auto_increment,
- token varchar(100) DEFAULT '' NOT NULL,
- count int(11) DEFAULT '0' NOT NULL,
- qty int(11),
- phone char(1) DEFAULT '' NOT NULL,
- timestamp datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
- PRIMARY KEY (id),
- KEY token (token(15)),
- KEY timestamp (timestamp),
- UNIQUE token_2 (token(75),count,phone)
-);
-
-INSERT INTO t1 VALUES (21,'e45703b64de71482360de8fec94c3ade',3,7800,'n','1999-12-23 17:22:21');
-INSERT INTO t1 VALUES (22,'e45703b64de71482360de8fec94c3ade',4,5000,'y','1999-12-23 17:22:21');
-INSERT INTO t1 VALUES (18,'346d1cb63c89285b2351f0ca4de40eda',3,13200,'b','1999-12-23 11:58:04');
-INSERT INTO t1 VALUES (17,'ca6ddeb689e1b48a04146b1b5b6f936a',4,15000,'b','1999-12-23 11:36:53');
-INSERT INTO t1 VALUES (16,'ca6ddeb689e1b48a04146b1b5b6f936a',3,13200,'b','1999-12-23 11:36:53');
-INSERT INTO t1 VALUES (26,'a71250b7ed780f6ef3185bfffe027983',5,1500,'b','1999-12-27 09:44:24');
-INSERT INTO t1 VALUES (24,'4d75906f3c37ecff478a1eb56637aa09',3,5400,'y','1999-12-23 17:29:12');
-INSERT INTO t1 VALUES (25,'4d75906f3c37ecff478a1eb56637aa09',4,6500,'y','1999-12-23 17:29:12');
-INSERT INTO t1 VALUES (27,'a71250b7ed780f6ef3185bfffe027983',3,6200,'b','1999-12-27 09:44:24');
-INSERT INTO t1 VALUES (28,'a71250b7ed780f6ef3185bfffe027983',3,5400,'y','1999-12-27 09:44:36');
-INSERT INTO t1 VALUES (29,'a71250b7ed780f6ef3185bfffe027983',4,17700,'b','1999-12-27 09:45:05');
-
-CREATE TABLE t2 (
- id int(11) NOT NULL auto_increment,
- category int(11) DEFAULT '0' NOT NULL,
- county int(11) DEFAULT '0' NOT NULL,
- state int(11) DEFAULT '0' NOT NULL,
- phones int(11) DEFAULT '0' NOT NULL,
- nophones int(11) DEFAULT '0' NOT NULL,
- PRIMARY KEY (id),
- KEY category (category,county,state)
-);
-INSERT INTO t2 VALUES (3,2,11,12,5400,7800);
-INSERT INTO t2 VALUES (4,2,25,12,6500,11200);
-INSERT INTO t2 VALUES (5,1,37,6,10000,12000);
-select a.id, b.category as catid, b.state as stateid, b.county as countyid from t1 a, t2 b ignore index (primary) where (a.token ='a71250b7ed780f6ef3185bfffe027983') and (a.count = b.id);
-select a.id, b.category as catid, b.state as stateid, b.county as
-countyid from t1 a, t2 b where (a.token =
-'a71250b7ed780f6ef3185bfffe027983') and (a.count = b.id) order by a.id;
-
-drop table t1, t2;
-
-#
-# Test of join of many tables.
-
-create table t1 (a int primary key);
-insert into t1 values(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);
---replace_result "31 tables" "XX tables" "61 tables" "XX tables"
---error 1116
-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);
-select 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);
---replace_result "31 tables" "XX tables" "61 tables" "XX tables"
---error 1116
-select 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);
-drop table t1;
-
-#
-# Simple join test. This failed in 3.23.42, there should have been
-# no matches, still three matches were found.
-#
-
-CREATE TABLE t1 (
- a int(11) NOT NULL,
- b int(11) NOT NULL,
- PRIMARY KEY (a,b)
-) ENGINE=MyISAM;
-
-INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(2,3);
-
-CREATE TABLE t2 (
- a int(11) default NULL
-) ENGINE=MyISAM;
-INSERT INTO t2 VALUES (2),(3);
-SELECT t1.a,t2.a,b FROM t1,t2 WHERE t1.a=t2.a AND (t1.a=1 OR t1.a=2) AND b>=1 AND b<=3;
-DROP TABLE t1, t2;
-
-#
-# TEST LEFT JOIN with DATE columns
-#
-
-CREATE TABLE t1 (d DATE NOT NULL);
-CREATE TABLE t2 (d DATE NOT NULL);
-INSERT INTO t1 (d) VALUES ('2001-08-01'),('0000-00-00');
-SELECT * FROM t1 LEFT JOIN t2 USING (d) WHERE t2.d IS NULL;
-SELECT * FROM t1 LEFT JOIN t2 USING (d) WHERE d IS NULL;
-SELECT * from t1 WHERE t1.d IS NULL;
-SELECT * FROM t1 WHERE 1/0 IS NULL;
-DROP TABLE t1,t2;
-
-#
-# Problem with reference from const tables
-#
-CREATE TABLE t1 (
- Document_ID varchar(50) NOT NULL default '',
- Contractor_ID varchar(6) NOT NULL default '',
- Language_ID char(3) NOT NULL default '',
- Expiration_Date datetime default NULL,
- Publishing_Date datetime default NULL,
- Title text,
- Column_ID varchar(50) NOT NULL default '',
- PRIMARY KEY (Language_ID,Document_ID,Contractor_ID)
-);
-
-INSERT INTO t1 VALUES ('xep80','1','ger','2001-12-31 20:00:00','2001-11-12 10:58:00','Kartenbestellung - jetzt auch online','anle'),('','999998','',NULL,NULL,NULL,'');
-
-CREATE TABLE t2 (
- Contractor_ID char(6) NOT NULL default '',
- Language_ID char(3) NOT NULL default '',
- Document_ID char(50) NOT NULL default '',
- CanRead char(1) default NULL,
- Customer_ID int(11) NOT NULL default '0',
- PRIMARY KEY (Contractor_ID,Language_ID,Document_ID,Customer_ID)
-);
-
-INSERT INTO t2 VALUES ('5','ger','xep80','1',999999),('1','ger','xep80','1',999999);
-CREATE TABLE t3 (
- Language_ID char(3) NOT NULL default '',
- Column_ID char(50) NOT NULL default '',
- Contractor_ID char(6) NOT NULL default '',
- CanRead char(1) default NULL,
- Active char(1) default NULL,
- PRIMARY KEY (Language_ID,Column_ID,Contractor_ID)
-);
-INSERT INTO t3 VALUES ('ger','home','1','1','1'),('ger','Test','1','0','0'),('ger','derclu','1','0','0'),('ger','clubne','1','0','0'),('ger','philos','1','0','0'),('ger','clubko','1','0','0'),('ger','clubim','1','1','1'),('ger','progra','1','0','0'),('ger','progvo','1','0','0'),('ger','progsp','1','0','0'),('ger','progau','1','0','0'),('ger','progku','1','0','0'),('ger','progss','1','0','0'),('ger','nachl','1','0','0'),('ger','mitgli','1','0','0'),('ger','mitsu','1','0','0'),('ger','mitbus','1','0','0'),('ger','ergmar','1','1','1'),('ger','home','4','1','1'),('ger','derclu','4','1','1'),('ger','clubne','4','0','0'),('ger','philos','4','1','1'),('ger','clubko','4','1','1'),('ger','clubim','4','1','1'),('ger','progra','4','1','1'),('ger','progvo','4','1','1'),('ger','progsp','4','1','1'),('ger','progau','4','0','0'),('ger','progku','4','1','1'),('ger','progss','4','1','1'),('ger','nachl','4','1','1'),('ger','mitgli','4','0','0'),('ger','mitsu','4','0','0'),('ger','mitbus','4','0','0'),('ger','ergmar','4','1','1'),('ger','progra2','1','0','0'),('ger','archiv','4','1','1'),('ger','anmeld','4','1','1'),('ger','thema','4','1','1'),('ger','edito','4','1','1'),('ger','madis','4','1','1'),('ger','enma','4','1','1'),('ger','madis','1','1','1'),('ger','enma','1','1','1'),('ger','vorsch','4','0','0'),('ger','veranst','4','0','0'),('ger','anle','4','1','1'),('ger','redak','4','1','1'),('ger','nele','4','1','1'),('ger','aukt','4','1','1'),('ger','callcenter','4','1','1'),('ger','anle','1','0','0');
-delete from t1 where Contractor_ID='999998';
-insert into t1 (Contractor_ID) Values ('999998');
-SELECT DISTINCT COUNT(t1.Title) FROM t1,
-t2, t3 WHERE
-t1.Document_ID='xep80' AND t1.Contractor_ID='1' AND
-t1.Language_ID='ger' AND '2001-12-21 23:14:24' >=
-Publishing_Date AND '2001-12-21 23:14:24' <= Expiration_Date AND
-t1.Document_ID = t2.Document_ID AND
-t1.Language_ID = t2.Language_ID AND
-t1.Contractor_ID = t2.Contractor_ID AND (
-t2.Customer_ID = '4' OR
-t2.Customer_ID = '999999' OR
-t2.Customer_ID = '1' )AND t2.CanRead
-= '1' AND t1.Column_ID=t3.Column_ID AND
-t1.Language_ID=t3.Language_ID AND (
-t3.Contractor_ID = '4' OR
-t3.Contractor_ID = '999999' OR
-t3.Contractor_ID = '1') AND
-t3.CanRead='1' AND t3.Active='1';
-SELECT DISTINCT COUNT(t1.Title) FROM t1,
-t2, t3 WHERE
-t1.Document_ID='xep80' AND t1.Contractor_ID='1' AND
-t1.Language_ID='ger' AND '2001-12-21 23:14:24' >=
-Publishing_Date AND '2001-12-21 23:14:24' <= Expiration_Date AND
-t1.Document_ID = t2.Document_ID AND
-t1.Language_ID = t2.Language_ID AND
-t1.Contractor_ID = t2.Contractor_ID AND (
-t2.Customer_ID = '4' OR
-t2.Customer_ID = '999999' OR
-t2.Customer_ID = '1' )AND t2.CanRead
-= '1' AND t1.Column_ID=t3.Column_ID AND
-t1.Language_ID=t3.Language_ID AND (
-t3.Contractor_ID = '4' OR
-t3.Contractor_ID = '999999' OR
-t3.Contractor_ID = '1') AND
-t3.CanRead='1' AND t3.Active='1';
-drop table t1,t2,t3;
-
-#
-# Bug when doing full join and NULL fields.
-#
-
-CREATE TABLE t1 (
- t1_id int(11) default NULL,
- t2_id int(11) default NULL,
- type enum('Cost','Percent') default NULL,
- cost_unit enum('Cost','Unit') default NULL,
- min_value double default NULL,
- max_value double default NULL,
- t3_id int(11) default NULL,
- item_id int(11) default NULL
-) ENGINE=MyISAM;
-INSERT INTO t1 VALUES (12,5,'Percent','Cost',-1,0,-1,-1),(14,4,'Percent','Cost',-1,0,-1,-1),(18,5,'Percent','Cost',-1,0,-1,-1),(19,4,'Percent','Cost',-1,0,-1,-1),(20,5,'Percent','Cost',100,-1,22,291),(21,5,'Percent','Cost',100,-1,18,291),(22,1,'Percent','Cost',100,-1,6,291),(23,1,'Percent','Cost',100,-1,21,291),(24,1,'Percent','Cost',100,-1,9,291),(25,1,'Percent','Cost',100,-1,4,291),(26,1,'Percent','Cost',100,-1,20,291),(27,4,'Percent','Cost',100,-1,7,202),(28,1,'Percent','Cost',50,-1,-1,137),(29,2,'Percent','Cost',100,-1,4,354),(30,2,'Percent','Cost',100,-1,9,137),(93,2,'Cost','Cost',-1,10000000,-1,-1);
-CREATE TABLE t2 (
- id int(10) unsigned NOT NULL auto_increment,
- name varchar(255) default NULL,
- PRIMARY KEY (id)
-) ENGINE=MyISAM;
-INSERT INTO t2 VALUES (1,'s1'),(2,'s2'),(3,'s3'),(4,'s4'),(5,'s5');
-select t1.*, t2.* from t1, t2 where t2.id=t1.t2_id limit 2;
-drop table t1,t2;
-
-#
-# Bug in range optimiser with MAYBE_KEY
-#
-
-CREATE TABLE t1 (
- siteid varchar(25) NOT NULL default '',
- emp_id varchar(30) NOT NULL default '',
- rate_code varchar(10) default NULL,
- UNIQUE KEY site_emp (siteid,emp_id),
- KEY siteid (siteid)
-) ENGINE=MyISAM;
-INSERT INTO t1 VALUES ('rivercats','psmith','cust'), ('rivercats','KWalker','cust');
-CREATE TABLE t2 (
- siteid varchar(25) NOT NULL default '',
- rate_code varchar(10) NOT NULL default '',
- base_rate float NOT NULL default '0',
- PRIMARY KEY (siteid,rate_code),
- FULLTEXT KEY rate_code (rate_code)
-) ENGINE=MyISAM;
-INSERT INTO t2 VALUES ('rivercats','cust',20);
-SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE emp.emp_id = 'psmith' AND lr.siteid = 'rivercats';
-SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE lr.siteid = 'rivercats' AND emp.emp_id = 'psmith';
-SELECT rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE emp.emp_id = 'psmith' AND siteid = 'rivercats';
-SELECT rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE siteid = 'rivercats' AND emp.emp_id = 'psmith';
-drop table t1,t2;
-
-#
-# Problem with internal list handling when reducing WHERE
-#
-
-CREATE TABLE t1 (ID INTEGER NOT NULL PRIMARY KEY, Value1 VARCHAR(255));
-CREATE TABLE t2 (ID INTEGER NOT NULL PRIMARY KEY, Value2 VARCHAR(255));
-INSERT INTO t1 VALUES (1, 'A');
-INSERT INTO t2 VALUES (1, 'B');
-
-SELECT * FROM t1 NATURAL JOIN t2 WHERE 1 AND (Value1 = 'A' AND Value2 <> 'B');
-SELECT * FROM t1 NATURAL JOIN t2 WHERE 1 AND Value1 = 'A' AND Value2 <> 'B';
-SELECT * FROM t1 NATURAL JOIN t2 WHERE (Value1 = 'A' AND Value2 <> 'B') AND 1;
-drop table t1,t2;
-
-#
-# dummy natural join (no common columns) Bug #4807
-#
-
-CREATE TABLE t1 (a int);
-CREATE TABLE t2 (b int);
-CREATE TABLE t3 (c int);
-SELECT * FROM t1 NATURAL JOIN t2 NATURAL JOIN t3;
-DROP TABLE t1, t2, t3;
-
-#
-# Test combination of join methods
-#
-
-create table t1 (i int);
-create table t2 (i int);
-create table t3 (i int);
-insert into t1 values(1),(2);
-insert into t2 values(2),(3);
-insert into t3 values (2),(4);
-
-select * from t1 natural left join t2;
-select * from t1 left join t2 on (t1.i=t2.i);
-select * from t1 natural left join t2 natural left join t3;
-select * from t1 left join t2 on (t1.i=t2.i) left join t3 on (t2.i=t3.i);
-
-select * from t3 natural right join t2;
-select * from t3 right join t2 on (t3.i=t2.i);
-select * from t3 natural right join t2 natural right join t1;
-select * from t3 right join t2 on (t3.i=t2.i) right join t1 on (t2.i=t1.i);
-
-select * from t1,t2 natural left join t3 order by t1.i,t2.i,t3.i;
-select * from t1,t2 left join t3 on (t2.i=t3.i) order by t1.i,t2.i,t3.i;
-select t1.i,t2.i,t3.i from t2 natural left join t3,t1 order by t1.i,t2.i,t3.i;
-select t1.i,t2.i,t3.i from t2 left join t3 on (t2.i=t3.i),t1 order by t1.i,t2.i,t3.i;
-
-select * from t1,t2 natural right join t3 order by t1.i,t2.i,t3.i;
-select * from t1,t2 right join t3 on (t2.i=t3.i) order by t1.i,t2.i,t3.i;
-select t1.i,t2.i,t3.i from t2 natural right join t3,t1 order by t1.i,t2.i,t3.i;
-select t1.i,t2.i,t3.i from t2 right join t3 on (t2.i=t3.i),t1 order by t1.i,t2.i,t3.i;
-drop table t1,t2,t3;
-
-# End of 4.1 tests
-
-#
-# Tests for WL#2486 Natural/using join according to SQL:2003.
-#
-# NOTICE:
-# - The tests are designed so that all statements, except MySQL
-# extensions run on any SQL server. Please do no change.
-# - Tests marked with TODO will be submitted as bugs.
-#
-
-create table t1 (c int, b int);
-create table t2 (a int, b int);
-create table t3 (b int, c int);
-create table t4 (y int, c int);
-create table t5 (y int, z int);
-create table t6 (a int, c int);
-
-insert into t1 values (10,1);
-insert into t1 values (3 ,1);
-insert into t1 values (3 ,2);
-insert into t2 values (2, 1);
-insert into t3 values (1, 3);
-insert into t3 values (1,10);
-insert into t4 values (11,3);
-insert into t4 values (2, 3);
-insert into t5 values (11,4);
-insert into t6 values (2, 3);
-
-# Views with simple natural join.
-create algorithm=merge view v1a as
-select * from t1 natural join t2;
-# as above, but column names are cross-renamed: a->c, c->b, b->a
-create algorithm=merge view v1b(a,b,c) as
-select * from t1 natural join t2;
-# as above, but column names are aliased: a->c, c->b, b->a
-create algorithm=merge view v1c as
-select b as a, c as b, a as c from t1 natural join t2;
-# as above, but column names are cross-renamed, and aliased
-# a->c->b, c->b->a, b->a->c
-create algorithm=merge view v1d(b, a, c) as
-select a as c, c as b, b as a from t1 natural join t2;
-
-# Views with JOIN ... ON
-create algorithm=merge view v2a as
-select t1.c, t1.b, t2.a from t1 join (t2 join t4 on b + 1 = y) on t1.c = t4.c;
-create algorithm=merge view v2b as
-select t1.c as b, t1.b as a, t2.a as c
-from t1 join (t2 join t4 on b + 1 = y) on t1.c = t4.c;
-
-# Views with bigger natural join
-create algorithm=merge view v3a as
-select * from t1 natural join t2 natural join t3;
-create algorithm=merge view v3b as
-select * from t1 natural join (t2 natural join t3);
-
-# View over views with mixed natural join and join ... on
-create algorithm=merge view v4 as
-select * from v2a natural join v3a;
-
-# Nested natural/using joins.
-select * from (t1 natural join t2) natural join (t3 natural join t4);
-select * from (t1 natural join t2) natural left join (t3 natural join t4);
-select * from (t3 natural join t4) natural right join (t1 natural join t2);
-select * from (t1 natural left join t2) natural left join (t3 natural left join t4);
-select * from (t4 natural right join t3) natural right join (t2 natural right join t1);
-select * from t1 natural join t2 natural join t3 natural join t4;
-select * from ((t1 natural join t2) natural join t3) natural join t4;
-select * from t1 natural join (t2 natural join (t3 natural join t4));
-# BUG#15355: this query fails in 'prepared statements' mode
-# select * from ((t3 natural join (t1 natural join t2)) natural join t4) natural join t5;
-# select * from ((t3 natural left join (t1 natural left join t2)) natural left join t4) natural left join t5;
-select * from t5 natural right join (t4 natural right join ((t2 natural right join t1) natural right join t3));
-select * from (t1 natural join t2), (t3 natural join t4);
-# MySQL extension - nested comma ',' operator instead of cross join.
-select * from t5 natural join ((t1 natural join t2), (t3 natural join t4));
-select * from ((t1 natural join t2), (t3 natural join t4)) natural join t5;
-select * from t5 natural join ((t1 natural join t2) cross join (t3 natural join t4));
-select * from ((t1 natural join t2) cross join (t3 natural join t4)) natural join t5;
-
-select * from (t1 join t2 using (b)) join (t3 join t4 using (c)) using (c);
-select * from (t1 join t2 using (b)) natural join (t3 join t4 using (c));
-
-
-# Other clauses refer to NJ columns.
-select a,b,c from (t1 natural join t2) natural join (t3 natural join t4)
-where b + 1 = y or b + 10 = y group by b,c,a having min(b) < max(y) order by a;
-select * from (t1 natural join t2) natural left join (t3 natural join t4)
-where b + 1 = y or b + 10 = y group by b,c,a,y having min(b) < max(y) order by a, y;
-select * from (t3 natural join t4) natural right join (t1 natural join t2)
-where b + 1 = y or b + 10 = y group by b,c,a,y having min(b) < max(y) order by a, y;
-
-# Qualified column references to NJ columns.
-select * from t1 natural join t2 where t1.c > t2.a;
-select * from t1 natural join t2 where t1.b > t2.b;
-select * from t1 natural left join (t4 natural join t5) where t5.z is not NULL;
-
-# Nested 'join ... on' - name resolution of ON conditions
-select * from t1 join (t2 join t4 on b + 1 = y) on t1.c = t4.c;
-select * from (t2 join t4 on b + 1 = y) join t1 on t1.c = t4.c;
-select * from t1 natural join (t2 join t4 on b + 1 = y);
-select * from (t1 cross join t2) join (t3 cross join t4) on (a < y and t2.b < t3.c);
-
-# MySQL extension - 'join ... on' over nested comma operator
-select * from (t1, t2) join (t3, t4) on (a < y and t2.b < t3.c);
-select * from (t1 natural join t2) join (t3 natural join t4) on a = y;
-select * from ((t3 join (t1 join t2 on c > a) on t3.b < t2.a) join t4 on y > t1.c) join t5 on z = t1.b + 3;
-
-# MySQL extension - refererence qualified coalesced columns
-select * from t1 natural join t2 where t1.b > 0;
-select * from t1 natural join (t4 natural join t5) where t4.y > 7;
-select * from (t4 natural join t5) natural join t1 where t4.y > 7;
-select * from t1 natural left join (t4 natural join t5) where t4.y > 7;
-select * from (t4 natural join t5) natural right join t1 where t4.y > 7;
-select * from (t1 natural join t2) join (t3 natural join t4) on t1.b = t3.b;
-
-# MySQL extension - select qualified columns of NJ columns
-select t1.*, t2.* from t1 natural join t2;
-select t1.*, t2.*, t3.*, t4.* from (t1 natural join t2) natural join (t3 natural join t4);
-
-# Queries over subselects in the FROM clause
-select * from (select * from t1 natural join t2) as t12
- natural join
- (select * from t3 natural join t4) as t34;
-select * from (select * from t1 natural join t2) as t12
- natural left join
- (select * from t3 natural join t4) as t34;
-select * from (select * from t3 natural join t4) as t34
- natural right join
- (select * from t1 natural join t2) as t12;
-
-# Queries over views
-select * from v1a;
-select * from v1b;
-select * from v1c;
-select * from v1d;
-select * from v2a;
-select * from v2b;
-select * from v3a;
-select * from v3b;
-select * from v4;
-select * from v1a natural join v2a;
-select v2a.* from v1a natural join v2a;
-select * from v1b join v2a on v1b.b = v2a.c;
-select * from v1c join v2a on v1c.b = v2a.c;
-select * from v1d join v2a on v1d.a = v2a.c;
-select * from v1a join (t3 natural join t4) on a = y;
-
-# TODO: add tests with correlated subqueries for natural join/join on.
-# related to BUG#15269
-
-
-#--------------------------------------------------------------------
-# Negative tests (tests for errors)
-#--------------------------------------------------------------------
--- error 1052
-select * from t1 natural join (t3 cross join t4); # works in Oracle - bug
--- error 1052
-select * from (t3 cross join t4) natural join t1; # works in Oracle - bug
--- error 1052
-select * from t1 join (t2, t3) using (b);
--- error 1052
-select * from ((t1 natural join t2), (t3 natural join t4)) natural join t6;
--- error 1052
-select * from ((t1 natural join t2), (t3 natural join t4)) natural join t6;
--- error 1052
-select * from t6 natural join ((t1 natural join t2), (t3 natural join t4));
--- error 1052
-select * from (t1 join t2 on t1.b=t2.b) natural join (t3 natural join t4);
--- error 1052
-select * from (t3 natural join t4) natural join (t1 join t2 on t1.b=t2.b);
-# this one is OK, the next equivalent one is incorrect (bug in Oracle)
--- error 1052
-select * from (t3 join (t4 natural join t5) on (b < z))
- natural join
- (t1 natural join t2);
--- error 1052
-select * from (t1 natural join t2) natural join (t3 join (t4 natural join t5) on (b < z));
-
--- error 1054
-select t1.b from v1a;
--- error 1054
-select * from v1a join v1b on t1.b = t2.b;
-
-#
-# Bug #17523 natural join and information_schema
-#
-# We mask out the Privileges column because it differs with embedded server
---replace_column 32 #
-select * from information_schema.statistics join information_schema.columns
- using(table_name,column_name) where table_name='user';
-
-drop table t1;
-drop table t2;
-drop table t3;
-drop table t4;
-drop table t5;
-drop table t6;
-
-drop view v1a;
-drop view v1b;
-drop view v1c;
-drop view v1d;
-drop view v2a;
-drop view v2b;
-drop view v3a;
-drop view v3b;
-drop view v4;
-
-#
-# BUG#15229 - columns of nested joins that are not natural joins incorrectly
-# materialized
-#
-create table t1 (a1 int, a2 int);
-create table t2 (a1 int, b int);
-create table t3 (c1 int, c2 int);
-create table t4 (c2 int);
-
-insert into t1 values (1,1);
-insert into t2 values (1,1);
-insert into t3 values (1,1);
-insert into t4 values (1);
-
-select * from t1 join t2 using (a1) join t3 on b=c1 join t4 using (c2);
-select * from t3 join (t1 join t2 using (a1)) on b=c1 join t4 using (c2);
-select a2 from t1 join t2 using (a1) join t3 on b=c1 join t4 using (c2);
-select a2 from t3 join (t1 join t2 using (a1)) on b=c1 join t4 using (c2);
-select a2 from ((t1 join t2 using (a1)) join t3 on b=c1) join t4 using (c2);
-select a2 from ((t1 natural join t2) join t3 on b=c1) natural join t4;
-
-drop table t1,t2,t3,t4;
-
-#
-# BUG#15355: Common natural join column not resolved in prepared statement nested query
-#
-create table t1 (c int, b int);
-create table t2 (a int, b int);
-create table t3 (b int, c int);
-create table t4 (y int, c int);
-create table t5 (y int, z int);
-
-insert into t1 values (3,2);
-insert into t2 values (1,2);
-insert into t3 values (2,3);
-insert into t4 values (1,3);
-insert into t5 values (1,4);
-
-# this fails
-prepare stmt1 from "select * from ((t3 natural join (t1 natural join t2))
-natural join t4) natural join t5";
-execute stmt1;
-
-# this works
-select * from ((t3 natural join (t1 natural join t2)) natural join t4)
- natural join t5;
-drop table t1, t2, t3, t4, t5;
-
-# End of tests for WL#2486 - natural/using join
-
-#
-# BUG#14940: Make E(#rows) from "range" access be re-used by range optimizer
-#
-create table t1 (a int);
-insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-
-create table t2 (a int, b int, filler char(100), key(a), key(b));
-create table t3 (a int, b int, filler char(100), key(a), key(b));
-
-insert into t2
- select @a:= A.a + 10*(B.a + 10*C.a), @a, 'filler' from t1 A, t1 B, t1 C;
-insert into t3 select * from t2 where a < 800;
-
-# The order of tables must be t2,t3:
-explain select * from t2,t3 where t2.a < 200 and t2.b=t3.b;
-
-drop table t1, t2, t3;
-
-# BUG#14940 {Wrong query plan is chosen because of odd results of
-# prev_record_reads() function }
-create table t1 (a int);
-insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-
-create table t2 (a int, b int, primary key(a));
-insert into t2 select @v:=A.a+10*B.a, @v from t1 A, t1 B;
-
-explain select * from t1;
-show status like '%cost%';
-select 'The cost of accessing t1 (dont care if it changes' '^';
-
-select 'vv: Following query must use ALL(t1), eq_ref(A), eq_ref(B): vv' Z;
-
-explain select * from t1, t2 A, t2 B where A.a = t1.a and B.a=A.b;
-show status like '%cost%';
-select '^^: The above should be ~= 20 + cost(select * from t1). Value less than 20 is an error' Z;
-
-
-
-drop table t1, t2;
-# BUG#25106: A USING clause in combination with a VIEW results in column
-# aliases ignored
-#
-CREATE TABLE t1 (ID INTEGER, Name VARCHAR(50));
-CREATE TABLE t2 (Test_ID INTEGER);
-CREATE VIEW v1 (Test_ID, Description) AS SELECT ID, Name FROM t1;
-
-CREATE TABLE tv1 SELECT Description AS Name FROM v1 JOIN t2
- USING (Test_ID);
-DESCRIBE tv1;
-CREATE TABLE tv2 SELECT Description AS Name FROM v1 JOIN t2
- ON v1.Test_ID = t2.Test_ID;
-DESCRIBE tv2;
-
-DROP VIEW v1;
-DROP TABLE t1,t2,tv1,tv2;
-
-SET optimizer_switch=@save_optimizer_switch;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
---echo End of 5.0 tests.
diff --git a/mysql-test/suite/pbxt/t/join_crash.test b/mysql-test/suite/pbxt/t/join_crash.test
deleted file mode 100644
index 2ec96dc2c28..00000000000
--- a/mysql-test/suite/pbxt/t/join_crash.test
+++ /dev/null
@@ -1,121 +0,0 @@
-#
-# This test gave a core dump
-#
-
---disable_warnings
-DROP TABLE IF EXISTS t1,t2,t3,t4;
---enable_warnings
-
-CREATE TABLE t1 (
- project_id int(11) NOT NULL auto_increment,
- project_row_lock int(11) NOT NULL default '0',
- project_name varchar(80) NOT NULL default '',
- client_ptr int(11) NOT NULL default '0',
- project_contact_ptr int(11) default NULL,
- client_contact_ptr int(11) default NULL,
- billing_contact_ptr int(11) default NULL,
- comments mediumtext,
- PRIMARY KEY (project_id),
- UNIQUE KEY project (client_ptr,project_name)
-) ENGINE=MyISAM PACK_KEYS=1;
-
-INSERT INTO t1 VALUES (1,0,'Rejected Time',1,NULL,NULL,NULL,NULL);
-INSERT INTO t1 VALUES (209,0,'MDGRAD Proposal/Investigation',97,NULL,NULL,NULL,'');
-INSERT INTO t1 VALUES (208,0,'Font 9 Design',84,NULL,NULL,NULL,'');
-INSERT INTO t1 VALUES (207,0,'Web Based Order Processing',95,NULL,NULL,NULL,'');
-INSERT INTO t1 VALUES (205,0,'Mac Screen Saver',95,NULL,NULL,NULL,'');
-INSERT INTO t1 VALUES (206,0,'Web Site',96,NULL,NULL,NULL,'');
-INSERT INTO t1 VALUES (204,0,'Magnafire Glue',94,NULL,NULL,NULL,'');
-INSERT INTO t1 VALUES (203,0,'Print Bid',93,NULL,NULL,NULL,'');
-INSERT INTO t1 VALUES (202,0,'EPOC Port',92,NULL,NULL,NULL,'');
-INSERT INTO t1 VALUES (201,0,'TravelMate',88,NULL,NULL,NULL,'');
-
-CREATE TABLE t2 (
- period_id int(11) NOT NULL auto_increment,
- period_type enum('user_table','client_table','role_table','member_table','project_table') default NULL,
- period_key int(11) default NULL,
- start_date datetime default NULL,
- end_date datetime default NULL,
- work_load int(11) default NULL,
- PRIMARY KEY (period_id),
- KEY period_index (period_type,period_key),
- KEY date_index (start_date,end_date)
-) ENGINE=MyISAM PACK_KEYS=1;
-
-INSERT INTO t2 VALUES (1,'user_table',98,'2000-01-01 00:00:00',NULL,NULL);
-INSERT INTO t2 VALUES (2,'user_table',99,'2000-01-01 00:00:00',NULL,NULL);
-INSERT INTO t2 VALUES (3,'user_table',100,'2000-01-01 00:00:00',NULL,NULL);
-INSERT INTO t2 VALUES (49,'project_table',148,'2000-01-01 00:00:00',NULL,NULL);
-INSERT INTO t2 VALUES (50,'client_table',68,'2000-01-01 00:00:00',NULL,NULL);
-INSERT INTO t2 VALUES (51,'project_table',149,'2000-01-01 00:00:00',NULL,NULL);
-INSERT INTO t2 VALUES (52,'project_table',150,'2000-01-01 00:00:00',NULL,NULL);
-INSERT INTO t2 VALUES (53,'client_table',69,'2000-01-01 00:00:00',NULL,NULL);
-INSERT INTO t2 VALUES (54,'project_table',151,'2000-01-01 00:00:00',NULL,NULL);
-INSERT INTO t2 VALUES (55,'client_table',70,'2000-01-01 00:00:00',NULL,NULL);
-INSERT INTO t2 VALUES (155,'role_table',1,'2000-01-01 00:00:00',NULL,NULL);
-INSERT INTO t2 VALUES (156,'role_table',2,'2000-01-01 00:00:00',NULL,NULL);
-INSERT INTO t2 VALUES (160,'member_table',1,'2000-01-01 00:00:00',NULL,1);
-INSERT INTO t2 VALUES (161,'member_table',2,'2000-01-01 00:00:00',NULL,1);
-INSERT INTO t2 VALUES (162,'member_table',3,'2000-01-01 00:00:00',NULL,1);
-
-CREATE TABLE t3 (
- budget_id int(11) NOT NULL auto_increment,
- project_ptr int(11) NOT NULL default '0',
- po_number varchar(20) NOT NULL default '',
- status enum('open','closed') default NULL,
- date_received datetime default NULL,
- amount_received float(10,2) default NULL,
- adjustment float(10,2) default NULL,
- PRIMARY KEY (budget_id),
- UNIQUE KEY po (project_ptr,po_number)
-) ENGINE=MyISAM PACK_KEYS=1;
-
-CREATE TABLE t4 (
- client_id int(11) NOT NULL auto_increment,
- client_row_lock int(11) NOT NULL default '0',
- client_name varchar(80) NOT NULL default '',
- contact_ptr int(11) default NULL,
- comments mediumtext,
- PRIMARY KEY (client_id),
- UNIQUE KEY client_name (client_name)
-) ENGINE=MyISAM PACK_KEYS=1;
-
-INSERT INTO t4 VALUES (1,0,'CPS',NULL,NULL);
-
-#
-# The query that fails...
-#
-select distinct
- t1.project_id as project_id,
- t1.project_name as project_name,
- t1.client_ptr as client_ptr,
- t1.comments as comments,
- sum( t3.amount_received ) + sum( t3.adjustment ) as total_budget
-from
- t2 as client_period ,
- t2 as project_period,
- t3 left join t1 on (t3.project_ptr = t1.project_id and
- t3.date_received <= '2001-03-22 14:15:09')
- left join t4 on t4.client_id = t1.client_ptr
- where
- 1
- and ( client_period.period_type = 'client_table'
- and client_period.period_key = t4.client_id
- and ( client_period.start_date <= '2001-03-22 14:15:09' or isnull( client_period.start_date ))
- and ( client_period.end_date > '2001-03-21 14:15:09' or isnull( client_period.end_date ))
- )
- and ( project_period.period_type = 'project_table'
- and project_period.period_key = t1.project_id
- and ( project_period.start_date <= '2001-03-22 14:15:09' or isnull( project_period.start_date ))
- and ( project_period.end_date > '2001-03-21 14:15:09' or isnull( project_period.end_date )) )
- group by
- client_id,
- project_id ,
- client_period.period_id ,
- project_period.period_id
- order by
- client_name asc,
- project_name asc;
-DROP TABLE t1,t2,t3,t4;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/join_nested.test b/mysql-test/suite/pbxt/t/join_nested.test
deleted file mode 100644
index 25c8a5a782e..00000000000
--- a/mysql-test/suite/pbxt/t/join_nested.test
+++ /dev/null
@@ -1,1074 +0,0 @@
-
---disable_warnings
-DROP TABLE IF EXISTS t0,t1,t2,t3,t4,t5,t6,t7,t8,t9;
---enable_warnings
-
-SET @save_optimizer_switch=@@optimizer_switch;
-SET optimizer_switch='outer_join_with_cache=off';
-
-CREATE TABLE t0 (a int, b int, c int);
-CREATE TABLE t1 (a int, b int, c int);
-CREATE TABLE t2 (a int, b int, c int);
-CREATE TABLE t3 (a int, b int, c int);
-CREATE TABLE t4 (a int, b int, c int);
-CREATE TABLE t5 (a int, b int, c int);
-CREATE TABLE t6 (a int, b int, c int);
-CREATE TABLE t7 (a int, b int, c int);
-CREATE TABLE t8 (a int, b int, c int);
-CREATE TABLE t9 (a int, b int, c int);
-
-INSERT INTO t0 VALUES (1,1,0), (1,2,0), (2,2,0);
-INSERT INTO t1 VALUES (1,3,0), (2,2,0), (3,2,0);
-INSERT INTO t2 VALUES (3,3,0), (4,2,0), (5,3,0);
-INSERT INTO t3 VALUES (1,2,0), (2,2,0);
-INSERT INTO t4 VALUES (3,2,0), (4,2,0);
-INSERT INTO t5 VALUES (3,1,0), (2,2,0), (3,3,0);
-INSERT INTO t6 VALUES (3,2,0), (6,2,0), (6,1,0);
-INSERT INTO t7 VALUES (1,1,0), (2,2,0);
-INSERT INTO t8 VALUES (0,2,0), (1,2,0);
-INSERT INTO t9 VALUES (1,1,0), (1,2,0), (3,3,0);
-
-
-SELECT t2.a,t2.b
- FROM t2;
-
-SELECT t3.a,t3.b
- FROM t3;
-
-SELECT t4.a,t4.b
- FROM t4;
-
-SELECT t3.a,t3.b,t4.a,t4.b
- FROM t3,t4;
-
-SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
- FROM t2
- LEFT JOIN
- (t3, t4)
- ON t2.b=t4.b;
-
-SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
- FROM t2
- LEFT JOIN
- (t3, t4)
- ON t3.a=1 AND t2.b=t4.b;
-
-EXPLAIN EXTENDED
-SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
- FROM t2
- LEFT JOIN
- (t3, t4)
- ON t2.b=t4.b
- WHERE t3.a=1 OR t3.c IS NULL;
-
-SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
- FROM t2
- LEFT JOIN
- (t3, t4)
- ON t2.b=t4.b
- WHERE t3.a=1 OR t3.c IS NULL;
-
-SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
- FROM t2
- LEFT JOIN
- (t3, t4)
- ON t2.b=t4.b
- WHERE t3.a>1 OR t3.c IS NULL;
-
-SELECT t5.a,t5.b
- FROM t5;
-
-SELECT t3.a,t3.b,t4.a,t4.b,t5.a,t5.b
- FROM t3,t4,t5;
-
-SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,t5.a,t5.b
- FROM t2
- LEFT JOIN
- (t3, t4, t5)
- ON t2.b=t4.b;
-
-EXPLAIN EXTENDED
-SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,t5.a,t5.b
- FROM t2
- LEFT JOIN
- (t3, t4, t5)
- ON t2.b=t4.b
- WHERE t3.a>1 OR t3.c IS NULL;
-
-SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,t5.a,t5.b
- FROM t2
- LEFT JOIN
- (t3, t4, t5)
- ON t2.b=t4.b
- WHERE t3.a>1 OR t3.c IS NULL;
-
-EXPLAIN EXTENDED
-SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,t5.a,t5.b
- FROM t2
- LEFT JOIN
- (t3, t4, t5)
- ON t2.b=t4.b
- WHERE (t3.a>1 OR t3.c IS NULL) AND
- (t5.a<3 OR t5.c IS NULL);
-
-SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,t5.a,t5.b
- FROM t2
- LEFT JOIN
- (t3, t4, t5)
- ON t2.b=t4.b
- WHERE (t3.a>1 OR t3.c IS NULL) AND
- (t5.a<3 OR t5.c IS NULL);
-
-SELECT t6.a,t6.b
- FROM t6;
-
-SELECT t7.a,t7.b
- FROM t7;
-
-SELECT t6.a,t6.b,t7.a,t7.b
- FROM t6,t7;
-
-SELECT t8.a,t8.b
- FROM t8;
-
-EXPLAIN EXTENDED
-SELECT t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
- FROM (t6, t7)
- LEFT JOIN
- t8
- ON t7.b=t8.b AND t6.b < 10;
-
-SELECT t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
- FROM (t6, t7)
- LEFT JOIN
- t8
- ON t7.b=t8.b AND t6.b < 10;
-
-SELECT t5.a,t5.b
- FROM t5;
-
-SELECT t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
- FROM t5
- LEFT JOIN
- (
- (t6, t7)
- LEFT JOIN
- t8
- ON t7.b=t8.b AND t6.b < 10
- )
- ON t6.b >= 2 AND t5.b=t7.b;
-
-SELECT t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
- FROM t5
- LEFT JOIN
- (
- (t6, t7)
- LEFT JOIN
- t8
- ON t7.b=t8.b AND t6.b < 10
- )
- ON t6.b >= 2 AND t5.b=t7.b AND
- (t8.a < 1 OR t8.c IS NULL);
-
-SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
- FROM t2
- LEFT JOIN
- (t3, t4)
- ON t3.a=1 AND t2.b=t4.b;
-
-SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
- t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
- FROM t2
- LEFT JOIN
- (t3, t4)
- ON t3.a=1 AND t2.b=t4.b,
- t5
- LEFT JOIN
- (
- (t6, t7)
- LEFT JOIN
- t8
- ON t7.b=t8.b AND t6.b < 10
- )
- ON t6.b >= 2 AND t5.b=t7.b;
-
-SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
- t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
- FROM t2
- LEFT JOIN
- (t3, t4)
- ON t3.a=1 AND t2.b=t4.b,
- t5
- LEFT JOIN
- (
- (t6, t7)
- LEFT JOIN
- t8
- ON t7.b=t8.b AND t6.b < 10
- )
- ON t6.b >= 2 AND t5.b=t7.b
- WHERE t2.a > 3 AND
- (t6.a < 6 OR t6.c IS NULL);
-
-SELECT t1.a,t1.b
- FROM t1;
-
-SELECT t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
- t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
- FROM t1
- LEFT JOIN
- (
- t2
- LEFT JOIN
- (t3, t4)
- ON t3.a=1 AND t2.b=t4.b,
- t5
- LEFT JOIN
- (
- (t6, t7)
- LEFT JOIN
- t8
- ON t7.b=t8.b AND t6.b < 10
- )
- ON t6.b >= 2 AND t5.b=t7.b
- )
- ON (t3.b=2 OR t3.c IS NULL) AND (t6.b=2 OR t6.c IS NULL) AND
- (t1.b=t5.b OR t3.c IS NULL OR t6.c IS NULL or t8.c IS NULL) AND
- (t1.a != 2);
-
-SELECT t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
- t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
- FROM t1
- LEFT JOIN
- (
- t2
- LEFT JOIN
- (t3, t4)
- ON t3.a=1 AND t2.b=t4.b,
- t5
- LEFT JOIN
- (
- (t6, t7)
- LEFT JOIN
- t8
- ON t7.b=t8.b AND t6.b < 10
- )
- ON t6.b >= 2 AND t5.b=t7.b
- )
- ON (t3.b=2 OR t3.c IS NULL) AND (t6.b=2 OR t6.c IS NULL) AND
- (t1.b=t5.b OR t3.c IS NULL OR t6.c IS NULL or t8.c IS NULL) AND
- (t1.a != 2)
- WHERE (t2.a >= 4 OR t2.c IS NULL);
-
-SELECT t0.a,t0.b
- FROM t0;
-
-EXPLAIN EXTENDED
-SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
- t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
- FROM t0,t1
- LEFT JOIN
- (
- t2
- LEFT JOIN
- (t3, t4)
- ON t3.a=1 AND t2.b=t4.b,
- t5
- LEFT JOIN
- (
- (t6, t7)
- LEFT JOIN
- t8
- ON t7.b=t8.b AND t6.b < 10
- )
- ON t6.b >= 2 AND t5.b=t7.b
- )
- ON (t3.b=2 OR t3.c IS NULL) AND (t6.b=2 OR t6.c IS NULL) AND
- (t1.b=t5.b OR t3.c IS NULL OR t6.c IS NULL or t8.c IS NULL) AND
- (t1.a != 2)
- WHERE t0.a=1 AND
- t0.b=t1.b AND
- (t2.a >= 4 OR t2.c IS NULL);
-
-SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
- t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
- FROM t0,t1
- LEFT JOIN
- (
- t2
- LEFT JOIN
- (t3, t4)
- ON t3.a=1 AND t2.b=t4.b,
- t5
- LEFT JOIN
- (
- (t6, t7)
- LEFT JOIN
- t8
- ON t7.b=t8.b AND t6.b < 10
- )
- ON t6.b >= 2 AND t5.b=t7.b
- )
- ON (t3.b=2 OR t3.c IS NULL) AND (t6.b=2 OR t6.c IS NULL) AND
- (t1.b=t5.b OR t3.c IS NULL OR t6.c IS NULL or t8.c IS NULL) AND
- (t1.a != 2)
- WHERE t0.a=1 AND
- t0.b=t1.b AND
- (t2.a >= 4 OR t2.c IS NULL);
-
-EXPLAIN EXTENDED
-SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
- t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
- FROM t0,t1
- LEFT JOIN
- (
- t2
- LEFT JOIN
- (t3, t4)
- ON t3.a=1 AND t2.b=t4.b,
- t5
- LEFT JOIN
- (
- (t6, t7)
- LEFT JOIN
- t8
- ON t7.b=t8.b AND t6.b < 10
- )
- ON t6.b >= 2 AND t5.b=t7.b
- )
- ON (t3.b=2 OR t3.c IS NULL) AND (t6.b=2 OR t6.c IS NULL) AND
- (t1.b=t5.b OR t3.c IS NULL OR t6.c IS NULL or t8.c IS NULL) AND
- (t1.a != 2),
- t9
- WHERE t0.a=1 AND
- t0.b=t1.b AND
- (t2.a >= 4 OR t2.c IS NULL) AND
- (t3.a < 5 OR t3.c IS NULL) AND
- (t3.b=t4.b OR t3.c IS NULL OR t4.c IS NULL) AND
- (t5.a >=2 OR t5.c IS NULL) AND
- (t6.a >=4 OR t6.c IS NULL) AND
- (t7.a <= 2 OR t7.c IS NULL) AND
- (t8.a < 1 OR t8.c IS NULL) AND
- (t8.b=t9.b OR t8.c IS NULL) AND
- (t9.a=1);
-
-SELECT t9.a,t9.b
- FROM t9;
-
-SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
- t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
- FROM t0,t1
- LEFT JOIN
- (
- t2
- LEFT JOIN
- (t3, t4)
- ON t3.a=1 AND t2.b=t4.b,
- t5
- LEFT JOIN
- (
- (t6, t7)
- LEFT JOIN
- t8
- ON t7.b=t8.b AND t6.b < 10
- )
- ON t6.b >= 2 AND t5.b=t7.b
- )
- ON (t3.b=2 OR t3.c IS NULL) AND (t6.b=2 OR t6.c IS NULL) AND
- (t1.b=t5.b OR t3.c IS NULL OR t6.c IS NULL or t8.c IS NULL) AND
- (t1.a != 2),
- t9
- WHERE t0.a=1 AND
- t0.b=t1.b AND
- (t2.a >= 4 OR t2.c IS NULL) AND
- (t3.a < 5 OR t3.c IS NULL) AND
- (t3.b=t4.b OR t3.c IS NULL OR t4.c IS NULL) AND
- (t5.a >=2 OR t5.c IS NULL) AND
- (t6.a >=4 OR t6.c IS NULL) AND
- (t7.a <= 2 OR t7.c IS NULL) AND
- (t8.a < 1 OR t8.c IS NULL) AND
- (t8.b=t9.b OR t8.c IS NULL) AND
- (t9.a=1);
-
-SELECT t1.a,t1.b
- FROM t1;
-
-SELECT t2.a,t2.b
- FROM t2;
-
-SELECT t3.a,t3.b
- FROM t3;
-
-SELECT t2.a,t2.b,t3.a,t3.b
- FROM t2
- LEFT JOIN
- t3
- ON t2.b=t3.b;
-
-SELECT t1.a,t1.b,t2.a,t2.b,t3.a,t3.b
- FROM t1, t2
- LEFT JOIN
- t3
- ON t2.b=t3.b
- WHERE t1.a <= 2;
-
-SELECT t1.a,t1.b,t2.a,t2.b,t3.a,t3.b
- FROM t1, t3
- RIGHT JOIN
- t2
- ON t2.b=t3.b
- WHERE t1.a <= 2;
-
-SELECT t3.a,t3.b,t4.a,t4.b
- FROM t3,t4;
-
-SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
- FROM t2
- LEFT JOIN
- (t3, t4)
- ON t3.a=1 AND t2.b=t4.b;
-
-SELECT t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
- FROM t1, t2
- LEFT JOIN
- (t3, t4)
- ON t3.a=1 AND t2.b=t4.b
- WHERE t1.a <= 2;
-
-SELECT t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
- FROM t1, (t3, t4)
- RIGHT JOIN
- t2
- ON t3.a=1 AND t2.b=t4.b
- WHERE t1.a <= 2;
-
-SELECT t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
- FROM t1, (t3, t4)
- RIGHT JOIN
- t2
- ON t3.a=1 AND t2.b=t4.b
- WHERE t1.a <= 2;
-
-EXPLAIN EXTENDED
-SELECT t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
- FROM t1, (t3, t4)
- RIGHT JOIN
- t2
- ON t3.a=1 AND t2.b=t4.b
- WHERE t1.a <= 2;
-
-CREATE INDEX idx_b ON t2(b);
-
-EXPLAIN EXTENDED
-SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
- FROM (t3,t4)
- LEFT JOIN
- (t1,t2)
- ON t3.a=1 AND t3.b=t2.b AND t2.b=t4.b;
-
-SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
- FROM (t3,t4)
- LEFT JOIN
- (t1,t2)
- ON t3.a=1 AND t3.b=t2.b AND t2.b=t4.b;
-
-EXPLAIN EXTENDED
-SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
- t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
- FROM t0,t1
- LEFT JOIN
- (
- t2
- LEFT JOIN
- (t3, t4)
- ON t3.a=1 AND t2.b=t4.b,
- t5
- LEFT JOIN
- (
- (t6, t7)
- LEFT JOIN
- t8
- ON t7.b=t8.b AND t6.b < 10
- )
- ON t6.b >= 2 AND t5.b=t7.b
- )
- ON (t3.b=2 OR t3.c IS NULL) AND (t6.b=2 OR t6.c IS NULL) AND
- (t1.b=t5.b OR t3.c IS NULL OR t6.c IS NULL or t8.c IS NULL) AND
- (t1.a != 2),
- t9
- WHERE t0.a=1 AND
- t0.b=t1.b AND
- (t2.a >= 4 OR t2.c IS NULL) AND
- (t3.a < 5 OR t3.c IS NULL) AND
- (t3.b=t4.b OR t3.c IS NULL OR t4.c IS NULL) AND
- (t5.a >=2 OR t5.c IS NULL) AND
- (t6.a >=4 OR t6.c IS NULL) AND
- (t7.a <= 2 OR t7.c IS NULL) AND
- (t8.a < 1 OR t8.c IS NULL) AND
- (t8.b=t9.b OR t8.c IS NULL) AND
- (t9.a=1);
-
-CREATE INDEX idx_b ON t4(b);
-CREATE INDEX idx_b ON t5(b);
-
-EXPLAIN EXTENDED
-SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
- t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
- FROM t0,t1
- LEFT JOIN
- (
- t2
- LEFT JOIN
- (t3, t4)
- ON t3.a=1 AND t2.b=t4.b,
- t5
- LEFT JOIN
- (
- (t6, t7)
- LEFT JOIN
- t8
- ON t7.b=t8.b AND t6.b < 10
- )
- ON t6.b >= 2 AND t5.b=t7.b
- )
- ON (t3.b=2 OR t3.c IS NULL) AND (t6.b=2 OR t6.c IS NULL) AND
- (t1.b=t5.b OR t3.c IS NULL OR t6.c IS NULL or t8.c IS NULL) AND
- (t1.a != 2),
- t9
- WHERE t0.a=1 AND
- t0.b=t1.b AND
- (t2.a >= 4 OR t2.c IS NULL) AND
- (t3.a < 5 OR t3.c IS NULL) AND
- (t3.b=t4.b OR t3.c IS NULL OR t4.c IS NULL) AND
- (t5.a >=2 OR t5.c IS NULL) AND
- (t6.a >=4 OR t6.c IS NULL) AND
- (t7.a <= 2 OR t7.c IS NULL) AND
- (t8.a < 1 OR t8.c IS NULL) AND
- (t8.b=t9.b OR t8.c IS NULL) AND
- (t9.a=1);
-
-CREATE INDEX idx_b ON t8(b);
-
---replace_regex /Using where; // /Using where//
---sorted_result
-EXPLAIN
-SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
- t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
- FROM t0,t1
- LEFT JOIN
- (
- t2
- LEFT JOIN
- (t3, t4)
- ON t3.a=1 AND t2.b=t4.b,
- t5
- LEFT JOIN
- (
- (t6, t7)
- LEFT JOIN
- t8
- ON t7.b=t8.b AND t6.b < 10
- )
- ON t6.b >= 2 AND t5.b=t7.b
- )
- ON (t3.b=2 OR t3.c IS NULL) AND (t6.b=2 OR t6.c IS NULL) AND
- (t1.b=t5.b OR t3.c IS NULL OR t6.c IS NULL or t8.c IS NULL) AND
- (t1.a != 2),
- t9
- WHERE t0.a=1 AND
- t0.b=t1.b AND
- (t2.a >= 4 OR t2.c IS NULL) AND
- (t3.a < 5 OR t3.c IS NULL) AND
- (t3.b=t4.b OR t3.c IS NULL OR t4.c IS NULL) AND
- (t5.a >=2 OR t5.c IS NULL) AND
- (t6.a >=4 OR t6.c IS NULL) AND
- (t7.a <= 2 OR t7.c IS NULL) AND
- (t8.a < 1 OR t8.c IS NULL) AND
- (t8.b=t9.b OR t8.c IS NULL) AND
- (t9.a=1);
---echo ATTENTION: the above EXPLAIN has several competing QEPs with identical
---echo . costs. To combat the plan change it uses --sorted_result and
---echo . and --replace tricks
-
-INSERT INTO t1 VALUES (-1,133,0), (-2,12,0), (-3,11,0), (-5,15,0);
-CREATE INDEX idx_b ON t1(b);
-CREATE INDEX idx_a ON t0(a);
-
---replace_regex /Using where; // /Using where//
---sorted_result
-EXPLAIN
-SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
- t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
- FROM t0,t1
- LEFT JOIN
- (
- t2
- LEFT JOIN
- (t3, t4)
- ON t3.a=1 AND t2.b=t4.b,
- t5
- LEFT JOIN
- (
- (t6, t7)
- LEFT JOIN
- t8
- ON t7.b=t8.b AND t6.b < 10
- )
- ON t6.b >= 2 AND t5.b=t7.b
- )
- ON (t3.b=2 OR t3.c IS NULL) AND (t6.b=2 OR t6.c IS NULL) AND
- (t1.b=t5.b OR t3.c IS NULL OR t6.c IS NULL or t8.c IS NULL) AND
- (t1.a != 2) AND t1.a>0,
- t9
- WHERE t0.a=1 AND
- t0.b=t1.b AND
- (t2.a >= 4 OR t2.c IS NULL) AND
- (t3.a < 5 OR t3.c IS NULL) AND
- (t3.b=t4.b OR t3.c IS NULL OR t4.c IS NULL) AND
- (t5.a >=2 OR t5.c IS NULL) AND
- (t6.a >=4 OR t6.c IS NULL) AND
- (t7.a <= 2 OR t7.c IS NULL) AND
- (t8.a < 1 OR t8.c IS NULL) AND
- (t8.b=t9.b OR t8.c IS NULL) AND
- (t9.a=1);
---echo ATTENTION: the above EXPLAIN has several competing QEPs with identical
---echo . costs. To combat the plan change it uses --sorted_result
---echo . and --replace tricks
-
---sorted_result
-SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
- t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
- FROM t0,t1
- LEFT JOIN
- (
- t2
- LEFT JOIN
- (t3, t4)
- ON t3.a=1 AND t2.b=t4.b,
- t5
- LEFT JOIN
- (
- (t6, t7)
- LEFT JOIN
- t8
- ON t7.b=t8.b AND t6.b < 10
- )
- ON t6.b >= 2 AND t5.b=t7.b
- )
- ON (t3.b=2 OR t3.c IS NULL) AND (t6.b=2 OR t6.c IS NULL) AND
- (t1.b=t5.b OR t3.c IS NULL OR t6.c IS NULL or t8.c IS NULL) AND
- (t1.a != 2) AND t1.a>0,
- t9
- WHERE t0.a=1 AND
- t0.b=t1.b AND
- (t2.a >= 4 OR t2.c IS NULL) AND
- (t3.a < 5 OR t3.c IS NULL) AND
- (t3.b=t4.b OR t3.c IS NULL OR t4.c IS NULL) AND
- (t5.a >=2 OR t5.c IS NULL) AND
- (t6.a >=4 OR t6.c IS NULL) AND
- (t7.a <= 2 OR t7.c IS NULL) AND
- (t8.a < 1 OR t8.c IS NULL) AND
- (t8.b=t9.b OR t8.c IS NULL) AND
- (t9.a=1);
-
-SELECT t2.a,t2.b
- FROM t2;
-
-SELECT t3.a,t3.b
- FROM t3;
-
-SELECT t2.a,t2.b,t3.a,t3.b
- FROM t2 LEFT JOIN t3 ON t2.b=t3.b
- WHERE t2.a = 4 OR (t2.a > 4 AND t3.a IS NULL);
-
-SELECT t2.a,t2.b,t3.a,t3.b
- FROM t2 LEFT JOIN (t3) ON t2.b=t3.b
- WHERE t2.a = 4 OR (t2.a > 4 AND t3.a IS NULL);
-
-ALTER TABLE t3
- CHANGE COLUMN a a1 int,
- CHANGE COLUMN c c1 int;
-
-SELECT t2.a,t2.b,t3.a1,t3.b
- FROM t2 LEFT JOIN t3 ON t2.b=t3.b
- WHERE t2.a = 4 OR (t2.a > 4 AND t3.a1 IS NULL);
-
-SELECT t2.a,t2.b,t3.a1,t3.b
- FROM t2 NATURAL LEFT JOIN t3
- WHERE t2.a = 4 OR (t2.a > 4 AND t3.a1 IS NULL);
-
-DROP TABLE t0,t1,t2,t3,t4,t5,t6,t7,t8,t9;
-
-CREATE TABLE t1 (a int);
-CREATE TABLE t2 (a int);
-CREATE TABLE t3 (a int);
-
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (2);
-INSERT INTO t3 VALUES (2);
-INSERT INTO t1 VALUES (2);
-
-#check proper syntax for nested outer joins
-
-SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON t2.a=t3.a) ON t1.a=t3.a;
-
-#must be equivalent to:
-
-SELECT * FROM t1 LEFT JOIN t2 LEFT JOIN t3 ON t2.a=t3.a ON t1.a=t3.a;
-
-#check that everything is al right when all tables contain not more than 1 row
-#(bug #4922)
-
-DELETE FROM t1 WHERE a=2;
-SELECT * FROM t1 LEFT JOIN t2 LEFT JOIN t3 ON t2.a=t3.a ON t1.a=t3.a;
-DELETE FROM t2;
-SELECT * FROM t1 LEFT JOIN t2 LEFT JOIN t3 ON t2.a=t3.a ON t1.a=t3.a;
-
-DROP TABLE t1,t2,t3;
-
-#on expression for a nested outer join does not depend on the outer table
-#bug #4976
-
-CREATE TABLE t1(a int, key (a));
-CREATE TABLE t2(b int, key (b));
-CREATE TABLE t3(c int, key (c));
-
-INSERT INTO t1 VALUES (NULL), (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
-(10), (11), (12), (13), (14), (15), (16), (17), (18), (19);
-
-INSERT INTO t2 VALUES (NULL), (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
-(10), (11), (12), (13), (14), (15), (16), (17), (18), (19);
-
-INSERT INTO t3 VALUES (0), (1), (2), (3), (4), (5);
-
-analyze table t2; # PBXT required for stable count
-analyze table t3; # PBXT required for stable count
-
-EXPLAIN SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON c < 3 and b = c;
---replace_column 9 #
-EXPLAIN SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
-SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
-
-DELETE FROM t3;
---replace_column 9 #
-EXPLAIN SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
-SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
-
-DROP TABLE t1,t2,t3;
-
-#
-# Test for bug #11284: empty table in a nested left join
-#
-
-CREATE TABLE t1 (c11 int);
-CREATE TABLE t2 (c21 int);
-CREATE TABLE t3 (c31 int);
-
-INSERT INTO t1 VALUES (4), (5);
-
-SELECT * FROM t1 LEFT JOIN t2 ON c11=c21;
-EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON c11=c21;
-
-SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON c21=c31) ON c11=c21;
-EXPLAIN SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON c21=c31) ON c11=c21;
-
-DROP TABLE t1,t2,t3;
-
-#
-# Bug #12154: creation of temp table for a query with nested outer join
-#
-
-CREATE TABLE t1 (goods int(12) NOT NULL, price varchar(128) NOT NULL);
-INSERT INTO t1 VALUES (23, 2340), (26, 9900);
-
-CREATE TABLE t2 (goods int(12), name varchar(50), shop char(2));
-INSERT INTO t2 VALUES (23, 'as300', 'fr'), (26, 'as600', 'fr');
-
-create table t3 (groupid int(12) NOT NULL, goodsid int(12) NOT NULL);
-INSERT INTO t3 VALUES (3,23), (6,26);
-
-CREATE TABLE t4 (groupid int(12));
-INSERT INTO t4 VALUES (1), (2), (3), (4), (5), (6);
-
-SELECT * FROM
-(SELECT DISTINCT gl.groupid, gp.price
- FROM t4 gl
- LEFT JOIN
- (t3 g INNER JOIN t2 p ON g.goodsid = p.goods
- INNER JOIN t1 gp ON p.goods = gp.goods)
- ON gl.groupid = g.groupid and p.shop = 'fr') t;
-
-CREATE VIEW v1 AS
-SELECT g.groupid groupid, p.goods goods,
- p.name name, p.shop shop,
- gp.price price
- FROM t3 g INNER JOIN t2 p ON g.goodsid = p.goods
- INNER JOIN t1 gp on p.goods = gp.goods;
-
-CREATE VIEW v2 AS
-SELECT DISTINCT g.groupid, fr.price
- FROM t4 g
- LEFT JOIN
- v1 fr on g.groupid = fr.groupid and fr.shop = 'fr';
-
-SELECT * FROM v2;
-
-SELECT * FROM
-(SELECT DISTINCT g.groupid, fr.price
- FROM t4 g
- LEFT JOIN
- v1 fr on g.groupid = fr.groupid and fr.shop = 'fr') t;
-
-DROP VIEW v1,v2;
-DROP TABLE t1,t2,t3,t4;
-
-#
-# Bug #13545: problem with NATURAL/USING joins.
-#
-
-CREATE TABLE t1(a int);
-CREATE TABLE t2(b int);
-CREATE TABLE t3(c int, d int);
-CREATE TABLE t4(d int);
-CREATE TABLE t5(e int, f int);
-CREATE TABLE t6(f int);
-CREATE VIEW v1 AS
- SELECT e FROM t5 JOIN t6 ON t5.e=t6.f;
-CREATE VIEW v2 AS
- SELECT e FROM t5 NATURAL JOIN t6;
-
-SELECT t1.a FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c JOIN t4 USING(d);
---error 1054
-SELECT t1.x FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c JOIN t4 USING(d);
-SELECT t1.a FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c NATURAL JOIN t4;
---error 1054
-SELECT t1.x FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c NATURAL JOIN t4;
-SELECT v1.e FROM v1 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d);
---error 1054
-SELECT v1.x FROM v1 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d);
-SELECT v2.e FROM v2 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d);
---error 1054
-SELECT v2.x FROM v2 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d);
-
-DROP VIEW v1, v2;
-DROP TABLE t1, t2, t3, t4, t5, t6;
-
-#
-# BUG#13126 -test case from bug report
-#
-create table t1 (id1 int(11) not null);
-insert into t1 values (1),(2);
-
-create table t2 (id2 int(11) not null);
-insert into t2 values (1),(2),(3),(4);
-
-create table t3 (id3 char(16) not null);
-insert into t3 values ('100');
-
-create table t4 (id2 int(11) not null, id3 char(16));
-
-create table t5 (id1 int(11) not null, key (id1));
-insert into t5 values (1),(2),(1);
-
-create view v1 as
- select t4.id3 from t4 join t2 on t4.id2 = t2.id2;
-
-select t1.id1 from t1 inner join (t3 left join v1 on t3.id3 = v1.id3);
-
-drop view v1;
-drop table t1, t2, t3, t4, t5;
-
-create table t0 (a int);
-insert into t0 values (0),(1),(2),(3);
-create table t1(a int);
-insert into t1 select A.a + 10*(B.a) from t0 A, t0 B;
-
-create table t2 (a int, b int);
-insert into t2 values (1,1), (2,2), (3,3);
-
-create table t3(a int, b int, filler char(200), key(a));
-insert into t3 select a,a,'filler' from t1;
-insert into t3 select a,a,'filler' from t1;
-
-create table t4 like t3;
-insert into t4 select * from t3;
-insert into t4 select * from t3;
-
-create table t5 like t4;
-insert into t5 select * from t4;
-insert into t5 select * from t4;
-
-create table t6 like t5;
-insert into t6 select * from t5;
-insert into t6 select * from t5;
-
-create table t7 like t6;
-insert into t7 select * from t6;
-insert into t7 select * from t6;
-
---replace_column 9 X
-explain select * from t4 join
- t2 left join (t3 join t5 on t5.a=t3.b) on t3.a=t2.b where t4.a<=>t3.b;
-
---replace_column 9 X
-explain select * from (t4 join t6 on t6.a=t4.b) right join t3 on t4.a=t3.b
- join t2 left join (t5 join t7 on t7.a=t5.b) on t5.a=t2.b where t3.a<=>t2.b;
-
---replace_column 9 X
-explain select * from t2 left join
- (t3 left join (t4 join t6 on t6.a=t4.b) on t4.a=t3.b
- join t5 on t5.a=t3.b) on t3.a=t2.b;
-
-drop table t0, t1, t2, t3, t4, t5, t6, t7;
-
-# BUG#16393
-create table t1 (a int);
-insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-create table t2 (a int, filler char(100), key(a));
-insert into t2 select A.a + 10*B.a, '' from t1 A, t1 B;
-create table t3 like t2;
-insert into t3 select * from t2;
-
-explain select * from t1 left join
- (t2 left join t3 on (t2.a = t3.a))
- on (t1.a = t2.a);
-drop table t1, t2, t3;
-
-#
-# Bug #16260: single row table in the inner nest of an outer join
-#
-
-CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, type varchar(10));
-CREATE TABLE t2 (pid int NOT NULL PRIMARY KEY, type varchar(10));
-CREATE TABLE t3 (cid int NOT NULL PRIMARY KEY,
- id int NOT NULL,
- pid int NOT NULL);
-
-INSERT INTO t1 VALUES (1, 'A'), (3, 'C');
-INSERT INTO t2 VALUES (1, 'A'), (3, 'C');
-INSERT INTO t3 VALUES (1, 1, 1), (3, 3, 3);
-
-SELECT * FROM t1 p LEFT JOIN (t3 JOIN t1)
- ON (t1.id=t3.id AND t1.type='B' AND p.id=t3.id)
- LEFT JOIN t2 ON (t3.pid=t2.pid)
- WHERE p.id=1;
-
-CREATE VIEW v1 AS
- SELECT t3.* FROM t3 JOIN t1 ON t1.id=t3.id AND t1.type='B';
-
-SELECT * FROM t1 p LEFT JOIN v1 ON p.id=v1.id
- LEFT JOIN t2 ON v1.pid=t2.pid
- WHERE p.id=1;
-
-DROP VIEW v1;
-DROP TABLE t1,t2,t3;
-
-
-#
-# Test for bug #18279: crash when on conditions are moved out of a nested join
-# to the on conditions for the nest
-
-CREATE TABLE t1 (id1 int PRIMARY KEY, id2 int);
-CREATE TABLE t2 (id1 int PRIMARY KEY, id2 int);
-CREATE TABLE t3 (id1 int PRIMARY KEY, id2 int);
-CREATE TABLE t4 (id1 int PRIMARY KEY, id2 int);
-CREATE TABLE t5 (id1 int PRIMARY KEY, id2 int);
-
-SELECT t1.id1 AS id, t5.id1 AS ngroupbynsa
- FROM t1 INNER JOIN t2 ON t2.id2 = t1.id1
- LEFT OUTER JOIN
- (t3 INNER JOIN t4 ON t4.id1 = t3.id2 INNER JOIN t5 ON t4.id2 = t5.id1)
- ON t3.id2 IS NOT NULL
- WHERE t1.id1=2;
-
-PREPARE stmt FROM
-"SELECT t1.id1 AS id, t5.id1 AS ngroupbynsa
- FROM t1 INNER JOIN t2 ON t2.id2 = t1.id1
- LEFT OUTER JOIN
- (t3 INNER JOIN t4 ON t4.id1 = t3.id2 INNER JOIN t5 ON t4.id2 = t5.id1)
- ON t3.id2 IS NOT NULL
- WHERE t1.id1=2";
-
-EXECUTE stmt;
-EXECUTE stmt;
-EXECUTE stmt;
-EXECUTE stmt;
-
-INSERT INTO t1 VALUES (1,1), (2,1), (3,2);
-INSERT INTO t2 VALUES (2,1), (3,2), (4,3);
-INSERT INTO t3 VALUES (1,1), (3,2), (2,NULL);
-INSERT INTO t4 VALUES (1,1), (2,1), (3,3);
-INSERT INTO t5 VALUES (1,1), (2,2), (3,3), (4,3);
-
-EXECUTE stmt;
-EXECUTE stmt;
-EXECUTE stmt;
-EXECUTE stmt;
-
-SELECT t1.id1 AS id, t5.id1 AS ngroupbynsa
- FROM t1 INNER JOIN t2 ON t2.id2 = t1.id1
- LEFT OUTER JOIN
- (t3 INNER JOIN t4 ON t4.id1 = t3.id2 INNER JOIN t5 ON t4.id2 = t5.id1)
- ON t3.id2 IS NOT NULL
- WHERE t1.id1=2;
-
-DROP TABLE t1,t2,t3,t4,t5;
-
-#
-# Test for bug #24345: crash with nested left outer join when outer table is substituted
-# for a row that happens to have a null value for the join attribute.
-#
-
-CREATE TABLE t1 (
- id int NOT NULL PRIMARY KEY,
- ct int DEFAULT NULL,
- pc int DEFAULT NULL,
- INDEX idx_ct (ct),
- INDEX idx_pc (pc)
-);
-INSERT INTO t1 VALUES
- (1,NULL,NULL),(2,NULL,NULL),(3,NULL,NULL),(4,NULL,NULL),(5,NULL,NULL);
-
-CREATE TABLE t2 (
- id int NOT NULL PRIMARY KEY,
- sr int NOT NULL,
- nm varchar(255) NOT NULL,
- INDEX idx_sr (sr)
-);
-INSERT INTO t2 VALUES
- (2441905,4308,'LesAbymes'),(2441906,4308,'Anse-Bertrand');
-
-CREATE TABLE t3 (
- id int NOT NULL PRIMARY KEY,
- ct int NOT NULL,
- ln int NOT NULL,
- INDEX idx_ct (ct),
- INDEX idx_ln (ln)
-);
-
-CREATE TABLE t4 (
- id int NOT NULL PRIMARY KEY,
- nm varchar(255) NOT NULL
-);
-
-INSERT INTO t4 VALUES (4308,'Guadeloupe'),(4309,'Martinique');
-
-SELECT t1.*
- FROM t1 LEFT JOIN
- (t2 LEFT JOIN t3 ON t3.ct=t2.id AND t3.ln='5') ON t1.ct=t2.id
- WHERE t1.id='5';
-
-SELECT t1.*, t4.nm
- FROM t1 LEFT JOIN
- (t2 LEFT JOIN t3 ON t3.ct=t2.id AND t3.ln='5') ON t1.ct=t2.id
- LEFT JOIN t4 ON t2.sr=t4.id
- WHERE t1.id='5';
-
-DROP TABLE t1,t2,t3,t4;
-
-
-SET optimizer_switch=@save_optimizer_switch;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/join_outer.test b/mysql-test/suite/pbxt/t/join_outer.test
deleted file mode 100644
index 4c5006c6b0a..00000000000
--- a/mysql-test/suite/pbxt/t/join_outer.test
+++ /dev/null
@@ -1,819 +0,0 @@
-#
-# test of left outer join
-#
-
---disable_warnings
-drop table if exists t0,t1,t2,t3,t4,t5;
---enable_warnings
-
-SET @save_optimizer_switch=@@optimizer_switch;
-SET optimizer_switch='outer_join_with_cache=off';
-
-CREATE TABLE t1 (
- grp int(11) default NULL,
- a bigint(20) unsigned default NULL,
- c char(10) NOT NULL default ''
-) ENGINE=MyISAM;
-INSERT INTO t1 VALUES (1,1,'a'),(2,2,'b'),(2,3,'c'),(3,4,'E'),(3,5,'C'),(3,6,'D'),(NULL,NULL,'');
-create table t2 (id int, a bigint unsigned not null, c char(10), d int, primary key (a));
-insert into t2 values (1,1,"a",1),(3,4,"A",4),(3,5,"B",5),(3,6,"C",6),(4,7,"D",7);
-
-select t1.*,t2.* from t1 JOIN t2 where t1.a=t2.a;
-select t1.*,t2.* from t1 left join t2 on (t1.a=t2.a) order by t1.grp,t1.a,t2.c;
-select t1.*,t2.* from { oj t2 left outer join t1 on (t1.a=t2.a) };
-select t1.*,t2.* from t1 as t0,{ oj t2 left outer join t1 on (t1.a=t2.a) } WHERE t0.a=2;
-select t1.*,t2.* from t1 left join t2 using (a);
-select t1.*,t2.* from t1 left join t2 using (a) where t1.a=t2.a;
-select t1.*,t2.* from t1 left join t2 using (a,c);
-select t1.*,t2.* from t1 left join t2 using (c);
-select t1.*,t2.* from t1 natural left outer join t2;
-
-select t1.*,t2.* from t1 left join t2 on (t1.a=t2.a) where t2.id=3;
-select t1.*,t2.* from t1 left join t2 on (t1.a=t2.a) where t2.id is null;
-
-explain select t1.*,t2.* from t1,t2 where t1.a=t2.a and isnull(t2.a)=1;
-explain select t1.*,t2.* from t1 left join t2 on t1.a=t2.a where isnull(t2.a)=1;
-
-select t1.*,t2.*,t3.a from t1 left join t2 on (t1.a=t2.a) left join t1 as t3 on (t2.a=t3.a);
-
-# The next query should rearange the left joins to get this to work
---error 1054
-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 1054
-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);
-
-# The next query should give an error in MySQL
---error 1054
-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);
-
-# Test of inner join
-select t1.*,t2.* from t1 inner join t2 using (a);
-select t1.*,t2.* from t1 inner join t2 on (t1.a=t2.a);
-select t1.*,t2.* from t1 natural join t2;
-
-drop table t1,t2;
-
-#
-# Test of left join bug
-#
-
-CREATE TABLE t1 (
- usr_id INT unsigned NOT NULL,
- uniq_id INT unsigned NOT NULL AUTO_INCREMENT,
- start_num INT unsigned NOT NULL DEFAULT 1,
- increment INT unsigned NOT NULL DEFAULT 1,
- PRIMARY KEY (uniq_id),
- INDEX usr_uniq_idx (usr_id, uniq_id),
- INDEX uniq_usr_idx (uniq_id, usr_id)
-);
-CREATE TABLE t2 (
- id INT unsigned NOT NULL DEFAULT 0,
- usr2_id INT unsigned NOT NULL DEFAULT 0,
- max INT unsigned NOT NULL DEFAULT 0,
- c_amount INT unsigned NOT NULL DEFAULT 0,
- d_max INT unsigned NOT NULL DEFAULT 0,
- d_num INT unsigned NOT NULL DEFAULT 0,
- orig_time INT unsigned NOT NULL DEFAULT 0,
- c_time INT unsigned NOT NULL DEFAULT 0,
- active ENUM ("no","yes") NOT NULL,
- PRIMARY KEY (id,usr2_id),
- INDEX id_idx (id),
- INDEX usr2_idx (usr2_id)
-);
-INSERT INTO t1 VALUES (3,NULL,0,50),(3,NULL,0,200),(3,NULL,0,25),(3,NULL,0,84676),(3,NULL,0,235),(3,NULL,0,10),(3,NULL,0,3098),(3,NULL,0,2947),(3,NULL,0,8987),(3,NULL,0,8347654),(3,NULL,0,20398),(3,NULL,0,8976),(3,NULL,0,500),(3,NULL,0,198);
-
-#1st select shows that one record is returned with null entries for the right
-#table, when selecting on an id that does not exist in the right table t2
-SELECT t1.usr_id,t1.uniq_id,t1.increment,
-t2.usr2_id,t2.c_amount,t2.max
-FROM t1
-LEFT JOIN t2 ON t2.id = t1.uniq_id
-WHERE t1.uniq_id = 4
-ORDER BY t2.c_amount;
-
-# The same with RIGHT JOIN
-SELECT t1.usr_id,t1.uniq_id,t1.increment,
-t2.usr2_id,t2.c_amount,t2.max
-FROM t2
-RIGHT JOIN t1 ON t2.id = t1.uniq_id
-WHERE t1.uniq_id = 4
-ORDER BY t2.c_amount;
-
-INSERT INTO t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes');
---error ER_DUP_ENTRY
-INSERT INTO t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes');
-INSERT INTO t2 VALUES (7,3,1000,2000,0,0,746294,937484,'yes');
-
-#3rd select should show that one record is returned with null entries for the
-# right table, when selecting on an id that does not exist in the right table
-# t2 but this select returns an empty set!!!!
-SELECT t1.usr_id,t1.uniq_id,t1.increment,t2.usr2_id,t2.c_amount,t2.max FROM t1 LEFT JOIN t2 ON t2.id = t1.uniq_id WHERE t1.uniq_id = 4 ORDER BY t2.c_amount;
-SELECT t1.usr_id,t1.uniq_id,t1.increment,t2.usr2_id,t2.c_amount,t2.max FROM t1 LEFT JOIN t2 ON t2.id = t1.uniq_id WHERE t1.uniq_id = 4 GROUP BY t2.c_amount;
-# Removing the ORDER BY works:
-SELECT t1.usr_id,t1.uniq_id,t1.increment,t2.usr2_id,t2.c_amount,t2.max FROM t1 LEFT JOIN t2 ON t2.id = t1.uniq_id WHERE t1.uniq_id = 4;
-
-drop table t1,t2;
-
-#
-# Test of LEFT JOIN with const tables (failed for frankie@etsetb.upc.es)
-#
-
-CREATE TABLE t1 (
- cod_asig int(11) DEFAULT '0' NOT NULL,
- desc_larga_cat varchar(80) DEFAULT '' NOT NULL,
- desc_larga_cas varchar(80) DEFAULT '' NOT NULL,
- desc_corta_cat varchar(40) DEFAULT '' NOT NULL,
- desc_corta_cas varchar(40) DEFAULT '' NOT NULL,
- cred_total double(3,1) DEFAULT '0.0' NOT NULL,
- pre_requisit int(11),
- co_requisit int(11),
- preco_requisit int(11),
- PRIMARY KEY (cod_asig)
-);
-
-INSERT INTO t1 VALUES (10360,'asdfggfg','Introduccion a los Ordenadores I','asdfggfg','Introduccio Ordinadors I',6.0,NULL,NULL,NULL);
-INSERT INTO t1 VALUES (10361,'Components i Circuits Electronics I','Componentes y Circuitos Electronicos I','Components i Circuits Electronics I','Comp. i Circ. Electr. I',6.0,NULL,NULL,NULL);
-INSERT INTO t1 VALUES (10362,'Laboratori d`Ordinadors','Laboratorio de Ordenadores','Laboratori d`Ordinadors','Laboratori Ordinadors',4.5,NULL,NULL,NULL);
-INSERT INTO t1 VALUES (10363,'Tecniques de Comunicacio Oral i Escrita','Tecnicas de Comunicacion Oral y Escrita','Tecniques de Comunicacio Oral i Escrita','Tec. Com. Oral i Escrita',4.5,NULL,NULL,NULL);
-INSERT INTO t1 VALUES (11403,'Projecte Fi de Carrera','Proyecto Fin de Carrera','Projecte Fi de Carrera','PFC',9.0,NULL,NULL,NULL);
-INSERT INTO t1 VALUES (11404,'+lgebra lineal','Algebra lineal','+lgebra lineal','+lgebra lineal',15.0,NULL,NULL,NULL);
-INSERT INTO t1 VALUES (11405,'+lgebra lineal','Algebra lineal','+lgebra lineal','+lgebra lineal',18.0,NULL,NULL,NULL);
-INSERT INTO t1 VALUES (11406,'Calcul Infinitesimal','Cßlculo Infinitesimal','Calcul Infinitesimal','Calcul Infinitesimal',15.0,NULL,NULL,NULL);
-
-CREATE TABLE t2 (
- idAssignatura int(11) DEFAULT '0' NOT NULL,
- Grup int(11) DEFAULT '0' NOT NULL,
- Places smallint(6) DEFAULT '0' NOT NULL,
- PlacesOcupades int(11) DEFAULT '0',
- PRIMARY KEY (idAssignatura,Grup)
-);
-
-
-INSERT INTO t2 VALUES (10360,12,333,0);
-INSERT INTO t2 VALUES (10361,30,2,0);
-INSERT INTO t2 VALUES (10361,40,3,0);
-INSERT INTO t2 VALUES (10360,45,10,0);
-INSERT INTO t2 VALUES (10362,10,12,0);
-INSERT INTO t2 VALUES (10360,55,2,0);
-INSERT INTO t2 VALUES (10360,70,0,0);
-INSERT INTO t2 VALUES (10360,565656,0,0);
-INSERT INTO t2 VALUES (10360,32767,7,0);
-INSERT INTO t2 VALUES (10360,33,8,0);
-INSERT INTO t2 VALUES (10360,7887,85,0);
-INSERT INTO t2 VALUES (11405,88,8,0);
-INSERT INTO t2 VALUES (10360,0,55,0);
-INSERT INTO t2 VALUES (10360,99,0,0);
-INSERT INTO t2 VALUES (11411,30,10,0);
-INSERT INTO t2 VALUES (11404,0,0,0);
-INSERT INTO t2 VALUES (10362,11,111,0);
-INSERT INTO t2 VALUES (10363,33,333,0);
-INSERT INTO t2 VALUES (11412,55,0,0);
-INSERT INTO t2 VALUES (50003,66,6,0);
-INSERT INTO t2 VALUES (11403,5,0,0);
-INSERT INTO t2 VALUES (11406,11,11,0);
-INSERT INTO t2 VALUES (11410,11410,131,0);
-INSERT INTO t2 VALUES (11416,11416,32767,0);
-INSERT INTO t2 VALUES (11409,0,0,0);
-
-CREATE TABLE t3 (
- id int(11) NOT NULL auto_increment,
- dni_pasaporte char(16) DEFAULT '' NOT NULL,
- idPla int(11) DEFAULT '0' NOT NULL,
- cod_asig int(11) DEFAULT '0' NOT NULL,
- any smallint(6) DEFAULT '0' NOT NULL,
- quatrimestre smallint(6) DEFAULT '0' NOT NULL,
- estat char(1) DEFAULT 'M' NOT NULL,
- PRIMARY KEY (id),
- UNIQUE dni_pasaporte (dni_pasaporte,idPla),
- UNIQUE dni_pasaporte_2 (dni_pasaporte,idPla,cod_asig,any,quatrimestre)
-);
-
-INSERT INTO t3 VALUES (1,'11111111',1,10362,98,1,'M');
-
-CREATE TABLE t4 (
- id int(11) NOT NULL auto_increment,
- papa int(11) DEFAULT '0' NOT NULL,
- fill int(11) DEFAULT '0' NOT NULL,
- idPla int(11) DEFAULT '0' NOT NULL,
- PRIMARY KEY (id),
- KEY papa (idPla,papa),
- UNIQUE papa_2 (idPla,papa,fill)
-);
-
-INSERT INTO t4 VALUES (1,-1,10360,1);
-INSERT INTO t4 VALUES (2,-1,10361,1);
-INSERT INTO t4 VALUES (3,-1,10362,1);
-
-SELECT DISTINCT fill,desc_larga_cat,cred_total,Grup,Places,PlacesOcupades FROM t4 LEFT JOIN t3 ON t3.cod_asig=fill AND estat='S' AND dni_pasaporte='11111111' AND t3.idPla=1 , t2,t1 WHERE fill=t1.cod_asig AND Places>PlacesOcupades AND fill=idAssignatura AND t4.idPla=1 AND papa=-1;
-
-SELECT DISTINCT fill,t3.idPla FROM t4 LEFT JOIN t3 ON t3.cod_asig=t4.fill AND t3.estat='S' AND t3.dni_pasaporte='1234' AND t3.idPla=1 ;
-
-INSERT INTO t3 VALUES (3,'1234',1,10360,98,1,'S');
-SELECT DISTINCT fill,t3.idPla FROM t4 LEFT JOIN t3 ON t3.cod_asig=t4.fill AND t3.estat='S' AND t3.dni_pasaporte='1234' AND t3.idPla=1 ;
-
-drop table t1,t2,t3,test.t4;
-
-#
-# Test of IS NULL on AUTO_INCREMENT with LEFT JOIN
-#
-
-CREATE TABLE t1 (
- id smallint(5) unsigned NOT NULL auto_increment,
- name char(60) DEFAULT '' NOT NULL,
- PRIMARY KEY (id)
-);
-INSERT INTO t1 VALUES (1,'Antonio Paz');
-INSERT INTO t1 VALUES (2,'Lilliana Angelovska');
-INSERT INTO t1 VALUES (3,'Thimble Smith');
-
-CREATE TABLE t2 (
- id smallint(5) unsigned NOT NULL auto_increment,
- owner smallint(5) unsigned DEFAULT '0' NOT NULL,
- name char(60),
- PRIMARY KEY (id)
-);
-INSERT INTO t2 VALUES (1,1,'El Gato');
-INSERT INTO t2 VALUES (2,1,'Perrito');
-INSERT INTO t2 VALUES (3,3,'Happy');
-
-select t1.name, t2.name, t2.id from t1 left join t2 on (t1.id = t2.owner);
-select t1.name, t2.name, t2.id from t1 left join t2 on (t1.id = t2.owner) where t2.id is null;
-explain select t1.name, t2.name, t2.id from t1 left join t2 on (t1.id = t2.owner) where t2.id is null;
-explain select t1.name, t2.name, t2.id from t1 left join t2 on (t1.id = t2.owner) where t2.name is null;
-select count(*) from t1 left join t2 on (t1.id = t2.owner);
-
-select t1.name, t2.name, t2.id from t2 right join t1 on (t1.id = t2.owner);
-select t1.name, t2.name, t2.id from t2 right join t1 on (t1.id = t2.owner) where t2.id is null;
-explain select t1.name, t2.name, t2.id from t2 right join t1 on (t1.id = t2.owner) where t2.id is null;
-explain select t1.name, t2.name, t2.id from t2 right join t1 on (t1.id = t2.owner) where t2.name is null;
-select count(*) from t2 right join t1 on (t1.id = t2.owner);
-
-select t1.name, t2.name, t2.id,t3.id from t2 right join t1 on (t1.id = t2.owner) left join t1 as t3 on t3.id=t2.owner;
-select t1.name, t2.name, t2.id,t3.id from t1 right join t2 on (t1.id = t2.owner) right join t1 as t3 on t3.id=t2.owner;
-select t1.name, t2.name, t2.id, t2.owner, t3.id from t1 left join t2 on (t1.id = t2.owner) right join t1 as t3 on t3.id=t2.owner;
-
-drop table t1,t2;
-
-create table t1 (id int not null, str char(10), index(str));
-insert into t1 values (1, null), (2, null), (3, "foo"), (4, "bar");
-select * from t1 where str is not null order by id;
-select * from t1 where str is null;
-drop table t1;
-
-#
-# Test wrong LEFT JOIN query
-#
-
-CREATE TABLE t1 (
- t1_id bigint(21) NOT NULL auto_increment,
- PRIMARY KEY (t1_id)
-);
-CREATE TABLE t2 (
- t2_id bigint(21) NOT NULL auto_increment,
- PRIMARY KEY (t2_id)
-);
-CREATE TABLE t3 (
- t3_id bigint(21) NOT NULL auto_increment,
- PRIMARY KEY (t3_id)
-);
-CREATE TABLE t4 (
- seq_0_id bigint(21) DEFAULT '0' NOT NULL,
- seq_1_id bigint(21) DEFAULT '0' NOT NULL,
- KEY seq_0_id (seq_0_id),
- KEY seq_1_id (seq_1_id)
-);
-CREATE TABLE t5 (
- seq_0_id bigint(21) DEFAULT '0' NOT NULL,
- seq_1_id bigint(21) DEFAULT '0' NOT NULL,
- KEY seq_1_id (seq_1_id),
- KEY seq_0_id (seq_0_id)
-);
-
-insert into t1 values (1);
-insert into t2 values (1);
-insert into t3 values (1);
-insert into t4 values (1,1);
-insert into t5 values (1,1);
-
---error 1054
-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;
-
-drop table t1,t2,t3,t4,t5;
-
-#
-# Another LEFT JOIN problem
-# (The problem was that the result changed when we added ORDER BY)
-#
-
-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));
-insert into t1 values (1, 2, 11), (1, 2, 7), (2, 2, 8), (1,2,9),(1,3,9);
-insert into t2 values (1, 2, 3),(2, 2, 8), (4,3,9),(3,2,10);
-select t1.*, t2.* from t1 left join t2 on t1.n = t2.n and
-t1.m = t2.m where t1.n = 1;
-select t1.*, t2.* from t1 left join t2 on t1.n = t2.n and
-t1.m = t2.m where t1.n = 1 order by t1.o;
-drop table t1,t2;
-
-# Test bug with NATURAL join:
-
-CREATE TABLE t1 (id1 INT NOT NULL PRIMARY KEY, dat1 CHAR(1), id2 INT);
-INSERT INTO t1 VALUES (1,'a',1);
-INSERT INTO t1 VALUES (2,'b',1);
-INSERT INTO t1 VALUES (3,'c',2);
-
-CREATE TABLE t2 (id2 INT NOT NULL PRIMARY KEY, dat2 CHAR(1));
-INSERT INTO t2 VALUES (1,'x');
-INSERT INTO t2 VALUES (2,'y');
-INSERT INTO t2 VALUES (3,'z');
-
-SELECT t2.id2 FROM t2 LEFT OUTER JOIN t1 ON t1.id2 = t2.id2 WHERE id1 IS NULL;
-SELECT t2.id2 FROM t2 NATURAL LEFT OUTER JOIN t1 WHERE id1 IS NULL;
-
-drop table t1,t2;
-
-create table t1 ( color varchar(20), name varchar(20) );
-insert into t1 values ( 'red', 'apple' );
-insert into t1 values ( 'yellow', 'banana' );
-insert into t1 values ( 'green', 'lime' );
-insert into t1 values ( 'black', 'grape' );
-insert into t1 values ( 'blue', 'blueberry' );
-create table t2 ( count int, color varchar(20) );
-insert into t2 values (10, 'green');
-insert into t2 values (5, 'black');
-insert into t2 values (15, 'white');
-insert into t2 values (7, 'green');
-select * from t1;
-select * from t2;
-select * from t2 natural join t1;
-select t2.count, t1.name from t2 natural join t1;
-select t2.count, t1.name from t2 inner join t1 using (color);
-drop table t1;
-drop table t2;
-
-#
-# Test of LEFT JOIN + GROUP FUNCTIONS within functions:
-#
-
-CREATE TABLE t1 (
- pcode varchar(8) DEFAULT '' NOT NULL
-);
-INSERT INTO t1 VALUES ('kvw2000'),('kvw2001'),('kvw3000'),('kvw3001'),('kvw3002'),('kvw3500'),('kvw3501'),('kvw3502'),('kvw3800'),('kvw3801'),('kvw3802'),('kvw3900'),('kvw3901'),('kvw3902'),('kvw4000'),('kvw4001'),('kvw4002'),('kvw4200'),('kvw4500'),('kvw5000'),('kvw5001'),('kvw5500'),('kvw5510'),('kvw5600'),('kvw5601'),('kvw6000'),('klw1000'),('klw1020'),('klw1500'),('klw2000'),('klw2001'),('klw2002'),('kld2000'),('klw2500'),('kmw1000'),('kmw1500'),('kmw2000'),('kmw2001'),('kmw2100'),('kmw3000'),('kmw3200');
-CREATE TABLE t2 (
- pcode varchar(8) DEFAULT '' NOT NULL,
- KEY pcode (pcode)
-);
-INSERT INTO t2 VALUES ('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw6000'),('kvw6000'),('kld2000');
-
-SELECT t1.pcode, IF(ISNULL(t2.pcode), 0, COUNT(*)) AS count FROM t1
-LEFT JOIN t2 ON t1.pcode = t2.pcode GROUP BY t1.pcode;
-SELECT SQL_BIG_RESULT t1.pcode, IF(ISNULL(t2.pcode), 0, COUNT(*)) AS count FROM t1 LEFT JOIN t2 ON t1.pcode = t2.pcode GROUP BY t1.pcode;
-drop table t1,t2;
-
-#
-# Another left join problem
-#
-
-CREATE TABLE t1 (
- id int(11),
- pid int(11),
- rep_del tinyint(4),
- KEY id (id),
- KEY pid (pid)
-);
-INSERT INTO t1 VALUES (1,NULL,NULL);
-INSERT INTO t1 VALUES (2,1,NULL);
-select * from t1 LEFT JOIN t1 t2 ON (t1.id=t2.pid) AND t2.rep_del IS NULL;
-create index rep_del ON t1(rep_del);
-select * from t1 LEFT JOIN t1 t2 ON (t1.id=t2.pid) AND t2.rep_del IS NULL;
-drop table t1;
-
-CREATE TABLE t1 (
- id int(11) DEFAULT '0' NOT NULL,
- name tinytext DEFAULT '' NOT NULL,
- UNIQUE id (id)
-);
-INSERT INTO t1 VALUES (1,'yes'),(2,'no');
-CREATE TABLE t2 (
- id int(11) DEFAULT '0' NOT NULL,
- idx int(11) DEFAULT '0' NOT NULL,
- UNIQUE id (id,idx)
-);
-INSERT INTO t2 VALUES (1,1);
-explain SELECT * from t1 left join t2 on t1.id=t2.id where t2.id IS NULL;
-SELECT * from t1 left join t2 on t1.id=t2.id where t2.id IS NULL;
-drop table t1,t2;
-
-#
-# Test problem with using key_column= constant in ON and WHERE
-#
-create table t1 (bug_id mediumint, reporter mediumint);
-create table t2 (bug_id mediumint, who mediumint, index(who));
-insert into t2 values (1,1),(1,2);
-insert into t1 values (1,1),(2,1);
-SELECT * FROM t1 LEFT JOIN t2 ON (t1.bug_id = t2.bug_id AND t2.who = 2) WHERE (t1.reporter = 2 OR t2.who = 2);
-drop table t1,t2;
-
-#
-# Test problem with LEFT JOIN
-
-create table t1 (fooID smallint unsigned auto_increment, primary key (fooID));
-create table t2 (fooID smallint unsigned not null, barID smallint unsigned not null, primary key (fooID,barID));
-insert into t1 (fooID) values (10),(20),(30);
-insert into t2 values (10,1),(20,2),(30,3);
-explain select * from t2 left join t1 on t1.fooID = t2.fooID and t1.fooID = 30;
-select * from t2 left join t1 on t1.fooID = t2.fooID and t1.fooID = 30;
-select * from t2 left join t1 ignore index(primary) on t1.fooID = t2.fooID and t1.fooID = 30;
-drop table t1,t2;
-
-create table t1 (i int);
-create table t2 (i int);
-create table t3 (i int);
-insert into t1 values(1),(2);
-insert into t2 values(2),(3);
-insert into t3 values(2),(4);
-select * from t1 natural left join t2 natural left join t3;
-select * from t1 natural left join t2 where (t2.i is not null)=0;
-select * from t1 natural left join t2 where (t2.i is not null) is not null;
-select * from t1 natural left join t2 where (i is not null)=0;
-select * from t1 natural left join t2 where (i is not null) is not null;
-drop table t1,t2,t3;
-
-#
-# Test of USING
-#
-create table t1 (f1 integer,f2 integer,f3 integer);
-create table t2 (f2 integer,f4 integer);
-create table t3 (f3 integer,f5 integer);
-select * from t1
- left outer join t2 using (f2)
- left outer join t3 using (f3);
-drop table t1,t2,t3;
-
-create table t1 (a1 int, a2 int);
-create table t2 (b1 int not null, b2 int);
-create table t3 (c1 int, c2 int);
-
-insert into t1 values (1,2), (2,2), (3,2);
-insert into t2 values (1,3), (2,3);
-insert into t3 values (2,4), (3,4);
-
-select * from t1 left join t2 on b1 = a1 left join t3 on c1 = a1 and b1 is null;
-explain select * from t1 left join t2 on b1 = a1 left join t3 on c1 = a1 and b1 is null;
-
-drop table t1, t2, t3;
-
-# Test for BUG#8711 '<=>' was considered to be a NULL-rejecting predicate.
-create table t1 (
- a int(11),
- b char(10),
- key (a)
-);
-insert into t1 (a) values (1),(2),(3),(4);
-create table t2 (a int);
-
-select * from t1 left join t2 on t1.a=t2.a where not (t2.a <=> t1.a);
-select * from t1 left join t2 on t1.a=t2.a having not (t2.a <=> t1.a);
-drop table t1,t2;
-
-# Test for BUG#5088
-
-create table t1 (
- match_id tinyint(3) unsigned not null auto_increment,
- home tinyint(3) unsigned default '0',
- unique key match_id (match_id),
- key match_id_2 (match_id)
-);
-
-insert into t1 values("1", "2");
-
-create table t2 (
- player_id tinyint(3) unsigned default '0',
- match_1_h tinyint(3) unsigned default '0',
- key player_id (player_id)
-);
-
-insert into t2 values("1", "5");
-insert into t2 values("2", "9");
-insert into t2 values("3", "3");
-insert into t2 values("4", "7");
-insert into t2 values("5", "6");
-insert into t2 values("6", "8");
-insert into t2 values("7", "4");
-insert into t2 values("8", "12");
-insert into t2 values("9", "11");
-insert into t2 values("10", "10");
-
-explain select s.*, '*', m.*, (s.match_1_h - m.home) UUX from
- (t2 s left join t1 m on m.match_id = 1)
- order by m.match_id desc;
-
-explain select s.*, '*', m.*, (s.match_1_h - m.home) UUX from
- (t2 s left join t1 m on m.match_id = 1)
- order by UUX desc;
-
-select s.*, '*', m.*, (s.match_1_h - m.home) UUX from
- (t2 s left join t1 m on m.match_id = 1)
- order by UUX desc;
-
-explain select s.*, '*', m.*, (s.match_1_h - m.home) UUX from
- t2 s straight_join t1 m where m.match_id = 1
- order by UUX desc;
-
-select s.*, '*', m.*, (s.match_1_h - m.home) UUX from
- t2 s straight_join t1 m where m.match_id = 1
- order by UUX desc;
-
-drop table t1, t2;
-
-# Tests for bugs #6307 and 6460
-
-create table t1 (a int, b int, unique index idx (a, b));
-create table t2 (a int, b int, c int, unique index idx (a, b));
-
-insert into t1 values (1, 10), (1,11), (2,10), (2,11);
-insert into t2 values (1,10,3);
-
-select t1.a, t1.b, t2.c from t1 left join t2
- on t1.a=t2.a and t1.b=t2.b and t2.c=3
- where t1.a=1 and t2.c is null;
-
-drop table t1, t2;
-
-CREATE TABLE t1 (
- ts_id bigint(20) default NULL,
- inst_id tinyint(4) default NULL,
- flag_name varchar(64) default NULL,
- flag_value text,
- UNIQUE KEY ts_id (ts_id,inst_id,flag_name)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
-CREATE TABLE t2 (
- ts_id bigint(20) default NULL,
- inst_id tinyint(4) default NULL,
- flag_name varchar(64) default NULL,
- flag_value text,
- UNIQUE KEY ts_id (ts_id,inst_id,flag_name)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
-INSERT INTO t1 VALUES
- (111056548820001, 0, 'flag1', NULL),
- (111056548820001, 0, 'flag2', NULL),
- (2, 0, 'other_flag', NULL);
-
-INSERT INTO t2 VALUES
- (111056548820001, 3, 'flag1', 'sss');
-
-SELECT t1.flag_name,t2.flag_value
- FROM t1 LEFT JOIN t2
- ON (t1.ts_id = t2.ts_id AND t1.flag_name = t2.flag_name AND
- t2.inst_id = 3)
- WHERE t1.inst_id = 0 AND t1.ts_id=111056548820001 AND
- t2.flag_value IS NULL;
-
-DROP TABLE t1,t2;
-
-CREATE TABLE t1 (
- id int(11) unsigned NOT NULL auto_increment,
- text_id int(10) unsigned default NULL,
- PRIMARY KEY (id)
-);
-
-INSERT INTO t1 VALUES("1", "0");
-INSERT INTO t1 VALUES("2", "10");
-
-CREATE TABLE t2 (
- text_id char(3) NOT NULL default '',
- language_id char(3) NOT NULL default '',
- text_data text,
- PRIMARY KEY (text_id,language_id)
-);
-
-INSERT INTO t2 VALUES("0", "EN", "0-EN");
-INSERT INTO t2 VALUES("0", "SV", "0-SV");
-INSERT INTO t2 VALUES("10", "EN", "10-EN");
-INSERT INTO t2 VALUES("10", "SV", "10-SV");
-SELECT t1.id, t1.text_id, t2.text_data
- FROM t1 LEFT JOIN t2
- ON t1.text_id = t2.text_id
- AND t2.language_id = 'SV'
- WHERE (t1.id LIKE '%' OR t2.text_data LIKE '%');
-
-DROP TABLE t1, t2;
-
-# Test for bug #5896
-
-CREATE TABLE t0 (a0 int PRIMARY KEY);
-CREATE TABLE t1 (a1 int PRIMARY KEY);
-CREATE TABLE t2 (a2 int);
-CREATE TABLE t3 (a3 int);
-INSERT INTO t0 VALUES (1);
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (1), (2);
-INSERT INTO t3 VALUES (1), (2);
-
-SELECT * FROM t1 LEFT JOIN t2 ON a1=0;
-EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON a1=0;
-SELECT * FROM t1 LEFT JOIN (t2,t3) ON a1=0;
-EXPLAIN SELECT * FROM t1 LEFT JOIN (t2,t3) ON a1=0;
-SELECT * FROM t0, t1 LEFT JOIN (t2,t3) ON a1=0 WHERE a0=a1;
-EXPLAIN SELECT * FROM t0, t1 LEFT JOIN (t2,t3) ON a1=0 WHERE a0=a1;
-
-INSERT INTO t0 VALUES (0);
-INSERT INTO t1 VALUES (0);
-SELECT * FROM t0, t1 LEFT JOIN (t2,t3) ON a1=5 WHERE a0=a1 AND a0=1;
-EXPLAIN SELECT * FROM t0, t1 LEFT JOIN (t2,t3) ON a1=5 WHERE a0=a1 AND a0=1;
-
-# Test for BUG#4480
-drop table t1,t2;
-create table t1 (a int, b int);
-insert into t1 values (1,1),(2,2),(3,3);
-create table t2 (a int, b int);
-insert into t2 values (1,1), (2,2);
-
-select * from t2 right join t1 on t2.a=t1.a;
-select straight_join * from t2 right join t1 on t2.a=t1.a;
-
-DROP TABLE t0,t1,t2,t3;
-
-#
-# Test for bug #9017: left join mistakingly converted to inner join
-#
-
-CREATE TABLE t1 (a int PRIMARY KEY, b int);
-CREATE TABLE t2 (a int PRIMARY KEY, b int);
-
-INSERT INTO t1 VALUES (1,1), (2,1), (3,1), (4,2);
-INSERT INTO t2 VALUES (1,2), (2,2);
-
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a;
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE t1.b=1;
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a
- WHERE t1.b=1 XOR (NOT ISNULL(t2.a) AND t2.b=1);
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE not(0+(t1.a=30 and t2.b=1));
-
-DROP TABLE t1,t2;
-
-# Bug #8681: Bad warning message when group_concat() exceeds max length
-set group_concat_max_len=5;
-create table t1 (a int, b varchar(20));
-create table t2 (a int, c varchar(20));
-insert into t1 values (1,"aaaaaaaaaa"),(2,"bbbbbbbbbb");
-insert into t2 values (1,"cccccccccc"),(2,"dddddddddd");
-select group_concat(t1.b,t2.c) from t1 left join t2 using(a) group by t1.a;
-select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by t1.a;
-select group_concat(t1.b,t2.c) from t1 left join t2 using(a) group by a;
-select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by a;
-drop table t1, t2;
-set group_concat_max_len=default;
-
-# End of 4.1 tests
-
-#
-# BUG#10162 - ON is merged with WHERE, left join is convered to a regular join
-#
-create table t1 (gid smallint(5) unsigned not null, x int(11) not null, y int(11) not null, art int(11) not null, primary key (gid,x,y));
-insert t1 values (1, -5, -8, 2), (1, 2, 2, 1), (1, 1, 1, 1);
-create table t2 (gid smallint(5) unsigned not null, x int(11) not null, y int(11) not null, id int(11) not null, primary key (gid,id,x,y), key id (id));
-insert t2 values (1, -5, -8, 1), (1, 1, 1, 1), (1, 2, 2, 1);
-create table t3 ( set_id smallint(5) unsigned not null, id tinyint(4) unsigned not null, name char(12) not null, primary key (id,set_id));
-insert t3 values (0, 1, 'a'), (1, 1, 'b'), (0, 2, 'c'), (1, 2, 'd'), (1, 3, 'e'), (1, 4, 'f'), (1, 5, 'g'), (1, 6, 'h');
-explain select name from t1 left join t2 on t1.x = t2.x and t1.y = t2.y
-left join t3 on t1.art = t3.id where t2.id =1 and t2.x = -5 and t2.y =-8
-and t1.gid =1 and t2.gid =1 and t3.set_id =1;
-drop tables t1,t2,t3;
-
-#
-# Test for bug #9938: invalid conversion from outer join to inner join
-# for queries containing indirect reference in WHERE clause
-#
-
-CREATE TABLE t1 (EMPNUM INT, GRP INT);
-INSERT INTO t1 VALUES (0, 10);
-INSERT INTO t1 VALUES (2, 30);
-
-CREATE TABLE t2 (EMPNUM INT, NAME CHAR(5));
-INSERT INTO t2 VALUES (0, 'KERI');
-INSERT INTO t2 VALUES (9, 'BARRY');
-
-CREATE VIEW v1 AS
-SELECT COALESCE(t2.EMPNUM,t1.EMPNUM) AS EMPNUM, NAME, GRP
- FROM t2 LEFT OUTER JOIN t1 ON t2.EMPNUM=t1.EMPNUM;
-
-SELECT * FROM v1;
-SELECT * FROM v1 WHERE EMPNUM < 10;
-
-DROP VIEW v1;
-DROP TABLE t1,t2;
-
-#
-# Test for bug #11285: false Item_equal on expression in outer join
-#
-
-CREATE TABLE t1 (c11 int);
-CREATE TABLE t2 (c21 int);
-INSERT INTO t1 VALUES (30), (40), (50);
-INSERT INTO t2 VALUES (300), (400), (500);
-SELECT * FROM t1 LEFT JOIN t2 ON (c11=c21 AND c21=30) WHERE c11=40;
-DROP TABLE t1, t2;
-#
-# Test for bugs
-# #12101: erroneously applied outer join elimination in case of WHERE NOT BETWEEN
-# #12102: erroneously missing outer join elimination in case of WHERE IN/IF
-#
-
-CREATE TABLE t1 (a int PRIMARY KEY, b int);
-CREATE TABLE t2 (a int PRIMARY KEY, b int);
-
-INSERT INTO t1 VALUES (1,2), (2,1), (3,2), (4,3), (5,6), (6,5), (7,8), (8,7), (9,10);
-INSERT INTO t2 VALUES (3,0), (4,1), (6,4), (7,5);
-
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t2.b <= t1.a AND t1.a <= t1.b;
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a BETWEEN t2.b AND t1.b;
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT(t1.a NOT BETWEEN t2.b AND t1.b);
-
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t2.b > t1.a OR t1.a > t1.b;
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a NOT BETWEEN t2.b AND t1.b;
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT(t1.a BETWEEN t2.b AND t1.b);
-
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a = t2.a OR t2.b > t1.a OR t1.a > t1.b;
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT(t1.a != t2.a AND t1.a BETWEEN t2.b AND t1.b);
-
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a = t2.a AND (t2.b > t1.a OR t1.a > t1.b);
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT(t1.a != t2.a OR t1.a BETWEEN t2.b AND t1.b);
-
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a = t2.a OR t1.a = t2.b;
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a IN(t2.a, t2.b);
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT(t1.a NOT IN(t2.a, t2.b));
-
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a != t1.b AND t1.a != t2.b;
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a NOT IN(t1.b, t2.b);
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT(t1.a IN(t1.b, t2.b));
-
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t2.a != t2.b OR (t1.a != t2.a AND t1.a != t2.b);
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT(t2.a = t2.b AND t1.a IN(t2.a, t2.b));
-
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t2.a != t2.b AND t1.a != t1.b AND t1.a != t2.b;
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT(t2.a = t2.b OR t1.a IN(t1.b, t2.b));
-
-EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a = t2.a OR t1.a = t2.b;
-EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a IN(t2.a, t2.b);
-EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a > IF(t1.a = t2.b-2, t2.b, t2.b-1);
-
-DROP TABLE t1,t2;
-
-#
-# Test for bug #17164: ORed FALSE blocked conversion of outer join into join
-#
-
-# Test case moved to join_outer_innodb
-
-#
-# Bug 19396: LEFT OUTER JOIN over views in curly braces
-#
---disable_warnings
-DROP VIEW IF EXISTS v1,v2;
-DROP TABLE IF EXISTS t1,t2;
---enable_warnings
-
-CREATE TABLE t1 (a int);
-CREATE table t2 (b int);
-INSERT INTO t1 VALUES (1), (2), (3), (4), (1), (1), (3);
-INSERT INTO t2 VALUES (2), (3);
-
-CREATE VIEW v1 AS SELECT a FROM t1 JOIN t2 ON t1.a=t2.b;
-CREATE VIEW v2 AS SELECT b FROM t2 JOIN t1 ON t2.b=t1.a;
-
-SELECT v1.a, v2. b
- FROM v1 LEFT OUTER JOIN v2 ON (v1.a=v2.b) AND (v1.a >= 3)
- GROUP BY v1.a;
-SELECT v1.a, v2. b
- FROM { OJ v1 LEFT OUTER JOIN v2 ON (v1.a=v2.b) AND (v1.a >= 3) }
- GROUP BY v1.a;
-
-DROP VIEW v1,v2;
-DROP TABLE t1,t2;
-
-#
-# Bug 19816: LEFT OUTER JOIN with constant ORed predicates in WHERE clause
-#
-
-CREATE TABLE t1 (a int);
-CREATE TABLE t2 (b int);
-INSERT INTO t1 VALUES (1), (2), (3), (4);
-INSERT INTO t2 VALUES (2), (3);
-
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (1=1);
-
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (1 OR 1);
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (0 OR 1);
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (1=1 OR 2=2);
-SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (1=1 OR 1=0);
-
-DROP TABLE t1,t2;
-
-SET optimizer_switch=@save_optimizer_switch;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/key.test b/mysql-test/suite/pbxt/t/key.test
deleted file mode 100644
index 8d3dcbd174d..00000000000
--- a/mysql-test/suite/pbxt/t/key.test
+++ /dev/null
@@ -1,447 +0,0 @@
---disable_warnings
-drop table if exists t1,t2,t3;
---enable_warnings
-SET SQL_WARNINGS=1;
-
-#
-# This failed for Elizabeth Mattijsen
-#
-
-CREATE TABLE t1 (
- ID CHAR(32) NOT NULL,
- name CHAR(32) NOT NULL,
- value CHAR(255),
- INDEX indexIDname (ID(8),name(8))
-) ;
-
-INSERT INTO t1 VALUES
-('keyword','indexdir','/export/home/local/www/database/indexes/keyword');
-INSERT INTO t1 VALUES ('keyword','urlprefix','text/ /text');
-INSERT INTO t1 VALUES ('keyword','urlmap','/text/ /');
-INSERT INTO t1 VALUES ('keyword','attr','personal employee company');
-INSERT INTO t1 VALUES
-('emailgids','indexdir','/export/home/local/www/database/indexes/emailgids');
-INSERT INTO t1 VALUES ('emailgids','urlprefix','text/ /text');
-INSERT INTO t1 VALUES ('emailgids','urlmap','/text/ /');
-INSERT INTO t1 VALUES ('emailgids','attr','personal employee company');
-
-SELECT value FROM t1 WHERE ID='emailgids' AND name='attr';
-
-drop table t1;
-
-#
-# Problem with many key parts and many or
-#
-
-CREATE TABLE t1 (
- price int(5) DEFAULT '0' NOT NULL,
- area varchar(40) DEFAULT '' NOT NULL,
- type varchar(40) DEFAULT '' NOT NULL,
- transityes enum('Y','N') DEFAULT 'Y' NOT NULL,
- shopsyes enum('Y','N') DEFAULT 'Y' NOT NULL,
- schoolsyes enum('Y','N') DEFAULT 'Y' NOT NULL,
- petsyes enum('Y','N') DEFAULT 'Y' NOT NULL,
- KEY price (price,area,type,transityes,shopsyes,schoolsyes,petsyes)
-);
-
-INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','N','N','N','N');
-INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','N','N','N','N');
-INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','','','','');
-INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y');
-INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y');
-INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y');
-INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y');
-INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y');
-
- SELECT * FROM t1 WHERE area='Vancouver' and transityes='y' and schoolsyes='y' and ( ((type='1 Bedroom' or type='Studio/Bach') and (price<=500)) or ((type='2 Bedroom') and (price<=550)) or ((type='Shared/Roomate') and (price<=300)) or ((type='Room and Board') and (price<=500)) ) and price <= 400;
-
-drop table t1;
-
-#
-# No longer a problem with primary key
-#
-
-CREATE TABLE t1 (program enum('signup','unique','sliding') not null, type enum('basic','sliding','signup'), sites set('mt'), PRIMARY KEY (program));
-# This no longer give an error for wrong primary key
-ALTER TABLE t1 modify program enum('signup','unique','sliding');
-drop table t1;
-
-#
-# Test of compressed decimal index.
-#
-
-CREATE TABLE t1 (
- name varchar(50) DEFAULT '' NOT NULL,
- author varchar(50) DEFAULT '' NOT NULL,
- category decimal(10,0) DEFAULT '0' NOT NULL,
- email varchar(50),
- password varchar(50),
- proxy varchar(50),
- bitmap varchar(20),
- msg varchar(255),
- urlscol varchar(127),
- urlhttp varchar(127),
- timeout decimal(10,0),
- nbcnx decimal(10,0),
- creation decimal(10,0),
- livinguntil decimal(10,0),
- lang decimal(10,0),
- type decimal(10,0),
- subcat decimal(10,0),
- subtype decimal(10,0),
- reg char(1),
- scs varchar(255),
- capacity decimal(10,0),
- userISP varchar(50),
- CCident varchar(50) DEFAULT '' NOT NULL,
- PRIMARY KEY (name,author,category)
-);
-INSERT INTO t1 VALUES
-('patnom','patauteur',0,'p.favre@cryo-networks.fr',NULL,NULL,'#p2sndnq6ae5g1u6t','essai salut','scol://195.242.78.119:patauteur.patnom',NULL,NULL,NULL,950036174,-882087474,NULL,3,0,3,'1','Pub/patnom/futur_divers.scs',NULL,'pat','CC1');
-INSERT INTO t1 VALUES
-('LeNomDeMonSite','Marc',0,'m.barilley@cryo-networks.fr',NULL,NULL,NULL,NULL,'scol://195.242.78.119:Marc.LeNomDeMonSite',NULL,NULL,NULL,950560434,-881563214,NULL,3,0,3,'1','Pub/LeNomDeMonSite/domus_hibere.scs',NULL,'Marq','CC1');
-select * from t1 where name='patnom' and author='patauteur' and category=0;
-drop table t1;
-
-#
-# Problem with search on partial index
-#
-
-create table t1
-(
- name_id int not null auto_increment,
- name blob,
- INDEX name_idx (name(5)),
- primary key (name_id)
-);
-
-INSERT t1 VALUES(NULL,'/');
-INSERT t1 VALUES(NULL,'[T,U]_axpby');
-SELECT * FROM t1 WHERE name='[T,U]_axpy';
-SELECT * FROM t1 WHERE name='[T,U]_axpby';
-create table t2
-(
- name_id int not null auto_increment,
- name char(255) binary,
- INDEX name_idx (name(5)),
- primary key (name_id)
-);
-INSERT t2 select * from t1;
-SELECT * FROM t2 WHERE name='[T,U]_axpy';
-SELECT * FROM t2 WHERE name='[T,U]_axpby';
-# Test possible problems with warnings in CREATE ... SELECT
-CREATE TABLE t3 SELECT * FROM t2 WHERE name='[T,U]_axpby';
-SELECT * FROM t2 WHERE name='[T,U]_axpby';
-
-drop table t1,t2,t3;
-
-#
-# Test bug with long primary key
-#
-
-create table t1
-(
- SEQNO numeric(12 ) not null,
- MOTYPEID numeric(12 ) not null,
- MOINSTANCEID numeric(12 ) not null,
- ATTRID numeric(12 ) not null,
- VALUE varchar(120) not null,
- primary key (SEQNO, MOTYPEID, MOINSTANCEID, ATTRID, VALUE )
-);
-INSERT INTO t1 VALUES (1, 1, 1, 1, 'a');
-INSERT INTO t1 VALUES (1, 1, 1, 1, 'b');
---error ER_DUP_ENTRY
-INSERT INTO t1 VALUES (1, 1, 1, 1, 'a');
-drop table t1;
-
-#
-# Test with blob + tinyint key
-# (Failed for Greg Valure)
-#
-
-CREATE TABLE t1 (
- a tinytext NOT NULL,
- b tinyint(3) unsigned NOT NULL default '0',
- PRIMARY KEY (a(32),b)
-) ENGINE=MyISAM;
-INSERT INTO t1 VALUES ('a',1),('a',2);
-SELECT * FROM t1 WHERE a='a' AND b=2;
-SELECT * FROM t1 WHERE a='a' AND b in (2);
-SELECT * FROM t1 WHERE a='a' AND b in (1,2);
-drop table t1;
-
-#
-# Test of create key order
-#
-
-create table t1 (a int not null unique, b int unique, c int, d int not null primary key, key(c), e int not null unique);
-show keys from t1;
-drop table t1;
-
-#
-# Problem with UNIQUE() with NULL parts and auto increment
-#
-
-CREATE TABLE t1 (c CHAR(10) NOT NULL,i INT NOT NULL AUTO_INCREMENT,
-UNIQUE (c,i));
-INSERT INTO t1 (c) VALUES (NULL),(NULL);
-SELECT * FROM t1;
-INSERT INTO t1 (c) VALUES ('a'),('a');
-SELECT * FROM t1;
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (c CHAR(10) NULL, i INT NOT NULL AUTO_INCREMENT,
-UNIQUE (c,i));
-INSERT INTO t1 (c) VALUES (NULL),(NULL);
-SELECT * FROM t1;
-INSERT INTO t1 (c) VALUES ('a'),('a');
-SELECT * FROM t1;
-drop table t1;
-
-#
-# longer keys
-#
-create table t1 (i int, a char(200), b text, unique (a), unique (b(300))) charset utf8;
-insert t1 values (1, repeat('a',210), repeat('b', 310));
-insert t1 values (2, repeat(0xD0B1,215), repeat(0xD0B1, 310));
-select i, length(a), length(b), char_length(a), char_length(b) from t1;
-select i from t1 where a=repeat(_utf8 'a',200);
-select i from t1 where a=repeat(_utf8 0xD0B1,200);
-select i from t1 where b=repeat(_utf8 'b',310);
-drop table t1;
-
-#
-# Test of key read with primary key (Bug #3497)
-#
-
-CREATE TABLE t1 (id int unsigned auto_increment, name char(50), primary key (id)) engine=myisam;
-insert into t1 (name) values ('a'), ('b'),('c'),('d'),('e'),('f'),('g');
-explain select 1 from t1 where id =2;
-explain select 1 from t1 where id =2 or id=3;
-explain select name from t1 where id =2;
-ALTER TABLE t1 DROP PRIMARY KEY, ADD INDEX (id);
-explain select 1 from t1 where id =2;
-drop table t1;
-
-#
-# Test of problem with key read (Bug #3666)
-#
-
-CREATE TABLE t1 (numeropost mediumint(8) unsigned NOT NULL default '0', numreponse int(10) unsigned NOT NULL auto_increment, PRIMARY KEY (numeropost,numreponse), UNIQUE KEY numreponse (numreponse));
-INSERT INTO t1 (numeropost,numreponse) VALUES ('1','1'),('1','2'),('2','3'),('2','4');
-SELECT numeropost FROM t1 WHERE numreponse='1';
-EXPLAIN SELECT numeropost FROM t1 WHERE numreponse='1';
-FLUSH TABLES;
-SELECT numeropost FROM t1 WHERE numreponse='1';
-drop table t1;
-
-#
-# UNIQUE prefix keys and multi-byte charsets
-#
-
-create table t1 (c varchar(30) character set utf8, t text character set utf8, unique (c(2)), unique (t(3))) engine=myisam;
-show create table t1;
-insert t1 values ('cccc', 'tttt'),
- (0xD0B1212223D0B1D0B1D0B1D0B1D0B1, 0xD0B1D0B1212223D0B1D0B1D0B1D0B1),
- (0xD0B1222123D0B1D0B1D0B1D0B1D0B1, 0xD0B1D0B1222123D0B1D0B1D0B1D0B1);
---error ER_DUP_ENTRY
-insert t1 (c) values ('cc22');
---error ER_DUP_ENTRY
-insert t1 (t) values ('ttt22');
---error ER_DUP_ENTRY
-insert t1 (c) values (0xD0B1212322D0B1D0B1D0B1D0B1D0B1);
---error ER_DUP_ENTRY
-insert t1 (t) values (0xD0B1D0B1212322D0B1D0B1D0B1D0B1);
-select c from t1 where c='cccc';
-select t from t1 where t='tttt';
-select c from t1 where c=0xD0B1212223D0B1D0B1D0B1D0B1D0B1;
-select t from t1 where t=0xD0B1D0B1212223D0B1D0B1D0B1D0B1;
-drop table t1;
-
-#
-# BUG#6151 - myisam index corruption
-#
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (
- c1 int,
- c2 varbinary(240),
- UNIQUE KEY (c1),
- KEY (c2)
-) ENGINE=MyISAM;
-INSERT INTO t1 VALUES (1,'\Z\Z\Z\Z');
-INSERT INTO t1 VALUES (2,'\Z\Z\Z\Z\Z\Z');
-INSERT INTO t1 VALUES (3,'\Z\Z\Z\Z');
-select c1 from t1 where c2='\Z\Z\Z\Z';
-DELETE FROM t1 WHERE (c1 = 1);
-check table t1;
-select c1 from t1 where c2='\Z\Z\Z\Z';
-DELETE FROM t1 WHERE (c1 = 3);
-check table t1;
-select c1 from t1 where c2='\Z\Z\Z\Z';
-
-#
-# test delete of keys in a different order
-#
-truncate table t1;
-insert into t1 values(1,"aaaa"),(2,"aaab"),(3,"aaac"),(4,"aaccc");
-delete from t1 where c1=3;
-delete from t1 where c1=1;
-delete from t1 where c1=4;
-check table t1;
-
-drop table t1;
-
-#
-# Bug 6166: index prefix length of 0 not rejected
-#
-# this test should fail in 5.0
-# to fix it, remove #ifdef in
-# file sql_yacc.yy(key_part)
-# create dedicated error code for this and
-# and change my_printf_error() to my_error
-
---error 1391
-create table t1 (c char(10), index (c(0)));
-
-#
-# Bug #6126: Duplicate columns in keys should fail
-# Bug #6252: (dup)
-#
---error 1060
-create table t1 (c char(10), index (c,c));
---error 1060
-create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1));
---error 1060
-create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2));
---error 1060
-create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1));
-create table t1 (c1 char(10), c2 char(10));
---error 1060
-alter table t1 add key (c1,c1);
---error 1060
-alter table t1 add key (c2,c1,c1);
---error 1060
-alter table t1 add key (c1,c2,c1);
---error 1060
-alter table t1 add key (c1,c1,c2);
-drop table t1;
-
-#
-# Bug#11228: DESC shows arbitrary column as "PRI"
-#
-create table t1 (
- i1 INT NOT NULL,
- i2 INT NOT NULL,
- UNIQUE i1idx (i1),
- UNIQUE i2idx (i2));
-desc t1;
-show create table t1;
-drop table t1;
-
-#
-# Bug#12565 - ERROR 1034 when running simple UPDATE or DELETE
-# on large MyISAM table
-#
-create table t1 (
- c1 int,
- c2 varchar(20) not null,
- primary key (c1),
- key (c2(10))
-) engine=myisam;
-insert into t1 values (1,'');
-insert into t1 values (2,' \t\tTest String');
-insert into t1 values (3,' \n\tTest String');
-update t1 set c2 = 'New Test String' where c1 = 1;
-select * from t1;
-drop table t1;
-
-#
-# If we use a partial field for a key that is actually the length of the
-# field, and we extend the field, we end up with a key that includes the
-# whole new length of the field.
-#
-create table t1 (a varchar(10), b varchar(10), key(a(10),b(10)));
-show create table t1;
-alter table t1 modify b varchar(20);
-show create table t1;
-alter table t1 modify a varchar(20);
-show create table t1;
-drop table t1;
-
-#
-# Bug #11227: Incorrectly reporting 'MUL' vs. 'UNI' on varchar
-#
-create table t1 (a int not null primary key, b varchar(20) not null unique);
-desc t1;
-drop table t1;
-create table t1 (a int not null primary key, b int not null unique);
-desc t1;
-drop table t1;
-create table t1 (a int not null primary key, b varchar(20) not null, unique (b(10)));
-desc t1;
-drop table t1;
-create table t1 (a int not null primary key, b varchar(20) not null, c varchar(20) not null, unique(b(10),c(10)));
-desc t1;
-drop table t1;
-
-# End of 4.1 tests
-
-#
-# WL#1563 - Modify MySQL to support on-line CREATE/DROP INDEX
-# To test if this really works, you need to run with --debug
-# and check the trace file.
-#
-# Create a table with named and unnamed indexes.
-create table t1 (
- c1 int,
- c2 char(12),
- c3 varchar(123),
- c4 timestamp,
- index (c1),
- index i1 (c1),
- index i2 (c2),
- index i3 (c3),
- unique i4 (c4),
- index i5 (c1, c2, c3, c4),
- primary key (c2, c3),
- index (c2, c4));
-show create table t1;
-# Some simple tests.
-alter table t1 drop index c1;
-alter table t1 add index (c1);
-# This creates index 'c1_2'.
-alter table t1 add index (c1);
-alter table t1 drop index i3;
-alter table t1 add index i3 (c3);
-# Two indexes at the same time.
-alter table t1 drop index i2, drop index i4;
-alter table t1 add index i2 (c2), add index i4 (c4);
-# Three indexes, one of them reversely.
-alter table t1 drop index i2, drop index i4, add index i6 (c2, c4);
-alter table t1 add index i2 (c2), add index i4 (c4), drop index i6;
-# include an unique index.
-alter table t1 drop index i2, drop index i4, add unique i4 (c4);
-alter table t1 add index i2 (c2), drop index i4, add index i4 (c4);
-# Modify an index by changing its definition.
-alter table t1 drop index c2, add index (c2(4),c3(7));
-# Change nothing. The new key definition is the same as the old one.
-alter table t1 drop index c2, add index (c2(4),c3(7));
-# Test primary key handling.
-alter table t1 add primary key (c1, c2), drop primary key;
-alter table t1 drop primary key;
-# Drop is checked first. Primary key must exist.
---error 1091
-alter table t1 add primary key (c1, c2), drop primary key;
-show create table t1;
-# Insert non-unique values.
-insert into t1 values(1, 'a', 'a', NULL);
-insert into t1 values(1, 'b', 'b', NULL);
-# Drop some indexes for new adds.
-alter table t1 drop index i3, drop index i2, drop index i1;
-# Add indexes, one is unique on non-unique values.
---error ER_DUP_ENTRY
-alter table t1 add index i3 (c3), add index i2 (c2), add unique index i1 (c1);
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/key_diff.test b/mysql-test/suite/pbxt/t/key_diff.test
deleted file mode 100644
index fc93c7418ab..00000000000
--- a/mysql-test/suite/pbxt/t/key_diff.test
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# Check on condition on different length keys.
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-CREATE TABLE t1 (
- a char(5) NOT NULL,
- b char(4) NOT NULL,
- KEY (a),
- KEY (b)
-);
-
-INSERT INTO t1 VALUES ('A','B'),('b','A'),('C','c'),('D','E'),('a','a');
-INSERT INTO t1 VALUES
- ('AA','BB'),('bb','AA'),('CC','cc'),('DD','EE'),('aa','aa');
-INSERT INTO t1 VALUES
- ('AAA','BBB'),('bbb','AAA'),('CCC','ccc'),('DDD','EEE'),('aaa','aaa');
-
-select * from t1,t1 as t2
- where length(t1.A)=1 and length(t2.B)=1 ;
-explain select t1.*,t2.* from t1,t1 as t2
- where t1.A=t2.B and length(t1.A)=1 and length(t2.B)=1;
-#select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B;
-select t1.*,t2.* from t1,t1 as t2
- where t1.A=t2.B and length(t1.A)=1 and length(t2.B)=1
-order by binary t1.a,t2.a;
-select * from t1 where a='a';
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/key_primary.test b/mysql-test/suite/pbxt/t/key_primary.test
deleted file mode 100644
index 185170bddd9..00000000000
--- a/mysql-test/suite/pbxt/t/key_primary.test
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# test of primary key conversions
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (t1 char(3) primary key);
-insert into t1 values("ABC");
-insert into t1 values("ABA");
-insert into t1 values("AB%");
-select * from t1 where t1="ABC";
-select * from t1 where t1="ABCD";
-select * from t1 where t1 like "a_\%";
-describe select * from t1 where t1="ABC";
-describe select * from t1 where t1="ABCD";
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/keywords.test b/mysql-test/suite/pbxt/t/keywords.test
deleted file mode 100644
index 22b5b955942..00000000000
--- a/mysql-test/suite/pbxt/t/keywords.test
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Test keywords as fields
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (time time, date date, timestamp timestamp,
-quarter int, week int, year int, timestampadd int, timestampdiff int);
-insert into t1 values ("12:22:22","97:02:03","1997-01-02",1,2,3,4,5);
-select * from t1;
-select t1.time+0,t1.date+0,t1.timestamp+0,concat(date," ",time),
- t1.quarter+t1.week, t1.year+timestampadd, timestampdiff from t1;
-drop table t1;
-create table events(binlog int);
-insert into events values(1);
-select events.binlog from events;
-drop table events;
-
-# End of 4.1 tests
-
-#
-# Bug#19939 "AUTHORS is not a keyword"
-#
-delimiter |;
-create procedure p1()
-begin
- declare n int default 2;
- authors: while n > 0 do
- set n = n -1;
- end while authors;
-end|
-create procedure p2()
-begin
- declare n int default 2;
- contributors: while n > 0 do
- set n = n -1;
- end while contributors;
-end|
-delimiter ;|
-drop procedure p1;
-drop procedure p2;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 5.1 tests
diff --git a/mysql-test/suite/pbxt/t/limit.test b/mysql-test/suite/pbxt/t/limit.test
deleted file mode 100644
index a65d5060e4d..00000000000
--- a/mysql-test/suite/pbxt/t/limit.test
+++ /dev/null
@@ -1,76 +0,0 @@
-#
-# Test of update and delete with limit
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (a int not null default 0 primary key, b int not null default 0);
-insert into t1 () values (); # Testing default values
-insert into t1 values (1,1),(2,1),(3,1);
-update t1 set a=4 where b=1 limit 1;
-select * from t1 order by a; # PBXT: required for consistent result
-update t1 set b=2 where b=1 limit 2;
-select * from t1 order by a; # PBXT: required for consistent result
-update t1 set b=4 where b=1;
-select * from t1 order by a; # PBXT: required for consistent result
-delete from t1 where b=2 order by a limit 1;
-select * from t1 order by a; # PBXT: required for consistent result
-delete from t1 limit 1;
-select * from t1 order by a; # PBXT: required for consistent result
-drop table t1;
-
-create table t1 (i int);
-insert into t1 (i) values(1),(1),(1);
-delete from t1 limit 1;
-update t1 set i=2 limit 1;
-delete from t1 limit 0;
-update t1 set i=3 limit 0;
-select * from t1;
-drop table t1;
-
-# LIMIT 0
-
-select 0 limit 0;
-
-#
-# Test with DELETE, ORDER BY and limit (bug #1024)
-#
-
-CREATE TABLE t1(id int auto_increment primary key, id2 int, index(id2));
-INSERT INTO t1 (id2) values (0),(0),(0);
-DELETE FROM t1 WHERE id=1;
-INSERT INTO t1 SET id2=0;
-SELECT * FROM t1;
-DELETE FROM t1 WHERE id2 = 0 ORDER BY id LIMIT 1;
-# should have deleted WHERE id=2
-SELECT * FROM t1;
-DELETE FROM t1 WHERE id2 = 0 ORDER BY id desc LIMIT 1;
-SELECT * FROM t1;
-DROP TABLE t1;
-
-#
-# Bug#8023 - limit on UNION with from DUAL, causes syntax error
-#
-create table t1 (a integer);
-insert into t1 values (1);
-# both queries must return one row
-select 1 as a from t1 union all select 1 from dual limit 1;
-(select 1 as a from t1) union all (select 1 from dual) limit 1;
-drop table t1;
-
-#
-# Bug #21787: COUNT(*) + ORDER BY + LIMIT returns wrong result
-#
-create table t1 (a int);
-insert into t1 values (1),(2),(3),(4),(5),(6),(7);
-explain select count(*) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
-select count(*) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
-explain select sum(a) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
-select sum(a) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
-drop table t1;
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/lock.test b/mysql-test/suite/pbxt/t/lock.test
deleted file mode 100644
index a42b4cbfd07..00000000000
--- a/mysql-test/suite/pbxt/t/lock.test
+++ /dev/null
@@ -1,120 +0,0 @@
-#
-# Testing of table locking
-#
-
---disable_warnings
-drop table if exists t1,t2,t3;
---enable_warnings
-CREATE TABLE t1 ( `id` int(11) NOT NULL default '0', `id2` int(11) NOT NULL default '0', `id3` int(11) NOT NULL default '0', `dummy1` char(30) default NULL, PRIMARY KEY (`id`,`id2`), KEY `index_id3` (`id3`)) ENGINE=MyISAM;
-insert into t1 (id,id2) values (1,1),(1,2),(1,3);
-LOCK TABLE t1 WRITE;
-select dummy1,count(distinct id) from t1 group by dummy1;
-update t1 set id=-1 where id=1;
-LOCK TABLE t1 READ;
---error 1099
-update t1 set id=1 where id=1;
---error 1100
-create table t2 SELECT * from t1;
-create temporary table t2 SELECT * from t1;
-drop table if exists t2;
-unlock tables;
-create table t2 SELECT * from t1;
-LOCK TABLE t1 WRITE,t2 write;
-insert into t2 SELECT * from t1;
-update t1 set id=1 where id=-1;
-drop table t1,t2;
-
-
-#
-# Check bug with INSERT ... SELECT with lock tables
-#
-
-CREATE TABLE t1 (
- index1 smallint(6) default NULL,
- nr smallint(6) default NULL,
- KEY index1(index1)
-) ENGINE=MyISAM;
-
-CREATE TABLE t2 (
- nr smallint(6) default NULL,
- name varchar(20) default NULL
-) ENGINE=MyISAM;
-
-INSERT INTO t2 VALUES (1,'item1');
-INSERT INTO t2 VALUES (2,'item2');
-
-# problem begins here!
-lock tables t1 write, t2 read;
-insert into t1 select 1,nr from t2 where name='item1';
-insert into t1 select 2,nr from t2 where name='item2';
-unlock tables;
-check table t1;
-
-# Check error message
-lock tables t1 write;
-check table t2;
---error 1100
-insert into t1 select index1,nr from t1;
-unlock tables;
-lock tables t1 write, t1 as t1_alias read;
-insert into t1 select index1,nr from t1 as t1_alias;
---error ER_TABLE_NOT_LOCKED
-drop table t1,t2;
-unlock tables;
-drop table t1,t2;
-
-#
-# BUG#5390 - problems with merge tables
-# Supplement test for the after-fix optimization
-# Check that a dropped table is correctly removed from a lock.
-create table t1 (c1 int);
-create table t2 (c1 int);
-create table t3 (c1 int);
-lock tables t1 write, t2 write, t3 write;
-# This removes one table after the other from the lock.
-drop table t2, t3, t1;
-#
-# Check that a lock merge works.
-create table t1 (c1 int);
-create table t2 (c1 int);
-create table t3 (c1 int);
-lock tables t1 write, t2 write, t3 write, t1 as t4 read;
-alter table t2 add column c2 int;
-drop table t1, t2, t3;
-
-# Bug7241 - Invalid response when DELETE .. USING and LOCK TABLES used.
-#
-create table t1 ( a int(11) not null auto_increment, primary key(a));
-create table t2 ( a int(11) not null auto_increment, primary key(a));
-lock tables t1 write, t2 read;
-delete from t1 using t1,t2 where t1.a=t2.a;
-delete t1 from t1,t2 where t1.a=t2.a;
---error 1099
-delete from t2 using t1,t2 where t1.a=t2.a;
---error 1099
-delete t2 from t1,t2 where t1.a=t2.a;
---error ER_TABLE_NOT_LOCKED_FOR_WRITE
-drop table t1,t2;
-unlock tables;
-drop table t2,t1;
-
---echo End of 4.1 tests.
-
-
-#
-# Bug#18884 "lock table + global read lock = crash"
-# The bug is not repeatable, just add the test case.
-#
---disable_warnings
-drop table if exists t1;
---enable_warnings
-create table t1 (a int);
-lock table t1 write;
---error ER_LOCK_OR_ACTIVE_TRANSACTION
-flush tables with read lock;
-unlock tables;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/lock_multi.test b/mysql-test/suite/pbxt/t/lock_multi.test
deleted file mode 100644
index b15e6c9dea3..00000000000
--- a/mysql-test/suite/pbxt/t/lock_multi.test
+++ /dev/null
@@ -1,563 +0,0 @@
--- source include/not_embedded.inc
-
-# Save the initial number of concurrent sessions
---source include/count_sessions.inc
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-# Test to see if select will get the lock ahead of low priority update
-
-connect (locker,localhost,root,,);
-connect (reader,localhost,root,,);
-connect (writer,localhost,root,,);
-
-#
-# Test problem when using locks with multi-updates
-# It should not block when multi-update is reading on a read-locked table
-#
-
-connection locker;
-create table t1 (a int, b int);
-create table t2 (c int, d int);
-insert into t1 values(1,1);
-insert into t1 values(2,2);
-insert into t2 values(1,2);
-lock table t1 read;
-connection writer;
-update t1,t2 set c=a where b=d;
-connection reader;
-select c from t2;
-connection locker;
-unlock tables;
-drop table t1;
-drop table t2;
-
-#
-# Test problem when using locks on many tables and dropping a table that
-# is to-be-locked by another thread
-#
-#
-connection locker;
-create table t1 (a int);
-create table t2 (a int);
-lock table t1 write, t2 write;
-connection reader;
-send
-insert t1 select * from t2;
-connection locker;
-let $wait_condition=
- select count(*) = 1 from information_schema.processlist
- where state = "Waiting for table metadata lock" and
- info = "insert t1 select * from t2";
---source include/wait_condition.inc
-drop table t2;
-unlock tables;
-connection reader;
---error ER_NO_SUCH_TABLE
-reap;
-connection locker;
-drop table t1;
-
-#
-# Same test as above, but with the dropped table locked twice
-#
-
-connection locker;
-create table t1 (a int);
-create table t2 (a int);
-lock table t1 write, t2 write, t1 as t1_2 write, t2 as t2_2 write;
-connection reader;
-send
-insert t1 select * from t2;
-connection locker;
-# Sleep a bit till the insert of connection reader is in work and hangs
-let $wait_condition=
- select count(*) = 1 from information_schema.processlist
- where state = "Waiting for table metadata lock" and
- info = "insert t1 select * from t2";
---source include/wait_condition.inc
-drop table t2;
-unlock tables;
-connection reader;
---error ER_NO_SUCH_TABLE
-reap;
-connection locker;
-drop table t1;
-
-
---echo End of 4.1 tests
-
-#
-# Bug#9998 MySQL client hangs on USE "database"
-#
-create table t1(a int);
-lock tables t1 write;
-connection reader;
-show columns from t1;
-connection locker;
-unlock tables;
-drop table t1;
-
-#
-# Bug#16986 Deadlock condition with MyISAM tables
-#
-
-# Need a matching user in mysql.user for multi-table select
---source include/add_anonymous_users.inc
-
-connection locker;
-USE mysql;
-LOCK TABLES columns_priv WRITE, db WRITE, host WRITE, user WRITE;
-FLUSH TABLES;
-#
-connection reader;
-USE mysql;
-# Note: This must be a multi-table select, otherwise the deadlock will not occur
-send
-SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1;
-#
-connection locker;
-# Sleep a bit till the select of connection reader is in work and hangs
-let $wait_condition=
- SELECT COUNT(*) = 1 FROM information_schema.processlist
- WHERE state = "Waiting for table metadata lock" AND info =
- "SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1";
---source include/wait_condition.inc
-# Make test case independent from earlier grants.
---replace_result "Table is already up to date" "OK"
-OPTIMIZE TABLES columns_priv, db, host, user;
-UNLOCK TABLES;
-#
-connection reader;
-reap;
-USE test;
-#
-connection locker;
-use test;
-#
-connection default;
-#
-# Test if CREATE TABLE with LOCK TABLE deadlocks.
-#
-connection writer;
-CREATE TABLE t1 (c1 int);
-LOCK TABLE t1 WRITE;
-#
-# This waits until t1 is unlocked.
-connection locker;
-send
-FLUSH TABLES WITH READ LOCK;
-#
-connection writer;
-# Sleep a bit till the flush of connection locker is in work and hangs
-let $wait_condition=
- select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global read lock" and
- info = "FLUSH TABLES WITH READ LOCK";
---source include/wait_condition.inc
-# This must not block.
---error ER_TABLE_NOT_LOCKED
-CREATE TABLE t2 (c1 int);
-UNLOCK TABLES;
-#
-# This awakes now.
-connection locker;
-reap;
-UNLOCK TABLES;
-#
-connection default;
-DROP TABLE t1;
-#
-# Test if CREATE TABLE SELECT with LOCK TABLE deadlocks.
-#
-connection writer;
-CREATE TABLE t1 (c1 int);
-LOCK TABLE t1 WRITE;
-#
-# This waits until t1 is unlocked.
-connection locker;
-send
-FLUSH TABLES WITH READ LOCK;
-#
-# This must not block.
-connection writer;
-# Sleep a bit till the flush of connection locker is in work and hangs
-let $wait_condition=
- select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global read lock" and
- info = "FLUSH TABLES WITH READ LOCK";
---source include/wait_condition.inc
---error ER_TABLE_NOT_LOCKED
-CREATE TABLE t2 AS SELECT * FROM t1;
-UNLOCK TABLES;
-#
-# This awakes now.
-connection locker;
-reap;
-UNLOCK TABLES;
-#
-connection default;
-DROP TABLE t1;
-
---source include/delete_anonymous_users.inc
-
-#
-# Bug#19815 CREATE/RENAME/DROP DATABASE can deadlock on a global read lock
-#
-connect (con1,localhost,root,,);
-connect (con2,localhost,root,,);
-#
-connection con1;
-CREATE DATABASE mysqltest_1;
-FLUSH TABLES WITH READ LOCK;
-#
-# With bug in place: acquire LOCK_mysql_create_table and
-# wait in wait_if_global_read_lock().
-connection con2;
-send
-DROP DATABASE mysqltest_1;
-#
-# With bug in place: try to acquire LOCK_mysql_create_table...
-# When fixed: Reject dropping db because of the read lock.
-connection con1;
-# Wait a bit so that the session con2 is in state
-# "Waiting for global read lock"
-let $wait_condition=
- select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global read lock"
- and info = "DROP DATABASE mysqltest_1";
---source include/wait_condition.inc
---error ER_CANT_UPDATE_WITH_READLOCK
-DROP DATABASE mysqltest_1;
-UNLOCK TABLES;
-#
-connection con2;
-reap;
-#
-connection default;
-disconnect con1;
-disconnect con2;
-# This must have been dropped by connection 2 already,
-# which waited until the global read lock was released.
---error ER_DB_DROP_EXISTS
-DROP DATABASE mysqltest_1;
-
-#
-# Bug#17264 MySQL Server freeze
-#
-connection locker;
-# Disable warnings to allow test to run also without InnoDB
---disable_warnings
-create table t1 (f1 int(12) unsigned not null auto_increment, primary key(f1)) engine=innodb;
---enable_warnings
-lock tables t1 write;
-connection writer;
-send
-alter table t1 auto_increment=0;
-connection reader;
-# Wait till connection writer is blocked
-let $wait_condition=
- select count(*) = 1 from information_schema.processlist
- where state = "Waiting for table metadata lock" and
- info = "alter table t1 auto_increment=0";
---source include/wait_condition.inc
-send
-alter table t1 auto_increment=0;
-connection locker;
-# Wait till connection reader is blocked
-let $wait_condition=
- select count(*) = 2 from information_schema.processlist
- where state = "Waiting for table metadata lock" and
- info = "alter table t1 auto_increment=0";
---source include/wait_condition.inc
-unlock tables;
-connection writer;
-reap;
-connection reader;
-reap;
-connection locker;
-drop table t1;
-
-#
-# Bug#43230: SELECT ... FOR UPDATE can hang with FLUSH TABLES WITH READ LOCK indefinitely
-#
-
-connect (con1,localhost,root,,);
-connect (con2,localhost,root,,);
-connect (con3,localhost,root,,);
-connect (con4,localhost,root,,);
-connect (con5,localhost,root,,);
-
-create table t1 (a int);
-create table t2 like t1;
-
-connection con1;
---echo # con1
-lock tables t1 write;
-connection con2;
---echo # con2
-send flush tables with read lock;
-connection con5;
---echo # con5
-let $wait_condition=
- select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global read lock" and
- info = "flush tables with read lock";
---source include/wait_condition.inc
---echo # global read lock is taken
-connection con3;
---echo # con3
-send select * from t2 for update;
-connection con5;
-let $wait_condition=
- select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global read lock" and
- info = "select * from t2 for update";
---source include/wait_condition.inc
---echo # waiting for release of read lock
-connection con4;
---echo # con4
---echo # would hang and later cause a deadlock
-flush tables t2;
-connection con1;
---echo # clean up
-unlock tables;
-connection con2;
---reap
-unlock tables;
-connection con3;
---reap
-connection default;
-disconnect con5;
-disconnect con4;
-disconnect con3;
-disconnect con2;
-disconnect con1;
-
-drop table t1,t2;
-
---echo #
---echo # Lightweight version:
---echo # Ensure that the wait for a GRL is done before opening tables.
---echo #
-
-connect (con1,localhost,root,,);
-connect (con2,localhost,root,,);
-
-create table t1 (a int);
-create table t2 like t1;
-
---echo #
---echo # UPDATE
---echo #
-
-connection default;
---echo # default
-flush tables with read lock;
-connection con1;
---echo # con1
-send update t2 set a = 1;
-connection default;
---echo # default
-let $wait_condition=
- select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global read lock" and
- info = "update t2 set a = 1";
---source include/wait_condition.inc
---echo # statement is waiting for release of read lock
-connection con2;
---echo # con2
-flush table t2;
-connection default;
---echo # default
-unlock tables;
-connection con1;
---echo # con1
---reap
-
---echo #
---echo # LOCK TABLES .. WRITE
---echo #
-
-connection default;
---echo # default
-flush tables with read lock;
-connection con1;
---echo # con1
-send lock tables t2 write;
-connection default;
---echo # default
-let $wait_condition=
- select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global read lock" and
- info = "lock tables t2 write";
---source include/wait_condition.inc
---echo # statement is waiting for release of read lock
-connection con2;
---echo # con2
-flush table t2;
-connection default;
---echo # default
-unlock tables;
-connection con1;
---echo # con1
---reap
-unlock tables;
-
-connection default;
-disconnect con2;
-disconnect con1;
-
-drop table t1,t2;
-
-
---echo End of 5.0 tests
-
-
-# Disconnect sessions used in many subtests above
-disconnect locker;
-disconnect reader;
-disconnect writer;
-
-
-#
-# Bug#32395 Alter table under a impending global read lock causes a server crash
-#
-
-#
-# Test ALTER TABLE under LOCK TABLES and FLUSH TABLES WITH READ LOCK
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-create table t1 (i int);
-connect (flush,localhost,root,,test,,);
-connection default;
---echo connection: default
-lock tables t1 write;
-connection flush;
---echo connection: flush
---send flush tables with read lock;
-connection default;
---echo connection: default
-let $wait_condition=
- select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global read lock" and
- info = "flush tables with read lock";
---source include/wait_condition.inc
-alter table t1 add column j int;
-connect (insert,localhost,root,,test,,);
-connection insert;
---echo connection: insert
-let $wait_condition=
- select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global read lock" and
- info = "flush tables with read lock";
---source include/wait_condition.inc
---send insert into t1 values (1,2);
---echo connection: default
-connection default;
-let $wait_condition=
- select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global read lock" and
- info = "insert into t1 values (1,2)";
---source include/wait_condition.inc
-unlock tables;
-connection flush;
---echo connection: flush
---reap
-let $wait_condition=
- select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global read lock" and
- info = "insert into t1 values (1,2)";
---source include/wait_condition.inc
-select * from t1;
-unlock tables;
-connection insert;
---reap
-connection default;
-let $wait_condition=
- select count(*) = 1 from t1;
---source include/wait_condition.inc
-select * from t1;
-drop table t1;
-disconnect flush;
-disconnect insert;
-
-#
-# Test that FLUSH TABLES under LOCK TABLES protects write locked tables
-# from a impending FLUSH TABLES WITH READ LOCK
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-create table t1 (i int);
-connect (flush,localhost,root,,test,,);
-connection default;
---echo connection: default
-lock tables t1 write;
-connection flush;
---echo connection: flush
---send flush tables with read lock;
-connection default;
---echo connection: default
-let $wait_condition=
- select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global read lock";
---source include/wait_condition.inc
-flush tables;
-let $wait_condition=
- select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global read lock";
---source include/wait_condition.inc
-unlock tables;
-connection flush;
---reap
-connection default;
-disconnect flush;
-drop table t1;
-
-#
-# Bug#30331 Table_locks_waited shows inaccurate values
-#
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-create table t1 (a int);
-flush status;
-lock tables t1 read;
-let $tlwa= `show status like 'Table_locks_waited'`;
-connect (waiter,localhost,root,,);
-connection waiter;
-send insert into t1 values(1);
-connection default;
-let $wait_condition=
- select count(*) = 1 from information_schema.processlist
- where state = "Waiting for table level lock" and
- info = "insert into t1 values(1)";
---source include/wait_condition.inc
-let $tlwb= `show status like 'Table_locks_waited'`;
-unlock tables;
-connection waiter;
---reap
-connection default;
-drop table t1;
-disconnect waiter;
---disable_query_log
-eval SET @tlwa= SUBSTRING_INDEX('$tlwa', ' ', -1);
-eval SET @tlwb= SUBSTRING_INDEX('$tlwb', ' ', -1);
---enable_query_log
-select @tlwa < @tlwb;
-
---echo End of 5.1 tests
-
-# Wait till all disconnects are completed
---source include/wait_until_count_sessions.inc
-
-connection default;
-drop database pbxt;
diff --git a/mysql-test/suite/pbxt/t/lock_tables_lost_commit.test b/mysql-test/suite/pbxt/t/lock_tables_lost_commit.test
deleted file mode 100644
index d31b4b7dfb5..00000000000
--- a/mysql-test/suite/pbxt/t/lock_tables_lost_commit.test
+++ /dev/null
@@ -1,24 +0,0 @@
-# This is a test for bug 578
-
--- source include/have_innodb.inc
-
-connect (con1,localhost,root,,);
-connect (con2,localhost,root,,);
-
-connection con1;
---disable_warnings
-drop table if exists t1;
-create table t1(a int) engine=innodb;
---enable_warnings
-lock tables t1 write;
-insert into t1 values(10);
-disconnect con1;
-
-connection con2;
-# The bug was that, because of the LOCK TABLES, the handler "forgot" to commit,
-# and the other commit when we write to the binlog was not done because of
-# binlog-ignore-db
-select * from t1;
-drop table t1;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/lowercase_table2.test b/mysql-test/suite/pbxt/t/lowercase_table2.test
deleted file mode 100644
index f4e97842871..00000000000
--- a/mysql-test/suite/pbxt/t/lowercase_table2.test
+++ /dev/null
@@ -1,156 +0,0 @@
-#
-# Test of --lower-case-table-names=2
-# (User has case insensitive file system and wants to preserve case of
-# table names)
-#
---source include/have_innodb.inc
---require r/lowercase2.require
-disable_query_log;
-show variables like "lower_case_table_names";
-enable_query_log;
-
---disable_warnings
-DROP TABLE IF EXISTS t1,t2,t3,t2aA,t1Aa;
-DROP DATABASE IF EXISTS `TEST_$1`;
-DROP DATABASE IF EXISTS `test_$1`;
-DROP DATABASE IF EXISTS mysqltest_LC2;
---enable_warnings
-
-CREATE TABLE T1 (a int);
-INSERT INTO T1 VALUES (1);
-SHOW TABLES LIKE "T1";
-SHOW TABLES LIKE "t1";
-SHOW CREATE TABLE T1;
-RENAME TABLE T1 TO T2;
-SHOW TABLES LIKE "T2";
-SELECT * FROM t2;
-RENAME TABLE T2 TO t3;
-SHOW TABLES LIKE "T3";
-RENAME TABLE T3 TO T1;
-SHOW TABLES LIKE "T1";
-ALTER TABLE T1 add b int;
-SHOW TABLES LIKE "T1";
-ALTER TABLE T1 RENAME T2;
-SHOW TABLES LIKE "T2";
-
-LOCK TABLE T2 WRITE;
-ALTER TABLE T2 drop b;
-SHOW TABLES LIKE "T2";
-UNLOCK TABLES;
-RENAME TABLE T2 TO T1;
-SHOW TABLES LIKE "T1";
-SELECT * from T1;
-DROP TABLE T1;
-
-#
-# Test database level
-#
-
-CREATE DATABASE `TEST_$1`;
-SHOW DATABASES LIKE "TEST%";
-DROP DATABASE `test_$1`;
-
-#
-# Test of innodb tables with lower_case_table_names=2
-#
-
-CREATE TABLE T1 (a int) engine=innodb;
-INSERT INTO T1 VALUES (1);
-SHOW TABLES LIKE "T1";
-SHOW TABLES LIKE "t1";
-SHOW CREATE TABLE T1;
-RENAME TABLE T1 TO T2;
-SHOW TABLES LIKE "T2";
-SELECT * FROM t2;
-RENAME TABLE T2 TO t3;
-SHOW TABLES LIKE "T3";
-RENAME TABLE T3 TO T1;
-SHOW TABLES LIKE "T1";
-ALTER TABLE T1 add b int;
-SHOW TABLES LIKE "T1";
-ALTER TABLE T1 RENAME T2;
-SHOW TABLES LIKE "T2";
-
-LOCK TABLE T2 WRITE;
-ALTER TABLE T2 drop b;
-SHOW TABLES LIKE "T2";
-UNLOCK TABLES;
-RENAME TABLE T2 TO T1;
-SHOW TABLES LIKE "T1";
-SELECT * from T1;
-DROP TABLE T1;
-
-#
-# Test problem with temporary tables (Bug #2858)
-#
-
-create table T1 (EVENT_ID int auto_increment primary key, LOCATION char(20));
-insert into T1 values (NULL,"Mic-4"),(NULL,"Mic-5"),(NULL,"Mic-6");
-SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHERE EVENT_ID=3;
-SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHERE EVENT_ID=3;
-SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHERE EVENT_ID=3;
-drop table T1;
-
-#
-# Test name conversion with ALTER TABLE / CREATE INDEX (Bug #3109)
-#
-
-create table T1 (A int);
-alter table T1 add index (A);
-show tables like 'T1%';
-alter table t1 add index (A);
-show tables like 't1%';
-drop table t1;
-
-#
-# Bug #7261: Alter table loses temp table
-#
-
-create temporary table T1(a int(11), b varchar(8));
-insert into T1 values (1, 'abc');
-select * from T1;
-alter table T1 add index (a);
-select * from T1;
-drop table T1;
-
-#
-# Bug #8355: Tables not dropped from table cache on drop db
-#
-create database mysqltest_LC2;
-use mysqltest_LC2;
-create table myUC (i int);
-insert into myUC values (1),(2),(3);
-select * from myUC;
-use test;
-drop database mysqltest_LC2;
-create database mysqltest_LC2;
-use mysqltest_LC2;
-create table myUC (i int);
-select * from myUC;
-use test;
-drop database mysqltest_LC2;
-
-#
-# Bug #9500: Problem with WHERE clause
-#
-create table t2aA (col1 int);
-create table t1Aa (col1 int);
-select t1Aa.col1 from t1aA,t2Aa where t1Aa.col1 = t2aA.col1;
-drop table t2aA, t1Aa;
-
-# End of 4.1 tests
-
-#
-# Bug#17661 information_schema.SCHEMATA returns uppercase with lower_case_table_names = 1
-#
-create database mysqltest_LC2;
-use mysqltest_LC2;
-create table myUC (i int);
-select TABLE_SCHEMA,TABLE_NAME FROM information_schema.TABLES
-where TABLE_SCHEMA ='mysqltest_LC2';
-use test;
-drop database mysqltest_LC2;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/lowercase_table_grant-master.opt b/mysql-test/suite/pbxt/t/lowercase_table_grant-master.opt
deleted file mode 100644
index c718e2feb1b..00000000000
--- a/mysql-test/suite/pbxt/t/lowercase_table_grant-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---lower_case_table_names
diff --git a/mysql-test/suite/pbxt/t/lowercase_table_grant.test b/mysql-test/suite/pbxt/t/lowercase_table_grant.test
deleted file mode 100644
index 7449231fca5..00000000000
--- a/mysql-test/suite/pbxt/t/lowercase_table_grant.test
+++ /dev/null
@@ -1,30 +0,0 @@
-# Don't test with embedded server
--- source include/not_embedded.inc
-
-# Test of grants when lower_case_table_names is on
-use mysql;
-
-# mixed-case database name for testing
-create database MYSQLtest;
-
-# check that database name gets forced to lowercase
-grant all on MySQLtest.* to mysqltest_1@localhost;
-show grants for mysqltest_1@localhost;
-
-# now force it to mixed case, but see that it is lowercased in the acl cache
-select * from db where user = 'mysqltest_1';
-update db set db = 'MYSQLtest' where db = 'mysqltest' and user = 'mysqltest_1' and host = 'localhost';
-flush privileges;
-show grants for mysqltest_1@localhost;
-select * from db where user = 'mysqltest_1';
-
-# clear out the user we created
-#
-# can't use REVOKE because of the mixed-case database name
-delete from db where db = 'MYSQLtest' and user = 'mysqltest_1' and host = 'localhost';
-flush privileges;
-drop user mysqltest_1@localhost;
-
-drop database MYSQLtest;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/lowercase_table_qcache-master.opt b/mysql-test/suite/pbxt/t/lowercase_table_qcache-master.opt
deleted file mode 100644
index c718e2feb1b..00000000000
--- a/mysql-test/suite/pbxt/t/lowercase_table_qcache-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---lower_case_table_names
diff --git a/mysql-test/suite/pbxt/t/lowercase_table_qcache.test b/mysql-test/suite/pbxt/t/lowercase_table_qcache.test
deleted file mode 100644
index b397133255d..00000000000
--- a/mysql-test/suite/pbxt/t/lowercase_table_qcache.test
+++ /dev/null
@@ -1,34 +0,0 @@
--- source include/have_query_cache.inc
-#
-# Test of query cache with --lower-case-table-names
-#
-set GLOBAL query_cache_size=1355776;
-
---disable_warnings
-drop database if exists MySQLtesT;
---enable_warnings
-
-create database MySQLtesT;
-create table MySQLtesT.t1 (a int);
-select * from MySQLtesT.t1;
-show status like "Qcache_queries_in_cache";
-drop database mysqltest;
-show status like "Qcache_queries_in_cache";
-
-use MySQL;
-disable_result_log;
-select * from db;
-enable_result_log;
-show status like "Qcache_queries_in_cache";
-use test;
-disable_result_log;
-select * from MySQL.db;
-enable_result_log;
-show status like "Qcache_queries_in_cache";
-
-set GLOBAL query_cache_size=0;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/lowercase_view-master.opt b/mysql-test/suite/pbxt/t/lowercase_view-master.opt
deleted file mode 100644
index 62ab6dad1e0..00000000000
--- a/mysql-test/suite/pbxt/t/lowercase_view-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---lower_case_table_names=1
diff --git a/mysql-test/suite/pbxt/t/lowercase_view.test b/mysql-test/suite/pbxt/t/lowercase_view.test
deleted file mode 100644
index 4be8d90d590..00000000000
--- a/mysql-test/suite/pbxt/t/lowercase_view.test
+++ /dev/null
@@ -1,166 +0,0 @@
---disable_warnings
-drop table if exists t1Aa,t2Aa,v1Aa,v2Aa;
-drop view if exists t1Aa,t2Aa,v1Aa,v2Aa;
-drop database if exists MySQLTest;
---enable_warnings
-
-#
-# different cases in VIEW
-#
-create database MySQLTest;
-use MySQLTest;
-create table TaB (Field int);
-create view ViE as select * from TAb;
-show create table VIe;
-drop database MySQLTest;
-use test;
-
-#
-# test of updating and fetching from the same table check
-#
-create table t1Aa (col1 int);
-create table t2aA (col1 int);
-create view v1Aa as select * from t1aA;
-create view v2aA as select * from v1aA;
-create view v3Aa as select v2Aa.col1 from v2aA,t2Aa where v2Aa.col1 = t2aA.col1;
--- error 1443
-update v2aA set col1 = (select max(col1) from v1Aa);
--- error 1443
-update v2Aa set col1 = (select max(col1) from t1Aa);
--- error 1093
-update v2aA set col1 = (select max(col1) from v2Aa);
--- error 1443
-update v2aA,t2Aa set v2Aa.col1 = (select max(col1) from v1aA) where v2aA.col1 = t2aA.col1;
--- error 1443
-update t1aA,t2Aa set t1Aa.col1 = (select max(col1) from v1Aa) where t1aA.col1 = t2aA.col1;
--- error 1093
-update v1aA,t2Aa set v1Aa.col1 = (select max(col1) from v1aA) where v1Aa.col1 = t2aA.col1;
--- error 1443
-update t2Aa,v2Aa set v2aA.col1 = (select max(col1) from v1aA) where v2Aa.col1 = t2aA.col1;
--- error 1443
-update t2Aa,t1Aa set t1aA.col1 = (select max(col1) from v1Aa) where t1Aa.col1 = t2aA.col1;
--- error 1443
-update t2Aa,v1aA set v1Aa.col1 = (select max(col1) from v1aA) where v1Aa.col1 = t2aA.col1;
--- error 1443
-update v2aA,t2Aa set v2Aa.col1 = (select max(col1) from t1aA) where v2aA.col1 = t2aA.col1;
--- error 1093
-update t1Aa,t2Aa set t1aA.col1 = (select max(col1) from t1Aa) where t1aA.col1 = t2aA.col1;
--- error 1443
-update v1aA,t2Aa set v1Aa.col1 = (select max(col1) from t1Aa) where v1aA.col1 = t2aA.col1;
--- error 1093
-update t2Aa,v2Aa set v2aA.col1 = (select max(col1) from t1aA) where v2Aa.col1 = t2aA.col1;
--- error 1093
-update t2Aa,t1Aa set t1aA.col1 = (select max(col1) from t1Aa) where t1aA.col1 = t2aA.col1;
--- error 1093
-update t2Aa,v1Aa set v1aA.col1 = (select max(col1) from t1Aa) where v1Aa.col1 = t2aA.col1;
--- error 1093
-update v2aA,t2Aa set v2Aa.col1 = (select max(col1) from v2aA) where v2Aa.col1 = t2aA.col1;
--- error 1443
-update t1aA,t2Aa set t1Aa.col1 = (select max(col1) from v2aA) where t1aA.col1 = t2aA.col1;
--- error 1443
-update v1aA,t2Aa set v1Aa.col1 = (select max(col1) from v2Aa) where v1aA.col1 = t2aA.col1;
--- error 1443
-update t2Aa,v2aA set v2Aa.col1 = (select max(col1) from v2aA) where v2Aa.col1 = t2aA.col1;
--- error 1443
-update t2Aa,t1Aa set t1aA.col1 = (select max(col1) from v2aA) where t1Aa.col1 = t2aA.col1;
--- error 1443
-update t2Aa,v1Aa set v1aA.col1 = (select max(col1) from v2Aa) where v1Aa.col1 = t2aA.col1;
--- error 1443
-update v3aA set v3Aa.col1 = (select max(col1) from v1aA);
--- error 1443
-update v3aA set v3Aa.col1 = (select max(col1) from t1aA);
--- error 1443
-update v3aA set v3Aa.col1 = (select max(col1) from v2aA);
--- error 1093
-update v3aA set v3Aa.col1 = (select max(col1) from v3aA);
--- error 1443
-delete from v2Aa where col1 = (select max(col1) from v1Aa);
--- error 1443
-delete from v2aA where col1 = (select max(col1) from t1Aa);
--- error 1093
-delete from v2Aa where col1 = (select max(col1) from v2aA);
--- error 1443
-delete v2Aa from v2aA,t2Aa where (select max(col1) from v1aA) > 0 and v2Aa.col1 = t2aA.col1;
--- error 1443
-delete t1aA from t1Aa,t2Aa where (select max(col1) from v1Aa) > 0 and t1aA.col1 = t2aA.col1;
--- error 1093
-delete v1aA from v1Aa,t2Aa where (select max(col1) from v1aA) > 0 and v1Aa.col1 = t2aA.col1;
--- error 1443
-delete v2aA from v2Aa,t2Aa where (select max(col1) from t1Aa) > 0 and v2aA.col1 = t2aA.col1;
--- error 1093
-delete t1aA from t1Aa,t2Aa where (select max(col1) from t1aA) > 0 and t1Aa.col1 = t2aA.col1;
--- error 1443
-delete v1aA from v1Aa,t2Aa where (select max(col1) from t1aA) > 0 and v1aA.col1 = t2aA.col1;
--- error 1093
-delete v2Aa from v2aA,t2Aa where (select max(col1) from v2Aa) > 0 and v2aA.col1 = t2aA.col1;
--- error 1443
-delete t1Aa from t1aA,t2Aa where (select max(col1) from v2Aa) > 0 and t1Aa.col1 = t2aA.col1;
--- error 1443
-delete v1Aa from v1aA,t2Aa where (select max(col1) from v2aA) > 0 and v1Aa.col1 = t2aA.col1;
--- error 1443
-insert into v2Aa values ((select max(col1) from v1aA));
--- error 1443
-insert into t1aA values ((select max(col1) from v1Aa));
--- error 1443
-insert into v2aA values ((select max(col1) from v1aA));
--- error 1443
-insert into v2Aa values ((select max(col1) from t1Aa));
--- error 1093
-insert into t1aA values ((select max(col1) from t1Aa));
--- error 1443
-insert into v2aA values ((select max(col1) from t1aA));
--- error 1093
-insert into v2Aa values ((select max(col1) from v2aA));
--- error 1443
-insert into t1Aa values ((select max(col1) from v2Aa));
--- error 1093
-insert into v2aA values ((select max(col1) from v2Aa));
--- error 1443
-insert into v3Aa (col1) values ((select max(col1) from v1Aa));
--- error 1443
-insert into v3aA (col1) values ((select max(col1) from t1aA));
--- error 1443
-insert into v3Aa (col1) values ((select max(col1) from v2aA));
-drop view v3aA,v2Aa,v1aA;
-drop table t1Aa,t2Aa;
-
-#
-# aliases in VIEWs
-#
-create table t1Aa (col1 int);
-create view v1Aa as select col1 from t1Aa as AaA;
-show create view v1AA;
-drop view v1AA;
-select Aaa.col1 from t1Aa as AaA;
-create view v1Aa as select Aaa.col1 from t1Aa as AaA;
-drop view v1AA;
-create view v1Aa as select AaA.col1 from t1Aa as AaA;
-show create view v1AA;
-drop view v1AA;
-drop table t1Aa;
-
-
-#
-# Bug #31562: HAVING and lower case
-#
-
-CREATE TABLE t1 (a int, b int);
-
-select X.a from t1 AS X group by X.b having (X.a = 1);
-select X.a from t1 AS X group by X.b having (x.a = 1);
-select X.a from t1 AS X group by X.b having (x.b = 1);
-
-CREATE OR REPLACE VIEW v1 AS
-select X.a from t1 AS X group by X.b having (X.a = 1);
-
-SHOW CREATE VIEW v1;
-
-SELECT * FROM v1;
-
-DROP VIEW v1;
-DROP TABLE t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
---echo End of 5.0 tests.
diff --git a/mysql-test/suite/pbxt/t/metadata.test b/mysql-test/suite/pbxt/t/metadata.test
deleted file mode 100644
index dac38e74371..00000000000
--- a/mysql-test/suite/pbxt/t/metadata.test
+++ /dev/null
@@ -1,86 +0,0 @@
-#
-# Test metadata
-#
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
---enable_metadata
-# PS protocol gives slightly different metadata
---disable_ps_protocol
-
-#
-# First some simple tests
-#
-
-select 1, 1.0, -1, "hello", NULL;
-
-create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp, l datetime, m enum('a','b'), n set('a','b'), o char(10));
-select * from t1;
-select a b, b c from t1 as t2;
-drop table t1;
-
-#
-# Test metadata from ORDER BY (Bug #2654)
-#
-
-CREATE TABLE t1 (id tinyint(3) default NULL, data varchar(255) default NULL);
-INSERT INTO t1 VALUES (1,'male'),(2,'female');
-CREATE TABLE t2 (id tinyint(3) unsigned default NULL, data char(3) default '0');
-INSERT INTO t2 VALUES (1,'yes'),(2,'no');
-
-select t1.id, t1.data, t2.data from t1, t2 where t1.id = t2.id;
-select t1.id, t1.data, t2.data from t1, t2 where t1.id = t2.id order by t1.id;
-select t1.id from t1 union select t2.id from t2;
-drop table t1,t2;
-
-#
-# variables union and derived tables metadata test
-#
-create table t1 ( a int, b varchar(30), primary key(a));
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-set @arg00=1 ;
-select @arg00 FROM t1 where a=1 union distinct select 1 FROM t1 where a=1;
-select * from (select @arg00) aaa;
-select 1 union select 1;
-select * from (select 1 union select 1) aaa;
-drop table t1;
-
---disable_metadata
-
-#
-# Bug #11688: Bad mysql_info() results in multi-results
-#
---enable_info
-delimiter //;
-create table t1 (i int);
-insert into t1 values (1),(2),(3);
-select * from t1 where i = 2;
-drop table t1;//
-delimiter ;//
---disable_info
-
-#
-# Bug #20191: getTableName gives wrong or inconsistent result when using VIEWs
-#
---enable_metadata
-create table t1 (id int(10));
-insert into t1 values (1);
-CREATE VIEW v1 AS select t1.id as id from t1;
-CREATE VIEW v2 AS select t1.id as renamed from t1;
-CREATE VIEW v3 AS select t1.id + 12 as renamed from t1;
-select * from v1 group by id limit 1;
-select * from v1 group by id limit 0;
-select * from v1 where id=1000 group by id;
-select * from v1 where id=1 group by id;
-select * from v2 where renamed=1 group by renamed;
-select * from v3 where renamed=1 group by renamed;
-drop table t1;
-drop view v1,v2,v3;
---disable_metadata
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/multi_statement-master.opt b/mysql-test/suite/pbxt/t/multi_statement-master.opt
deleted file mode 100644
index c735cf4c21b..00000000000
--- a/mysql-test/suite/pbxt/t/multi_statement-master.opt
+++ /dev/null
@@ -1,3 +0,0 @@
---slow-query-log
---slow-query-log-file=slow.log
---log-queries-not-using-indexes
diff --git a/mysql-test/suite/pbxt/t/multi_statement.test b/mysql-test/suite/pbxt/t/multi_statement.test
deleted file mode 100644
index e024fa12c0f..00000000000
--- a/mysql-test/suite/pbxt/t/multi_statement.test
+++ /dev/null
@@ -1,40 +0,0 @@
-# PS doesn't support multi-statements
---disable_ps_protocol
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-select 1;
-delimiter ||||;
-select 2;
-select 3;
-select 4||||
-delimiter 'abcd'||||
-select 5;
-select 6;
-select 50, 'abc';'abcd'
-select "abcd'";'abcd'select "'abcd";'abcd'
-select 5'abcd'
-delimiter ;'abcd'
-select 'finish';
-
-# Bug #8475: Make sure every statement that is a slow query in
-# a multi-statement query gets logged as a slow query.
-flush status;
-delimiter ||||;
-create table t1 (i int);
-insert into t1 values (1);
-select * from t1 where i = 1;
-insert into t1 values (2),(3),(4);
-select * from t1 where i = 2;
-select * from t1 where i = 3||||
-show status like 'Slow_queries'||||
-drop table t1||||
-
-delimiter ;||||
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/multi_update.test b/mysql-test/suite/pbxt/t/multi_update.test
deleted file mode 100644
index 1acd59ea626..00000000000
--- a/mysql-test/suite/pbxt/t/multi_update.test
+++ /dev/null
@@ -1,584 +0,0 @@
-#
-# Test of update statement that uses many tables.
-#
-
-# Requires grants, so won't work with embedded server test
--- source include/not_embedded.inc
-
---disable_warnings
-drop table if exists t1,t2,t3;
-drop database if exists mysqltest;
-drop view if exists v1;
---error 0,1141,1147
-revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
---error 0,1141,1147
-revoke all privileges on mysqltest.* from mysqltest_1@localhost;
-delete from mysql.user where user=_binary'mysqltest_1';
---enable_warnings
-
-create table t1(id1 int not null auto_increment primary key, t char(12));
-create table t2(id2 int not null, t char(12));
-create table t3(id3 int not null, t char(12), index(id3));
-disable_query_log;
-begin;
-let $1 = 100;
-while ($1)
- {
- let $2 = 5;
- eval insert into t1(t) values ('$1');
- while ($2)
- {
- eval insert into t2(id2,t) values ($1,'$2');
- let $3 = 10;
- while ($3)
- {
- eval insert into t3(id3,t) values ($1,'$2');
- dec $3;
- }
- dec $2;
- }
- dec $1;
- }
-commit;
-enable_query_log;
-
-select count(*) from t1 where id1 > 95;
-select count(*) from t2 where id2 > 95;
-select count(*) from t3 where id3 > 95;
-
-update t1,t2,t3 set t1.t="aaa", t2.t="bbb", t3.t="cc" where t1.id1 = t2.id2 and t2.id2 = t3.id3 and t1.id1 > 90;
-select count(*) from t1 where t = "aaa";
-select count(*) from t1 where id1 > 90;
-select count(*) from t2 where t = "bbb";
-select count(*) from t2 where id2 > 90;
-select count(*) from t3 where t = "cc";
-select count(*) from t3 where id3 > 90;
-delete t1.*, t2.*, t3.* from t1,t2,t3 where t1.id1 = t2.id2 and t2.id2 = t3.id3 and t1.id1 > 95;
-
-check table t1, t2, t3;
-
-select count(*) from t1 where id1 > 95;
-select count(*) from t2 where id2 > 95;
-select count(*) from t3 where id3 > 95;
-
-delete t1, t2, t3 from t1,t2,t3 where t1.id1 = t2.id2 and t2.id2 = t3.id3 and t1.id1 > 5;
-select count(*) from t1 where id1 > 5;
-select count(*) from t2 where id2 > 5;
-select count(*) from t3 where id3 > 5;
-
-delete from t1, t2, t3 using t1,t2,t3 where t1.id1 = t2.id2 and t2.id2 = t3.id3 and t1.id1 > 0;
-
-# These queries will force a scan of the table
-select count(*) from t1 where id1;
-select count(*) from t2 where id2;
-select count(*) from t3 where id3;
-drop table t1,t2,t3;
-
-create table t1(id1 int not null primary key, t varchar(100)) pack_keys = 1;
-create table t2(id2 int not null, t varchar(100), index(id2)) pack_keys = 1;
-disable_query_log;
-begin;
-let $1 = 1000;
-while ($1)
- {
- let $2 = 5;
- eval insert into t1 values ($1,'aaaaaaaaaaaaaaaaaaaa');
- while ($2)
- {
- eval insert into t2(id2,t) values ($1,'bbbbbbbbbbbbbbbbb');
- dec $2;
- }
- dec $1;
- }
-commit;
-enable_query_log;
-delete t1 from t1,t2 where t1.id1 = t2.id2 and t1.id1 > 500;
-drop table t1,t2;
-
-CREATE TABLE t1 (
- id int(11) NOT NULL default '0',
- name varchar(10) default NULL,
- PRIMARY KEY (id)
-) ENGINE=PBXT; # PBXT : Instead of MyISAM
-INSERT INTO t1 VALUES (1,'aaa'),(2,'aaa'),(3,'aaa');
-CREATE TABLE t2 (
- id int(11) NOT NULL default '0',
- name varchar(10) default NULL,
- PRIMARY KEY (id)
-) ENGINE=PBXT; # PBXT : Instead of MyISAM
-INSERT INTO t2 VALUES (2,'bbb'),(3,'bbb'),(4,'bbb');
-CREATE TABLE t3 (
- id int(11) NOT NULL default '0',
- mydate datetime default NULL,
- PRIMARY KEY (id)
-) ENGINE=PBXT; # PBXT : Instead of MyISAM
-INSERT INTO t3 VALUES (1,'2002-02-04 00:00:00'),(3,'2002-05-12 00:00:00'),(5,'2002-05-12 00:00:00'),(6,'2002-06-22
-00:00:00'),(7,'2002-07-22 00:00:00');
-delete t1,t2,t3 from t1,t2,t3 where to_days(now())-to_days(t3.mydate)>=30 and t3.id=t1.id and t3.id=t2.id;
-select * from t3;
-DROP TABLE t1,t2,t3;
-
-CREATE TABLE IF NOT EXISTS `t1` (
- `id` int(11) NOT NULL auto_increment,
- `tst` text,
- `tst1` text,
- PRIMARY KEY (`id`)
-) ENGINE=PBXT; # PBXT : Instead of MyISAM
-
-CREATE TABLE IF NOT EXISTS `t2` (
- `ID` int(11) NOT NULL auto_increment,
- `ParId` int(11) default NULL,
- `tst` text,
- `tst1` text,
- PRIMARY KEY (`ID`),
- KEY `IX_ParId_t2` (`ParId`),
- FOREIGN KEY (`ParId`) REFERENCES `t1` (`id`)
-) ENGINE=PBXT; # PBXT : Instead of MyISAM
-
-INSERT INTO t1(tst,tst1) VALUES("MySQL","MySQL AB"), ("MSSQL","Microsoft"), ("ORACLE","ORACLE");
-
-INSERT INTO t2(ParId) VALUES(1), (2), (3);
-
-select * from t2;
-
-UPDATE t2, t1 SET t2.tst = t1.tst, t2.tst1 = t1.tst1 WHERE t2.ParId = t1.Id;
-
-select * from t2;
-drop table t2, t1 ;
-
-create table t1 (n numeric(10));
-create table t2 (n numeric(10));
-insert into t2 values (1),(2),(4),(8),(16),(32);
-select * from t2 left outer join t1 using (n);
-delete t1,t2 from t2 left outer join t1 using (n);
-select * from t2 left outer join t1 using (n);
-drop table t1,t2 ;
-
-#
-# Test with locking
-#
-
-create table t1 (n int(10) not null primary key, d int(10));
-create table t2 (n int(10) not null primary key, d int(10));
-insert into t1 values(1,1);
-insert into t2 values(1,10),(2,20);
-LOCK TABLES t1 write, t2 read;
---error 1099
-DELETE t1.*, t2.* FROM t1,t2 where t1.n=t2.n;
---error 1099
-UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n;
-UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n;
-unlock tables;
-LOCK TABLES t1 write, t2 write;
-UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n;
-select * from t1;
-DELETE t1.*, t2.* FROM t1,t2 where t1.n=t2.n;
-select * from t1;
-select * from t2;
-unlock tables;
-drop table t1,t2;
-
-#
-# Test safe updates and timestamps
-#
-set sql_safe_updates=1;
-create table t1 (n int(10), d int(10));
-create table t2 (n int(10), d int(10));
-insert into t1 values(1,1);
-insert into t2 values(1,10),(2,20);
---error 1175
-UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n;
-set sql_safe_updates=0;
-drop table t1,t2;
-set timestamp=1038401397;
-create table t1 (n int(10) not null primary key, d int(10), t timestamp);
-create table t2 (n int(10) not null primary key, d int(10), t timestamp);
-insert into t1 values(1,1,NULL);
-insert into t2 values(1,10,NULL),(2,20,NULL);
-set timestamp=1038000000;
-UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n;
-select n,d,unix_timestamp(t) from t1;
-select n,d,unix_timestamp(t) from t2;
---error 1064
-UPDATE t1,t2 SET 1=2 WHERE t1.n=t2.n;
-drop table t1,t2;
-set timestamp=0;
-set sql_safe_updates=0;
-create table t1 (n int(10) not null primary key, d int(10));
-create table t2 (n int(10) not null primary key, d int(10));
-insert into t1 values(1,1), (3,3);
-insert into t2 values(1,10),(2,20);
-UPDATE t2 left outer join t1 on t1.n=t2.n SET t1.d=t2.d;
-select * from t1 order by n; # PBXT required ORDER for consistant result
-select * from t2 order by n; # PBXT required ORDER for consistant result
-drop table t1,t2;
-create table t1 (n int(10), d int(10));
-create table t2 (n int(10), d int(10));
-insert into t1 values(1,1),(1,2);
-insert into t2 values(1,10),(2,20);
-UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n;
-select * from t1 order by n; # PBXT required ORDER for consistant result
-select * from t2 order by n; # PBXT required ORDER for consistant result
-drop table t1,t2;
-create table t1 (n int(10), d int(10));
-create table t2 (n int(10), d int(10));
-insert into t1 values(1,1),(3,2);
-insert into t2 values(1,10),(1,20);
-UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n;
-select * from t1 order by n; # PBXT required ORDER for consistant result
-select * from t2 order by n; # PBXT required ORDER for consistant result
-UPDATE t1 a ,t2 b SET a.d=b.d,b.d=30 WHERE a.n=b.n;
-select * from t1 order by n; # PBXT required ORDER for consistant result
-select * from t2 order by n; # PBXT required ORDER for consistant result
-DELETE a, b FROM t1 a,t2 b where a.n=b.n;
-select * from t1 order by n; # PBXT required ORDER for consistant result
-select * from t2 order by n; # PBXT required ORDER for consistant result
-drop table t1,t2;
-
-CREATE TABLE t1 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) ENGINE=PBXT; # PBXT : Instead of MyISAM
-INSERT INTO t1 VALUES (1,'jedan'),(2,'dva'),(3,'tri'),(4,'xxxxxxxxxx'),(5,'a'),(10,''),(11,''),(12,''),(13,'');
-CREATE TABLE t2 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) ENGINE=PBXT; # PBXT : Instead of MyISAM
-INSERT INTO t2 VALUES (1,'jedan'),(2,'dva'),(3,'tri'),(4,'xxxxxxxxxx'),(5,'a');
-CREATE TABLE t3 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) ENGINE=PBXT; # PBXT : Instead of MyISAM
-INSERT INTO t3 VALUES (1,'jedan'),(2,'dva');
-update t1,t2 set t1.naziv="aaaa" where t1.broj=t2.broj;
-update t1,t2,t3 set t1.naziv="bbbb", t2.naziv="aaaa" where t1.broj=t2.broj and t2.broj=t3.broj;
-drop table t1,t2,t3;
-
-#
-# Test multi update with different join methods
-#
-
-CREATE TABLE t1 (a int not null primary key, b int not null, key (b));
-CREATE TABLE t2 (a int not null primary key, b int not null, key (b));
-INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
-INSERT INTO t2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
-
-# Full join, without key
-update t1,t2 set t1.a=t1.a+100;
-select * from t1 order by a; # PBXT required ORDER for consistant result
-
-# unique key
-update t1,t2 set t1.a=t1.a+100 where t1.a=101;
-select * from t1 order by a; # PBXT required ORDER for consistant result
-
-# ref key
-update t1,t2 set t1.b=t1.b+10 where t1.b=2;
-select * from t1 order by a; # PBXT required ORDER for consistant result
-
-# Range key (in t1)
-update t1,t2 set t1.b=t1.b+2,t2.b=t1.b+10 where t1.b between 3 and 5 and t2.a=t1.a-100;
-select * from t1 order by a; # PBXT required ORDER for consistant result
-select * from t2 order by a; # PBXT required ORDER for consistant result
-
-# test for non-updating table which is also used in sub-select
-
-update t1,t2 set t1.b=t2.b, t1.a=t2.a where t1.a=t2.a and not exists (select * from t2 where t2.a > 10);
-
-drop table t1,t2;
-CREATE TABLE t3 ( KEY1 varchar(50) NOT NULL default '', PARAM_CORR_DISTANCE_RUSH double default NULL, PARAM_CORR_DISTANCE_GEM double default NULL, PARAM_AVG_TARE double default NULL, PARAM_AVG_NB_DAYS double default NULL, PARAM_DEFAULT_PROP_GEM_SRVC varchar(50) default NULL, PARAM_DEFAULT_PROP_GEM_NO_ETIK varchar(50) default NULL, PARAM_SCENARIO_COSTS varchar(50) default NULL, PARAM_DEFAULT_WAGON_COST double default NULL, tmp int(11) default NULL, PRIMARY KEY (KEY1)) ENGINE=PBXT; # PBXT : Instead of MyISAM
-INSERT INTO t3 VALUES ('A',1,1,22,3.2,'R','R','BASE2',0.24,NULL);
-create table t1 (A varchar(1));
-insert into t1 values ("A") ,("B"),("C"),("D");
-create table t2(Z varchar(15));
-insert into t2(Z) select concat(a.a,b.a,c.a,d.a) from t1 as a, t1 as b, t1 as c, t1 as d;
-update t2,t3 set Z =param_scenario_costs;
-drop table t1,t2,t3;
-create table t1 (a int, b int);
-create table t2 (a int, b int);
-insert into t1 values (1,1),(2,1),(3,1);
-insert into t2 values (1,1), (3,1);
-update t1 left join t2 on t1.a=t2.a set t1.b=2, t2.b=2 where t1.b=1 and t2.b=1 or t2.a is NULL;
-select t1.a, t1.b,t2.a, t2.b from t1 left join t2 on t1.a=t2.a where t1.b=1 and t2.b=1 or t2.a is NULL;
-drop table t1,t2;
-
-#
-# Test reuse of same table
-#
-
-create table t1 (a int not null auto_increment primary key, b int not null);
-insert into t1 (b) values (1),(2),(3),(4);
-update t1, t1 as t2 set t1.b=t2.b+1 where t1.a=t2.a;
-select * from t1;
-drop table t1;
-
-# Test multi-update and multi-delete with impossible where
-
-create table t1(id1 smallint(5), field char(5));
-create table t2(id2 smallint(5), field char(5));
-
-insert into t1 values (1, 'a'), (2, 'aa');
-insert into t2 values (1, 'b'), (2, 'bb');
-
-select * from t1;
-select * from t2;
-
-update t2 inner join t1 on t1.id1=t2.id2
- set t2.field=t1.field
- where 0=1;
-update t2, t1 set t2.field=t1.field
- where t1.id1=t2.id2 and 0=1;
-
-delete t1, t2 from t2 inner join t1 on t1.id1=t2.id2
- where 0=1;
-delete t1, t2 from t2,t1
- where t1.id1=t2.id2 and 0=1;
-
-drop table t1,t2;
-
-#
-# Test for bug #1820.
-#
-
-create table t1 ( a int not null, b int not null) ;
---disable_query_log
-begin;
-insert into t1 values (1,1),(2,2),(3,3),(4,4);
-let $1=19;
-set @d=4;
-while ($1)
-{
- eval insert into t1 select a+@d,b+@d from t1;
- eval set @d=@d*2;
- dec $1;
-}
-commit;
---enable_query_log
-alter table t1 add index i1(a);
-delete from t1 where a > 2000000;
-create table t2 like t1;
-insert into t2 select * from t1;
-
-analyze table t2; # PBXT: This statements waits so that count(*) is accurate!
-select 't2 rows before small delete', count(*) from t1;
-delete t1,t2 from t1,t2 where t1.b=t2.a and t1.a < 2;
-analyze table t2; # PBXT: This statements waits so that count(*) is accurate!
-select 't2 rows after small delete', count(*) from t2;
-select 't1 rows after small delete', count(*) from t1;
-
-## Try deleting many rows
-
-delete t1,t2 from t1,t2 where t1.b=t2.a and t1.a < 100*1000;
-analyze table t2; # PBXT: This statements waits so that count(*) is accurate!
-select 't2 rows after big delete', count(*) from t2;
-select 't1 rows after big delete', count(*) from t1;
-
-drop table t1,t2;
-
-#
-# Test alias (this is not correct in 4.0)
-#
-
-CREATE TABLE t1 ( a int );
-CREATE TABLE t2 ( a int );
-DELETE t1 FROM t1, t2 AS t3;
-DELETE t4 FROM t1, t1 AS t4;
-DELETE t3 FROM t1 AS t3, t1 AS t4;
---error 1109
-DELETE t1 FROM t1 AS t3, t2 AS t4;
-INSERT INTO t1 values (1),(2);
-INSERT INTO t2 values (1),(2);
-DELETE t1 FROM t1 AS t2, t2 AS t1 where t1.a=t2.a and t1.a=1;
-SELECT * from t1;
-SELECT * from t2;
-DELETE t2 FROM t1 AS t2, t2 AS t1 where t1.a=t2.a and t1.a=2;
-SELECT * from t1;
-SELECT * from t2;
-DROP TABLE t1,t2;
-
-#
-# Test update with const tables
-#
-create table `t1` (`p_id` int(10) unsigned NOT NULL auto_increment, `p_code` varchar(20) NOT NULL default '', `p_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`p_id`) );
-create table `t2` (`c2_id` int(10) unsigned NULL auto_increment, `c2_p_id` int(10) unsigned NOT NULL default '0', `c2_note` text NOT NULL, `c2_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`c2_id`), KEY `c2_p_id` (`c2_p_id`) );
-insert into t1 values (0,'A01-Comp',1);
-insert into t1 values (0,'B01-Comp',1);
-insert into t2 values (0,1,'A Note',1);
-update t1 left join t2 on p_id = c2_p_id set c2_note = 'asdf-1' where p_id = 2;
-select * from t1;
-select * from t2;
-drop table t1, t2;
-
-#
-# privilege check for multiupdate with other tables
-#
-
-connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
-connection root;
---disable_warnings
-create database mysqltest;
---enable_warnings
-create table mysqltest.t1 (a int, b int, primary key (a));
-create table mysqltest.t2 (a int, b int, primary key (a));
-create table mysqltest.t3 (a int, b int, primary key (a));
-grant select on mysqltest.* to mysqltest_1@localhost;
-grant update on mysqltest.t1 to mysqltest_1@localhost;
-connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
-connection user1;
-update t1, t2 set t1.b=1 where t1.a=t2.a;
-update t1, t2 set t1.b=(select t3.b from t3 where t1.a=t3.a) where t1.a=t2.a;
-connection root;
-revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
-revoke all privileges on mysqltest.* from mysqltest_1@localhost;
-delete from mysql.user where user=_binary'mysqltest_1';
-drop database mysqltest;
-
-#
-# multi delete wrong table check
-#
-create table t1 (a int, primary key (a));
-create table t2 (a int, primary key (a));
-create table t3 (a int, primary key (a));
--- error 1109
-delete t1,t3 from t1,t2 where t1.a=t2.a and t2.a=(select t3.a from t3 where t1.a=t3.a);
-drop table t1, t2, t3;
-
-#
-# multi* unique updating table check
-#
-create table t1 (col1 int);
-create table t2 (col1 int);
--- error 1093
-update t1,t2 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1;
--- error 1093
-delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2.col1;
-drop table t1,t2;
-
-# Test for BUG#5837 - delete with outer join and const tables
---disable_warnings
-create table t1 (
- aclid bigint not null primary key,
- status tinyint(1) not null
-);
-
-create table t2 (
- refid bigint not null primary key,
- aclid bigint, index idx_acl(aclid)
-);
---enable_warnings
-insert into t2 values(1,null);
-delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1';
-drop table t1, t2;
-
-#
-# Bug#19225: unchecked error leads to server crash
-#
-create table t1(a int);
-create table t2(a int);
---error 1093
-delete from t1,t2 using t1,t2 where t1.a=(select a from t1);
-drop table t1, t2;
-# End of 4.1 tests
-
-#
-# Test for bug #1980.
-#
---disable_warnings
-create table t1 ( c char(8) not null ) engine=pbxt; # PBXT: Instead of InnoDB
---enable_warnings
-
-insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9');
-insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F');
-
-alter table t1 add b char(8) not null;
-alter table t1 add a char(8) not null;
-alter table t1 add primary key (a,b,c);
-update t1 set a=c, b=c;
-
-create table t2 like t1;
-insert into t2 select * from t1;
-
-delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
-
-drop table t1,t2;
-
---disable_warnings
-create table t1 ( c char(8) not null ) engine=pbxt; # PBXT: Instead of InnoDB
---enable_warnings
-
-insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9');
-insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F');
-
-alter table t1 add b char(8) not null;
-alter table t1 add a char(8) not null;
-alter table t1 add primary key (a,b,c);
-update t1 set a=c, b=c;
-
-create table t2 like t1;
-insert into t2 select * from t1;
-
-delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
-
-drop table t1,t2;
-
-#
-# Test alter table and a concurrent multi update
-# (This will force update to reopen tables)
-#
-
-create table t1 (a int, b int);
-insert into t1 values (1, 2), (2, 3), (3, 4);
-create table t2 (a int);
-insert into t2 values (10), (20), (30);
-create view v1 as select a as b, a/10 as a from t2;
-
-connect (locker,localhost,root,,test);
-connection locker;
-lock table t1 write;
-
-connect (changer,localhost,root,,test);
-connection changer;
-send alter table t1 add column c int default 100 after a;
-
-connect (updater,localhost,root,,test);
-connection updater;
-sleep 2;
-send update t1, v1 set t1.b=t1.a+t1.b+v1.b where t1.a=v1.a;
-
-connection locker;
-sleep 2;
-unlock tables;
-
-connection changer;
-reap;
-
-connection updater;
-reap;
-select * from t1;
-select * from t2;
-drop view v1;
-drop table t1, t2;
-
-#
-# Test multi updates and deletes using primary key and without.
-#
-create table t1 (i1 int, i2 int, i3 int);
-create table t2 (id int, c1 varchar(20), c2 varchar(20));
-insert into t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2);
-insert into t2 values (9,"abc","def"),(5,"opq","lmn"),(2,"test t","t test");
-select * from t1 order by i1;
-select * from t2;
-update t1,t2 set t1.i2=15, t2.c2="ppc" where t1.i1=t2.id;
-select * from t1 order by i1;
-select * from t2 order by id;
-delete t1.*,t2.* from t1,t2 where t1.i2=t2.id;
-select * from t1 order by i1;
-select * from t2 order by id;
-drop table t1, t2;
-create table t1 (i1 int auto_increment not null, i2 int, i3 int, primary key (i1));
-create table t2 (id int auto_increment not null, c1 varchar(20), c2 varchar(20), primary key(id));
-insert into t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2);
-insert into t2 values (9,"abc","def"),(5,"opq","lmn"),(2,"test t","t test");
-select * from t1 order by i1;
-select * from t2 order by id;
-update t1,t2 set t1.i2=15, t2.c2="ppc" where t1.i1=t2.id;
-select * from t1 order by i1;
-select * from t2 order by id;
-delete t1.*,t2.* from t1,t2 where t1.i2=t2.id;
-select * from t1 order by i1;
-select * from t2 order by id;
-drop table t1, t2;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/mysql_protocols.test b/mysql-test/suite/pbxt/t/mysql_protocols.test
deleted file mode 100644
index 5eba780420c..00000000000
--- a/mysql-test/suite/pbxt/t/mysql_protocols.test
+++ /dev/null
@@ -1,15 +0,0 @@
-# Embedded server doesn't support external clients
---source include/not_embedded.inc
-# Windows does not have SOCKET, but will try to create a PIPE as well as MEMORY
---source include/not_windows.inc
-
-# test for Bug #4998 "--protocol doesn't reject bad values"
-
---exec echo "select ' ok' as '<default>'" | $MYSQL
---exec echo "select ' ok' as 'TCP'" | $MYSQL --protocol=TCP
---exec echo "select ' ok' as 'SOCKET'" | $MYSQL --protocol=SOCKET
---exec echo "select ' ok' as 'PIPE'" | $MYSQL --protocol=PIPE 2>&1 || true
---exec echo "select ' ok' as 'MEMORY'" | $MYSQL --protocol=MEMORY 2>&1 || true
---exec echo "select ' ok' as 'NullS'" | $MYSQL --protocol=NullS 2>&1 || true
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/mysqlshow.test b/mysql-test/suite/pbxt/t/mysqlshow.test
deleted file mode 100644
index b54eeaeab34..00000000000
--- a/mysql-test/suite/pbxt/t/mysqlshow.test
+++ /dev/null
@@ -1,42 +0,0 @@
-# Can't run test of external client with embedded server
--- source include/not_embedded.inc
--- source include/have_innodb.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1,t2,test1,test2;
---enable_warnings
-
-#
-## Bug #5036 mysqlshow is missing a column
-#
-CREATE TABLE t1 (a int);
-INSERT INTO t1 VALUES (1),(2),(3);
-CREATE TABLE t2 (a int, b int);
-show tables;
-select "--------------------" as "";
---exec $MYSQL_SHOW test
-select "---- -v ------------" as "";
---exec $MYSQL_SHOW test -v
-select "---- -v -v ---------" as "";
---exec $MYSQL_SHOW test -v -v
-select "----- -t -----------" as "";
---exec $MYSQL_SHOW test -t
-select "---- -v -t ---------" as "";
---exec $MYSQL_SHOW test -v -t
-select "---- -v -v -t ------" as "";
---exec $MYSQL_SHOW test -v -v -t
-DROP TABLE t1, t2;
-
-#
-# Bug #19147: mysqlshow INFORMATION_SCHEMA does not work
-#
---sorted_result
---exec $MYSQL_SHOW information_schema
---sorted_result
---exec $MYSQL_SHOW INFORMATION_SCHEMA
---exec $MYSQL_SHOW inf_rmation_schema
-
---disable_query_log
-drop database pbxt;
---enable_query_log
---echo End of 5.0 tests
diff --git a/mysql-test/suite/pbxt/t/mysqlslap.test b/mysql-test/suite/pbxt/t/mysqlslap.test
deleted file mode 100644
index 55dca40e190..00000000000
--- a/mysql-test/suite/pbxt/t/mysqlslap.test
+++ /dev/null
@@ -1,44 +0,0 @@
-# Can't run test of external client with embedded server
---source include/not_embedded.inc
---source include/not_windows.inc
-
---exec $MYSQL_SLAP --silent --concurrency=5 --iterations=20 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql
-
---exec $MYSQL_SLAP --silent --concurrency=5 --iterations=20 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql
-
---exec $MYSQL_SLAP --only-print --iterations=20 --query="select * from t1" --create="CREATE TABLE t1 (id int, name varchar(64)); INSERT INTO t1 VALUES (1, 'This is a test')" --delimiter=";"
---exec $MYSQL_SLAP --silent --concurrency=5 --iterations=20 --query="select * from t1" --create="CREATE TABLE t1 (id int, name varchar(64)); INSERT INTO t1 VALUES (1, 'This is a test')" --delimiter=";"
-
---exec $MYSQL_SLAP --only-print --delimiter=";" --query="select * from t1;select * from t2" --create="CREATE TABLE t1 (id int, name varchar(64)); create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2')" --engine="heap,myisam"
-
---exec $MYSQL_SLAP --silent --concurrency=5 --iterations=20 --delimiter=";" --query="select * from t1;select * from t2" --create="CREATE TABLE t1 (id int, name varchar(64)); create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2')"
-
---exec $MYSQL_SLAP --silent --concurrency=5 --iterations=20 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --create-schema=test_env
-
---exec $MYSQL_SLAP --silent --concurrency=5 --iterations=20 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --create-schema=test_env --auto-generate-sql-add-autoincrement
-
---exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-add-autoincrement
-
---exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=update
-
---exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=read
-
---exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write
-
---exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=mixed
-
---exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-guid-primary --auto-generate-sql-load-type=update
-
---exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-guid-primary --auto-generate-sql-load-type=update --auto-generate-sql-execute-number=5
-
---exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-guid-primary --auto-generate-sql-load-type=key --auto-generate-sql-execute-number=5
-
---exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-guid-primary --auto-generate-sql-load-type=key --auto-generate-sql-execute-number=5 --auto-generate-sql-secondary-indexes=3
-
---exec $MYSQL_SLAP --only-print --delimiter=";" --query="select * from t1;select * from t2" --create="CREATE TABLE t1 (id int, name varchar(64)); create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2')" --engine="heap,myisam" --post-query="SHOW TABLES" --pre-query="SHOW TABLES";
-
- --exec $MYSQL_SLAP --only-print --delimiter=";" --query="select * from t1;select * from t2" --create="CREATE TABLE t1 (id int, name varchar(64)); create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2')" --engine="heap,myisam" --post-query="SHOW TABLES" --pre-query="SHOW TABLES" --number-of-queries=6 --commit=1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/negation_elimination.test b/mysql-test/suite/pbxt/t/negation_elimination.test
deleted file mode 100644
index 9bc2cef75a9..00000000000
--- a/mysql-test/suite/pbxt/t/negation_elimination.test
+++ /dev/null
@@ -1,78 +0,0 @@
-#
-# Test negation elimination
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (a int, key (a));
-insert into t1 values (NULL), (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
-(10), (11), (12), (13), (14), (15), (16), (17), (18), (19);
-
-explain select * from t1 where not(not(a));
-select * from t1 where not(not(a));
-explain select * from t1 where not(not(not(a > 10)));
-select * from t1 where not(not(not(a > 10)));
-explain select * from t1 where not(not(not(a < 5) and not(a > 10)));
-select * from t1 where not(not(not(a < 5) and not(a > 10)));
-explain select * from t1 where not(a = 10);
-select * from t1 where not(a = 10);
-explain select * from t1 where not(a != 10);
-select * from t1 where not(a != 1);
-explain select * from t1 where not(a < 10);
-select * from t1 where not(a < 10);
-explain select * from t1 where not(a >= 10);
-select * from t1 where not(a >= 10);
-explain select * from t1 where not(a > 10);
-select * from t1 where not(a > 10);
-explain select * from t1 where not(a <= 10);
-select * from t1 where not(a <= 10);
-explain select * from t1 where not(a is null);
-select * from t1 where not(a is null);
-explain select * from t1 where not(a is not null);
-select * from t1 where not(a is not null);
-explain select * from t1 where not(a < 5 or a > 15);
-select * from t1 where not(a < 5 or a > 15);
-explain select * from t1 where not(a < 15 and a > 5);
-select * from t1 where not(a < 15 and a > 5);
-
-explain select * from t1 where a = 2 or not(a < 10);
-select * from t1 where a = 2 or not(a < 10);
-explain select * from t1 where a > 5 and not(a > 10);
-select * from t1 where a > 5 and not(a > 10);
-explain select * from t1 where a > 5 xor a < 10;
-select * from t1 where a > 5 xor a < 10;
-
-explain select * from t1 where a = 2 or not(a < 5 or a > 15);
-select * from t1 where a = 2 or not(a < 5 or a > 15);
-explain select * from t1 where a = 7 or not(a < 15 and a > 5);
-select * from t1 where a = 7 or not(a < 15 and a > 5);
-
-explain select * from t1 where NULL or not(a < 15 and a > 5);
-select * from t1 where NULL or not(a < 15 and a > 5);
-explain select * from t1 where not(NULL and a > 5);
-select * from t1 where not(NULL and a > 5);
-explain select * from t1 where not(NULL or a);
-select * from t1 where not(NULL or a);
-explain select * from t1 where not(NULL and a);
-select * from t1 where not(NULL and a);
-
-explain select * from t1 where not((a < 5 or a < 10) and (not(a > 16) or a > 17));
-select * from t1 where not((a < 5 or a < 10) and (not(a > 16) or a > 17));
-explain select * from t1 where not((a < 5 and a < 10) and (not(a > 16) or a > 17));
-select * from t1 where not((a < 5 and a < 10) and (not(a > 16) or a > 17));
-explain select * from t1 where ((a between 5 and 15) and (not(a like 10)));
-select * from t1 where ((a between 5 and 15) and (not(a like 10)));
-
-delete from t1 where a > 3;
-select a, not(not(a)) from t1;
-analyze table t1; # PBXT: Required for consistent explain result
-explain extended select a, not(not(a)), not(a <= 2 and not(a)), not(a not like "1"), not (a not in (1,2)), not(a != 2) from t1 where not(not(a)) having not(not(a));
-
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/null.test b/mysql-test/suite/pbxt/t/null.test
deleted file mode 100644
index 63281133388..00000000000
--- a/mysql-test/suite/pbxt/t/null.test
+++ /dev/null
@@ -1,239 +0,0 @@
-# Initialise
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
-
-#
-# Testing of NULL in a lot of different places
-#
-
-select null,\N,isnull(null),isnull(1/0),isnull(1/0 = null),ifnull(null,1),ifnull(null,"TRUE"),ifnull("TRUE","ERROR"),1/0 is null,1 is not null;
-explain extended select null,\N,isnull(null),isnull(1/0),isnull(1/0 = null),ifnull(null,1),ifnull(null,"TRUE"),ifnull("TRUE","ERROR"),1/0 is null,1 is not null;
-select 1 | NULL,1 & NULL,1+NULL,1-NULL;
-select NULL=NULL,NULL<>NULL,IFNULL(NULL,1.1)+0,IFNULL(NULL,1) | 0;
-select strcmp("a",NULL),(1<NULL)+0.0,NULL regexp "a",null like "a%","a%" like null;
-select concat("a",NULL),replace(NULL,"a","b"),replace("string","i",NULL),replace("string",NULL,"i"),insert("abc",1,1,NULL),left(NULL,1);
-select repeat("a",0),repeat("ab",5+5),repeat("ab",-1),reverse(NULL);
-select field(NULL,"a","b","c");
-select 2 between null and 1,2 between 3 AND NULL,NULL between 1 and 2,2 between NULL and 3, 2 between 1 AND null;
-explain extended select 2 between null and 1,2 between 3 AND NULL,NULL between 1 and 2,2 between NULL and 3, 2 between 1 AND null;
-SELECT NULL AND NULL, 1 AND NULL, NULL AND 1, NULL OR NULL, 0 OR NULL, NULL OR 0;
-SELECT (NULL OR NULL) IS NULL;
-select NULL AND 0, 0 and NULL;
-select inet_ntoa(null),inet_aton(null),inet_aton("122.256"),inet_aton("122.226."),inet_aton("");
-explain extended select inet_ntoa(null),inet_aton(null),inet_aton("122.256"),inet_aton("122.226."),inet_aton("");
-
-create table t1 (x int);
-insert into t1 values (null);
-select * from t1 where x != 0;
-drop table t1;
-
-#
-# Test problem med index on NULL columns and testing with =NULL;
-#
-
-CREATE TABLE t1 (
- indexed_field int default NULL,
- KEY indexed_field (indexed_field)
-);
-INSERT INTO t1 VALUES (NULL),(NULL);
-SELECT * FROM t1 WHERE indexed_field=NULL;
-SELECT * FROM t1 WHERE indexed_field IS NULL;
-SELECT * FROM t1 WHERE indexed_field<=>NULL;
-DROP TABLE t1;
-
-#
-# Testing of IFNULL
-#
-create table t1 (a int, b int) engine=myisam;
-insert into t1 values(20,null);
-select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
-t2.b=t3.a;
-select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
-t2.b=t3.a order by 1;
-insert into t1 values(10,null);
-select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
-t2.b=t3.a order by 1;
-drop table t1;
-
-#
-# Test inserting and updating with NULL
-#
-CREATE TABLE t1 (a varchar(16) NOT NULL default '', b smallint(6) NOT NULL default 0, c datetime NOT NULL default '0000-00-00 00:00:00', d smallint(6) NOT NULL default 0);
-INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55";
-UPDATE t1 SET d=1/NULL;
-UPDATE t1 SET d=NULL;
---error 1048
-INSERT INTO t1 (a) values (null);
---error 1048
-INSERT INTO t1 (a) values (1/null);
-INSERT INTO t1 (a) values (null),(null);
---error 1048
-INSERT INTO t1 (b) values (null);
---error 1048
-INSERT INTO t1 (b) values (1/null);
-INSERT INTO t1 (b) values (null),(null);
---error 1048
-INSERT INTO t1 (c) values (null);
---error 1048
-INSERT INTO t1 (c) values (1/null);
-INSERT INTO t1 (c) values (null),(null);
---error 1048
-INSERT INTO t1 (d) values (null);
---error 1048
-INSERT INTO t1 (d) values (1/null);
-INSERT INTO t1 (d) values (null),(null);
-select * from t1;
-drop table t1;
-
-#
-# Test to check elimination of IS NULL predicate for a non-nullable attribute
-# (bug #1990)
-#
-create table t1 (a int not null, b int not null, index idx(a));
-insert into t1 values
- (1,1), (2,2), (3,3), (4,4), (5,5), (6,6),
- (7,7), (8,8), (9,9), (10,10), (11,11), (12,12);
-explain select * from t1 where a between 2 and 3;
-explain select * from t1 where a between 2 and 3 or b is null;
-drop table t1;
-select cast(NULL as signed);
-
-#
-# IS NULL is unable to use index in range if column is declared not null
-# (Bug #4256)
-#
-create table t1(i int, key(i));
-insert into t1 values(1);
-insert into t1 select i*2 from t1;
-insert into t1 select i*2 from t1;
-insert into t1 select i*2 from t1;
-insert into t1 select i*2 from t1;
-insert into t1 select i*2 from t1;
-insert into t1 select i*2 from t1;
-insert into t1 select i*2 from t1;
-insert into t1 select i*2 from t1;
-insert into t1 select i*2 from t1;
-insert into t1 values(null);
-# PBXT: Row estimate non-determonistic (TODO: Why?)
---replace_column 9 #
-explain select * from t1 where i=2 or i is null;
-select count(*) from t1 where i=2 or i is null;
-alter table t1 change i i int not null;
-explain select * from t1 where i=2 or i is null;
-select count(*) from t1 where i=2 or i is null;
-drop table t1;
-
-#
-# NULL has its own type BINARY(0) by default.
-# But NULL should be weaker than a constant
-# when mixing charsets/collations
-#
-set names latin2;
-# Check that result type is taken from a non-null string
-create table t1 select
- null as c00,
- if(1, null, 'string') as c01,
- if(0, null, 'string') as c02,
- ifnull(null, 'string') as c03,
- ifnull('string', null) as c04,
- case when 0 then null else 'string' end as c05,
- case when 1 then null else 'string' end as c06,
- coalesce(null, 'string') as c07,
- coalesce('string', null) as c08,
- least('string',null) as c09,
- least(null, 'string') as c10,
- greatest('string',null) as c11,
- greatest(null, 'string') as c12,
- nullif('string', null) as c13,
- nullif(null, 'string') as c14,
- trim('string' from null) as c15,
- trim(null from 'string') as c16,
- substring_index('string', null, 1) as c17,
- substring_index(null, 'string', 1) as c18,
- elt(1, null, 'string') as c19,
- elt(1, 'string', null) as c20,
- concat('string', null) as c21,
- concat(null, 'string') as c22,
- concat_ws('sep', 'string', null) as c23,
- concat_ws('sep', null, 'string') as c24,
- concat_ws(null, 'string', 'string') as c25,
- make_set(3, 'string', null) as c26,
- make_set(3, null, 'string') as c27,
- export_set(3, null, 'off', 'sep') as c29,
- export_set(3, 'on', null, 'sep') as c30,
- export_set(3, 'on', 'off', null) as c31,
- replace(null, 'from', 'to') as c32,
- replace('str', null, 'to') as c33,
- replace('str', 'from', null) as c34,
- insert('str', 1, 2, null) as c35,
- insert(null, 1, 2, 'str') as c36,
- lpad('str', 10, null) as c37,
- rpad(null, 10, 'str') as c38;
-
-show create table t1;
-drop table t1;
-
-#
-# Check that comparison is done according to
-# non-null string collation, i.e. case insensitively,
-# rather than according to NULL's collation, i.e. case sensitively
-#
-# in field
-select
- case 'str' when 'STR' then 'str' when null then 'null' end as c01,
- case 'str' when null then 'null' when 'STR' then 'str' end as c02,
- field(null, 'str1', 'str2') as c03,
- field('str1','STR1', null) as c04,
- field('str1', null, 'STR1') as c05,
- 'string' in ('STRING', null) as c08,
- 'string' in (null, 'STRING') as c09;
-
-# Restore charset to the default value.
-set names latin1;
-
-#
-# Bug#19145: mysqld crashes if you set the default value of an enum field to NULL
-#
-create table bug19145a (e enum('a','b','c') default 'b' , s set('x', 'y', 'z') default 'y' ) engine=MyISAM;
-create table bug19145b (e enum('a','b','c') default null, s set('x', 'y', 'z') default null) engine=MyISAM;
-
-create table bug19145c (e enum('a','b','c') not null default 'b' , s set('x', 'y', 'z') not null default 'y' ) engine=MyISAM;
-
-# Invalid default value for 's'
---error 1067
-create table bug19145setnotnulldefaultnull (e enum('a','b','c') default null, s set('x', 'y', 'z') not null default null) engine=MyISAM;
-
-# Invalid default value for 'e'
---error 1067
-create table bug19145enumnotnulldefaultnull (e enum('a','b','c') not null default null, s set('x', 'y', 'z') default null) engine=MyISAM;
-
-alter table bug19145a alter column e set default null;
-alter table bug19145a alter column s set default null;
-alter table bug19145a add column (i int);
-
-alter table bug19145b alter column e set default null;
-alter table bug19145b alter column s set default null;
-alter table bug19145b add column (i int);
-
-# Invalid default value for 'e'
---error 1067
-alter table bug19145c alter column e set default null;
-
-# Invalid default value for 's'
---error 1067
-alter table bug19145c alter column s set default null;
-alter table bug19145c add column (i int);
-
-show create table bug19145a;
-show create table bug19145b;
-show create table bug19145c;
-
-drop table bug19145a;
-drop table bug19145b;
-drop table bug19145c;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/null_key.test b/mysql-test/suite/pbxt/t/null_key.test
deleted file mode 100644
index 1fbe21b3b5b..00000000000
--- a/mysql-test/suite/pbxt/t/null_key.test
+++ /dev/null
@@ -1,245 +0,0 @@
-#
-# Check null keys
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-create table t1 (a int, b int not null,unique key (a,b),index(b)) engine=myisam;
-insert ignore into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(null,7),(9,9),(8,8),(7,7),(null,9),(null,9),(6,6);
-explain select * from t1 where a is null;
-explain select * from t1 where a is null and b = 2;
-explain select * from t1 where a is null and b = 7;
-explain select * from t1 where a=2 and b = 2;
-explain select * from t1 where a<=>b limit 2;
-explain select * from t1 where (a is null or a > 0 and a < 3) and b < 5 limit 3;
-explain select * from t1 where (a is null or a = 7) and b=7;
-explain select * from t1 where (a is null or a = 7) and b=7 order by a;
-explain select * from t1 where (a is null and b>a) or a is null and b=7 limit 2;
-explain select * from t1 where a is null and b=9 or a is null and b=7 limit 3;
-explain select * from t1 where a > 1 and a < 3 limit 1;
-explain select * from t1 where a > 8 and a < 9;
-select * from t1 where a is null;
-select * from t1 where a is null and b = 7;
-select * from t1 where a<=>b limit 2;
-select * from t1 where (a is null or a > 0 and a < 3) and b < 5 limit 3;
-select * from t1 where (a is null or a > 0 and a < 3) and b > 7 limit 3;
-select * from t1 where (a is null or a = 7) and b=7;
-select * from t1 where a is null and b=9 or a is null and b=7 limit 3;
-select * from t1 where a > 1 and a < 3 limit 1;
-select * from t1 where a > 8 and a < 9;
-create table t2 like t1;
-insert into t2 select * from t1;
-alter table t1 modify b blob not null, add c int not null, drop key a, add unique key (a,b(20),c), drop key b, add key (b(10));
-explain select * from t1 where a is null and b = 2;
-explain select * from t1 where a is null and b = 2 and c=0;
-explain select * from t1 where a is null and b = 7 and c=0;
-explain select * from t1 where a=2 and b = 2;
-explain select * from t1 where a<=>b limit 2;
-explain select * from t1 where (a is null or a > 0 and a < 3) and b < 5 and c=0 limit 3;
-explain select * from t1 where (a is null or a = 7) and b=7 and c=0;
-explain select * from t1 where (a is null and b>a) or a is null and b=7 limit 2;
-explain select * from t1 where a is null and b=9 or a is null and b=7 limit 3;
-explain select * from t1 where a > 1 and a < 3 limit 1;
-explain select * from t1 where a is null and b=7 or a > 1 and a < 3 limit 1;
-explain select * from t1 where a > 8 and a < 9;
-explain select * from t1 where b like "6%";
-select * from t1 where a is null;
-select * from t1 where a is null and b = 7 and c=0;
-select * from t1 where a<=>b limit 2;
-select * from t1 where (a is null or a > 0 and a < 3) and b < 5 limit 3;
-select * from t1 where (a is null or a > 0 and a < 3) and b > 7 limit 3;
-select * from t1 where (a is null or a = 7) and b=7 and c=0;
-select * from t1 where a is null and b=9 or a is null and b=7 limit 3;
-select * from t1 where b like "6%";
-
-#
-# Test ref_or_null optimization
-#
-drop table t1;
-rename table t2 to t1;
-alter table t1 modify b int null;
-insert into t1 values (7,null), (8,null), (8,7);
-explain select * from t1 where a = 7 and (b=7 or b is null);
-select * from t1 where a = 7 and (b=7 or b is null);
-explain select * from t1 where (a = 7 or a is null) and (b=7 or b is null);
-select * from t1 where (a = 7 or a is null) and (b=7 or b is null);
-explain select * from t1 where (a = 7 or a is null) and (a = 7 or a is null);
-select * from t1 where (a = 7 or a is null) and (a = 7 or a is null);
-create table t2 (a int);
-insert into t2 values (7),(8);
-explain select * from t2 straight_join t1 where t1.a=t2.a and b is null;
-drop index b on t1;
-explain select * from t2,t1 where t1.a=t2.a and b is null;
-select * from t2,t1 where t1.a=t2.a and b is null;
-explain select * from t2,t1 where t1.a=t2.a and (b= 7 or b is null);
-select * from t2,t1 where t1.a=t2.a and (b= 7 or b is null);
-explain select * from t2,t1 where (t1.a=t2.a or t1.a is null) and b= 7;
-select * from t2,t1 where (t1.a=t2.a or t1.a is null) and b= 7;
-explain select * from t2,t1 where (t1.a=t2.a or t1.a is null) and (b= 7 or b is null);
-select * from t2,t1 where (t1.a=t2.a or t1.a is null) and (b= 7 or b is null);
-insert into t2 values (null),(6);
-delete from t1 where a=8;
-explain select * from t2,t1 where t1.a=t2.a or t1.a is null;
-explain select * from t2,t1 where t1.a<=>t2.a or (t1.a is null and t1.b <> 9);
-select * from t2,t1 where t1.a<=>t2.a or (t1.a is null and t1.b <> 9);
-drop table t1,t2;
-
-#
-# The following failed for Matt Loschert
-#
-
-CREATE TABLE t1 (
- id int(10) unsigned NOT NULL auto_increment,
- uniq_id int(10) unsigned default NULL,
- PRIMARY KEY (id),
- UNIQUE KEY idx1 (uniq_id)
-) ENGINE=MyISAM;
-
-CREATE TABLE t2 (
- id int(10) unsigned NOT NULL auto_increment,
- uniq_id int(10) unsigned default NULL,
- PRIMARY KEY (id)
-) ENGINE=MyISAM;
-
-INSERT INTO t1 VALUES (1,NULL),(2,NULL),(3,1),(4,2),(5,NULL),(6,NULL),(7,3),(8,4),(9,NULL),(10,NULL);
-INSERT INTO t2 VALUES (1,NULL),(2,NULL),(3,1),(4,2),(5,NULL),(6,NULL),(7,3),(8,4),(9,NULL),(10,NULL);
-
-#
-# Check IS NULL optimization
-#
-explain select id from t1 where uniq_id is null;
-explain select id from t1 where uniq_id =1;
-#
-# Check updates
-#
-UPDATE t1 SET id=id+100 where uniq_id is null;
-UPDATE t2 SET id=id+100 where uniq_id is null;
-select id from t1 where uniq_id is null;
-select id from t2 where uniq_id is null;
-#
-# Delete all records from each table where the uniq_id field is null
-#
-DELETE FROM t1 WHERE uniq_id IS NULL;
-DELETE FROM t2 WHERE uniq_id IS NULL;
-#
-# Select what is left -- notice the difference
-#
-SELECT * FROM t1 ORDER BY uniq_id, id;
-SELECT * FROM t2 ORDER BY uniq_id, id;
-DROP table t1,t2;
-
-#
-# This crashed MySQL 3.23.47
-#
-
-CREATE TABLE `t1` (
- `order_id` char(32) NOT NULL default '',
- `product_id` char(32) NOT NULL default '',
- `product_type` int(11) NOT NULL default '0',
- PRIMARY KEY (`order_id`,`product_id`,`product_type`)
-) ENGINE=MyISAM;
-CREATE TABLE `t2` (
- `order_id` char(32) NOT NULL default '',
- `product_id` char(32) NOT NULL default '',
- `product_type` int(11) NOT NULL default '0',
- PRIMARY KEY (`order_id`,`product_id`,`product_type`)
-) ENGINE=MyISAM;
-INSERT INTO t1 (order_id, product_id, product_type) VALUES
-('3d7ce39b5d4b3e3d22aaafe9b633de51',1206029, 3),
-('3d7ce39b5d4b3e3d22aaafe9b633de51',5880836, 3),
-('9d9aad7764b5b2c53004348ef8d34500',2315652, 3);
-INSERT INTO t2 (order_id, product_id, product_type) VALUES
-('9d9aad7764b5b2c53004348ef8d34500',2315652, 3);
-
-select t1.* from t1
-left join t2 using(order_id, product_id, product_type)
-where t2.order_id=NULL;
-select t1.* from t1
-left join t2 using(order_id, product_id, product_type)
-where t2.order_id is NULL;
-drop table t1,t2;
-
-#
-# The last select returned wrong results in 3.23.52
-#
-
-create table t1 (id int);
-insert into t1 values (null), (0);
-create table t2 (id int);
-insert into t2 values (null);
-select * from t1, t2 where t1.id = t2.id;
-alter table t1 add key id (id);
-select * from t1, t2 where t1.id = t2.id;
-drop table t1,t2;
-
-#
-# Check bug when doing <=> NULL on an indexed null field
-#
-
-create table t1 (
- id integer,
- id2 integer not null,
- index (id),
- index (id2)
-);
-insert into t1 values(null,null),(1,1);
-select * from t1;
-select * from t1 where id <=> null;
-select * from t1 where id <=> null or id > 0;
-select * from t1 where id is null or id > 0;
-select * from t1 where id2 <=> null or id2 > 0;
-select * from t1 where id2 is null or id2 > 0;
-delete from t1 where id <=> NULL;
-select * from t1;
-drop table t1;
-
-#
-# Test for bug #12144: optimizations for key access with null keys
-# used for outer joins
-#
-
-CREATE TABLE t1 (a int);
-CREATE TABLE t2 (a int, b int, INDEX idx(a));
-CREATE TABLE t3 (b int, INDEX idx(b));
-CREATE TABLE t4 (b int, INDEX idx(b));
-INSERT INTO t1 VALUES (1), (2), (3), (4);
-INSERT INTO t2 VALUES (1, 1), (3, 1);
-INSERT INTO t3 VALUES
- (NULL), (NULL), (NULL), (NULL), (NULL),
- (NULL), (NULL), (NULL), (NULL), (NULL);
-INSERT INTO t4 SELECT * FROM t3;
-INSERT INTO t3 SELECT * FROM t4;
-INSERT INTO t4 SELECT * FROM t3;
-INSERT INTO t3 SELECT * FROM t4;
-INSERT INTO t4 SELECT * FROM t3;
-INSERT INTO t3 SELECT * FROM t4;
-INSERT INTO t4 SELECT * FROM t3;
-INSERT INTO t3 SELECT * FROM t4;
-INSERT INTO t4 SELECT * FROM t3;
-INSERT INTO t3 SELECT * FROM t4;
-INSERT INTO t4 SELECT * FROM t3;
-INSERT INTO t3 SELECT * FROM t4;
-INSERT INTO t4 SELECT * FROM t3;
-INSERT INTO t3 SELECT * FROM t4;
-INSERT INTO t4 SELECT * FROM t3;
-INSERT INTO t3 SELECT * FROM t4;
-INSERT INTO t3 VALUES (2), (3);
-
-ANALYZE table t1, t2, t3;
-
-SELECT COUNT(*) FROM t3;
-
-EXPLAIN SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a
- LEFT JOIN t3 ON t2.b=t3.b;
-FLUSH STATUS ;
-SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a
- LEFT JOIN t3 ON t2.b=t3.b;
-SELECT FOUND_ROWS();
-SHOW STATUS LIKE "handler_read%";
-
-DROP TABLE t1,t2,t3,t4;
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/odbc.test b/mysql-test/suite/pbxt/t/odbc.test
deleted file mode 100644
index 79be84f5e1c..00000000000
--- a/mysql-test/suite/pbxt/t/odbc.test
+++ /dev/null
@@ -1,39 +0,0 @@
-# Initialise
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-set @@session.sql_auto_is_null=1;
-
-#
-# Test some ODBC compatibility
-#
-
-select {fn length("hello")}, { date "1997-10-20" };
-
-#
-# Test retreiving row with last insert_id value.
-#
-
-create table t1 (a int not null auto_increment,b int not null,primary key (a,b));
-insert into t1 SET A=NULL,B=1;
-insert into t1 SET a=null,b=2;
-select * from t1 where a is null and b=2;
-select * from t1 where a is null;
-explain select * from t1 where b is null;
-drop table t1;
-
-#
-# Bug #14553: NULL in WHERE resets LAST_INSERT_ID
-#
-CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY);
-INSERT INTO t1 VALUES (NULL);
-SELECT sql_no_cache a, last_insert_id() FROM t1 WHERE a IS NULL;
-SELECT sql_no_cache a, last_insert_id() FROM t1 WHERE a IS NULL;
-SELECT sql_no_cache a, last_insert_id() FROM t1;
-DROP TABLE t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/olap.test b/mysql-test/suite/pbxt/t/olap.test
deleted file mode 100644
index 0b000eea077..00000000000
--- a/mysql-test/suite/pbxt/t/olap.test
+++ /dev/null
@@ -1,333 +0,0 @@
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-set @sav_dpi= @@div_precision_increment;
-set div_precision_increment= 5;
-show variables like 'div_precision_increment';
-
-create table t1 (product varchar(32), country_id int not null, year int, profit int);
-insert into t1 values ( 'Computer', 2,2000, 1200),
-( 'TV', 1, 1999, 150),
-( 'Calculator', 1, 1999,50),
-( 'Computer', 1, 1999,1500),
-( 'Computer', 1, 2000,1500),
-( 'TV', 1, 2000, 150),
-( 'TV', 2, 2000, 100),
-( 'TV', 2, 2000, 100),
-( 'Calculator', 1, 2000,75),
-( 'Calculator', 2, 2000,75),
-( 'TV', 1, 1999, 100),
-( 'Computer', 1, 1999,1200),
-( 'Computer', 2, 2000,1500),
-( 'Calculator', 2, 2000,75),
-( 'Phone', 3, 2003,10)
-;
-
-create table t2 (country_id int primary key, country char(20) not null);
-insert into t2 values (1, 'USA'),(2,'India'), (3,'Finland');
-
-# First simple rollups, with just grand total
-select product, sum(profit) from t1 group by product;
-select product, sum(profit) from t1 group by product with rollup;
-select product, sum(profit) from t1 group by 1 with rollup;
-select product, sum(profit),avg(profit) from t1 group by product with rollup;
-
-# Sub totals
-select product, country_id , year, sum(profit) from t1 group by product, country_id, year;
-select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup;
-explain extended select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup;
-select product, country_id , sum(profit) from t1 group by product desc, country_id with rollup;
-
-# limit
-select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup limit 5;
-select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup limit 3,3;
-
-select product, country_id, count(*), count(distinct year) from t1 group by product, country_id;
-select product, country_id, count(*), count(distinct year) from t1 group by product, country_id with rollup;
-
-# Test of having
-select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup having country_id = 1;
-select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup having sum(profit) > 200;
-select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup having sum(profit) > 7000;
-
-# Functions
-select concat(product,':',country_id) as 'prod', concat(":",year,":") as 'year',1+1, sum(profit)/count(*) from t1 group by 1,2 with rollup;
-select product, sum(profit)/count(*) from t1 group by product with rollup;
-select left(product,4) as prod, sum(profit)/count(*) from t1 group by prod with rollup;
-select concat(product,':',country_id), 1+1, sum(profit)/count(*) from t1 group by concat(product,':',country_id) with rollup;
-
-# Joins
-select product, country , year, sum(profit) from t1,t2 where t1.country_id=t2.country_id group by product, country, year with rollup;
-
-# Derived tables and sub selects
-select product, `sum` from (select product, sum(profit) as 'sum' from t1 group by product with rollup) as tmp where product is null;
-select product from t1 where exists (select product, country_id , sum(profit) from t1 as t2 where t1.product=t2.product group by product, country_id with rollup having sum(profit) > 6000);
-
-# The following doesn't return the expected answer, but this is a limitation
-# in the implementation so we should just document it
-select product, country_id , year, sum(profit) from t1 group by product, country_id, year having country_id is NULL;
-select concat(':',product,':'), sum(profit),avg(profit) from t1 group by product with rollup;
-
-# Error handling
-
-# Cube is not yet implemented
---error 1235
-select product, country_id , year, sum(profit) from t1 group by product, country_id, year with cube;
---error 1235
-explain select product, country_id , year, sum(profit) from t1 group by product, country_id, year with cube;
---error 1235
-select product, country_id , year, sum(profit) from t1 group by product, country_id, year with cube union all select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup;
-
-drop table t1,t2;
-
-#
-# Test bug with const tables
-#
-
-CREATE TABLE t1 (i int);
-INSERT INTO t1 VALUES(100);
-CREATE TABLE t2 (i int);
-INSERT INTO t2 VALUES (100),(200);
-SELECT i, COUNT(*) FROM t1 GROUP BY i WITH ROLLUP;
-SELECT t1.i, t2.i, COUNT(*) FROM t1,t2 GROUP BY t1.i,t2.i WITH ROLLUP;
-drop table t1,t2;
-
-#bug #4767: ROLLUP with LEFT JOIN
-
-CREATE TABLE user_day(
- user_id INT NOT NULL,
- date DATE NOT NULL,
- UNIQUE INDEX user_date (user_id, date)
-);
-
-INSERT INTO user_day VALUES
- (1, '2004-06-06' ),
- (1, '2004-06-07' ),
- (2, '2004-06-06' );
-
-SELECT
- d.date AS day,
- COUNT(d.user_id) as sample,
- COUNT(next_day.user_id) AS not_cancelled
- FROM user_day d
- LEFT JOIN user_day next_day
- ON next_day.user_id=d.user_id AND
- next_day.date= DATE_ADD( d.date, interval 1 day )
- GROUP BY day;
-
-SELECT
- d.date AS day,
- COUNT(d.user_id) as sample,
- COUNT(next_day.user_id) AS not_cancelled
- FROM user_day d
- LEFT JOIN user_day next_day
- ON next_day.user_id=d.user_id AND
- next_day.date= DATE_ADD( d.date, interval 1 day )
- GROUP BY day
- WITH ROLLUP;
-
-DROP TABLE user_day;
-
-#
-# Tests for bugs #8616, #8615: distinct sum with rollup
-#
-
-CREATE TABLE t1 (a int, b int);
-
-INSERT INTO t1 VALUES
- (1,4),
- (2,2), (2,2),
- (4,1), (4,1), (4,1), (4,1),
- (2,1), (2,1);
-
-SELECT SUM(b) FROM t1 GROUP BY a WITH ROLLUP;
-SELECT DISTINCT SUM(b) FROM t1 GROUP BY a WITH ROLLUP;
-
-SELECT SUM(b), COUNT(DISTINCT b) FROM t1 GROUP BY a WITH ROLLUP;
-SELECT DISTINCT SUM(b), COUNT(DISTINCT b) FROM t1 GROUP BY a WITH ROLLUP;
-
-SELECT SUM(b), COUNT(*) FROM t1 GROUP BY a WITH ROLLUP;
-SELECT DISTINCT SUM(b), COUNT(*) FROM t1 GROUP BY a WITH ROLLUP;
-
-SELECT SUM(b), COUNT(DISTINCT b), COUNT(*) FROM t1 GROUP BY a WITH ROLLUP;
-SELECT DISTINCT SUM(b), COUNT(DISTINCT b), COUNT(*) FROM t1
- GROUP BY a WITH ROLLUP;
-
-SELECT a, sum(b) FROM t1 GROUP BY a,b WITH ROLLUP;
-SELECT DISTINCT a, sum(b) FROM t1 GROUP BY a,b WITH ROLLUP;
-
-SELECT b, a, sum(b) FROM t1 GROUP BY a,b WITH ROLLUP;
-SELECT DISTINCT b,a, sum(b) FROM t1 GROUP BY a,b WITH ROLLUP;
-
-ALTER TABLE t1 ADD COLUMN c INT;
-SELECT a,b,sum(c) FROM t1 GROUP BY a,b,c WITH ROLLUP;
-SELECT distinct a,b,sum(c) FROM t1 GROUP BY a,b,c WITH ROLLUP;
-
-DROP TABLE t1;
-
-#
-# Tests for bugs #8617: SQL_CACL_FOUND_ROWS with rollup and limit
-#
-
-CREATE TABLE t1 (a int, b int);
-
-INSERT INTO t1 VALUES
- (1,4),
- (2,2), (2,2),
- (4,1), (4,1), (4,1), (4,1),
- (2,1), (2,1);
-
-SELECT a, SUM(b) FROM t1 GROUP BY a WITH ROLLUP LIMIT 1;
-SELECT SQL_CALC_FOUND_ROWS a, SUM(b) FROM t1 GROUP BY a WITH ROLLUP LIMIT 1;
-
-DROP TABLE t1;
-
-#
-# Tests for bug #9681: ROLLUP in subquery for derived table wiht
-# a group by field declared as NOT NULL
-#
-
-CREATE TABLE t1 (a int(11) NOT NULL);
-INSERT INTO t1 VALUES (1),(2);
-
-SELECT a, SUM(a) m FROM t1 GROUP BY a WITH ROLLUP;
-SELECT * FROM ( SELECT a, SUM(a) m FROM t1 GROUP BY a WITH ROLLUP ) t2;
-
-DROP TABLE t1;
-set div_precision_increment= @sav_dpi;
-
-#
-# Tests for bug #7914: ROLLUP over expressions on temporary table
-#
-
-CREATE TABLE t1 (a int(11));
-INSERT INTO t1 VALUES (1),(2);
-
-SELECT a, SUM(a), SUM(a)+1 FROM (SELECT a FROM t1 UNION select 2) d
- GROUP BY a;
-SELECT a, SUM(a), SUM(a)+1 FROM (SELECT a FROM t1 UNION select 2) d
- GROUP BY a WITH ROLLUP;
-
-SELECT a, SUM(a), SUM(a)+1 FROM (SELECT 1 a UNION select 2) d
- GROUP BY a;
-SELECT a, SUM(a), SUM(a)+1 FROM (SELECT 1 a UNION select 2) d
- GROUP BY a WITH ROLLUP;
-
-SELECT a, SUM(a), SUM(a)+1, CONCAT(SUM(a),'x'), SUM(a)+SUM(a), SUM(a)
- FROM (SELECT 1 a, 2 b UNION SELECT 2,3 UNION SELECT 5,6 ) d
- GROUP BY a WITH ROLLUP;
-
-DROP TABLE t1;
-
-#
-# Tests for bug #7894: ROLLUP over expressions on group by attributes
-#
-
-CREATE TABLE t1 (a int(11));
-INSERT INTO t1 VALUES (1),(2);
-
-SELECT a, a+1, SUM(a) FROM t1 GROUP BY a WITH ROLLUP;
-SELECT a+1 FROM t1 GROUP BY a WITH ROLLUP;
-SELECT a+SUM(a) FROM t1 GROUP BY a WITH ROLLUP;
-SELECT a, a+1 as b FROM t1 GROUP BY a WITH ROLLUP HAVING b > 2;
-SELECT a, a+1 as b FROM t1 GROUP BY a WITH ROLLUP HAVING a IS NULL;
-SELECT a, a+1 as b FROM t1 GROUP BY a WITH ROLLUP HAVING b IS NULL;
-SELECT IFNULL(a, 'TEST') FROM t1 GROUP BY a WITH ROLLUP;
-
-CREATE TABLE t2 (a int, b int);
-INSERT INTO t2 VALUES
- (1,4),
- (2,2), (2,2),
- (4,1), (4,1), (4,1), (4,1),
- (2,1), (2,1);
-
-SELECT a,b,SUM(b) FROM t2 GROUP BY a,b WITH ROLLUP;
-SELECT a,b,SUM(b), a+b as c FROM t2
- GROUP BY a,b WITH ROLLUP HAVING c IS NULL;
-SELECT IFNULL(a, 'TEST'), COALESCE(b, 'TEST') FROM t2
- GROUP BY a, b WITH ROLLUP;
-
-DROP TABLE t1,t2;
-
-#
-# Test for bug #11543: ROLLUP query with a repeated column in GROUP BY
-#
-
-CREATE TABLE t1 (a INT(10) NOT NULL, b INT(10) NOT NULL);
-INSERT INTO t1 VALUES (1, 1);
-INSERT INTO t1 VALUES (1, 2);
-
-SELECT a, b, a AS c, COUNT(*) AS count FROM t1 GROUP BY a, b, c WITH ROLLUP;
-
-DROP TABLE t1;
-
-# Bug #12885(1): derived table specified by a subquery with
-# ROLLUP over expressions on not nullable group by attributes
-#
-
-CREATE TABLE t1 (a int(11) NOT NULL);
-INSERT INTO t1 VALUES (1),(2);
-
-SELECT * FROM (SELECT a, a + 1, COUNT(*) FROM t1 GROUP BY a WITH ROLLUP) t;
-SELECT * FROM (SELECT a, LENGTH(a), COUNT(*) FROM t1 GROUP BY a WITH ROLLUP) t;
-
-DROP TABLE t1;
-
-#
-# Bug #12887 Distinct is not always applied after rollup
-#
-create table t1 ( a varchar(9), b int );
-insert into t1 values('a',1),(null,2);
-select a, max(b) from t1 group by a with rollup;
-select distinct a, max(b) from t1 group by a with rollup;
-drop table t1;
-
-#
-# Bug #20825: rollup puts non-equal values together
-#
-create table t1 (a varchar(22) not null , b int);
-insert into t1 values ("2006-07-01 21:30", 1), ("2006-07-01 23:30", 10);
-select left(a,10), a, sum(b) from t1 group by 1,2 with rollup;
-select left(a,10) x, a, sum(b) from t1 group by x,a with rollup;
-drop table t1;
-
-# End of 4.1 tests
-
-#
-# Tests for bug #11639: ROLLUP over view executed through filesort
-#
-
-CREATE TABLE t1(id int, type char(1));
-INSERT INTO t1 VALUES
- (1,"A"),(2,"C"),(3,"A"),(4,"A"),(5,"B"),
- (6,"B"),(7,"A"),(8,"C"),(9,"A"),(10,"C");
-CREATE VIEW v1 AS SELECT * FROM t1;
-
-SELECT type FROM t1 GROUP BY type WITH ROLLUP;
-SELECT type FROM v1 GROUP BY type WITH ROLLUP;
-EXPLAIN SELECT type FROM v1 GROUP BY type WITH ROLLUP;
-
-DROP VIEW v1;
-DROP TABLE t1;
-
-#
-# Bug #12885(2): view specified by a subquery with
-# ROLLUP over expressions on not nullable group by attributes
-#
-
-CREATE TABLE t1 (a int(11) NOT NULL);
-INSERT INTO t1 VALUES (1),(2);
-
-CREATE VIEW v1 AS
- SELECT a, LENGTH(a), COUNT(*) FROM t1 GROUP BY a WITH ROLLUP;
-
-DESC v1;
-SELECT * FROM v1;
-
-DROP VIEW v1;
-DROP TABLE t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/order_by.test b/mysql-test/suite/pbxt/t/order_by.test
deleted file mode 100644
index 04d08b41262..00000000000
--- a/mysql-test/suite/pbxt/t/order_by.test
+++ /dev/null
@@ -1,646 +0,0 @@
-#
-# Bug with order by
-#
-
---disable_warnings
-drop table if exists t1,t2,t3;
---enable_warnings
-
-CREATE TABLE t1 (
- id int(6) DEFAULT '0' NOT NULL,
- idservice int(5),
- clee char(20) NOT NULL,
- flag char(1),
- KEY id (id),
- PRIMARY KEY (clee)
-);
-
-
-INSERT INTO t1 VALUES (2,4,'6067169d','Y');
-INSERT INTO t1 VALUES (2,5,'606716d1','Y');
-INSERT INTO t1 VALUES (2,1,'606717c1','Y');
-INSERT INTO t1 VALUES (3,1,'6067178d','Y');
-INSERT INTO t1 VALUES (2,6,'60671515','Y');
-INSERT INTO t1 VALUES (2,7,'60671569','Y');
-INSERT INTO t1 VALUES (2,3,'dd','Y');
-
-CREATE TABLE t2 (
- id int(6) NOT NULL auto_increment,
- description varchar(40) NOT NULL,
- idform varchar(40),
- ordre int(6) unsigned DEFAULT '0' NOT NULL,
- image varchar(60),
- PRIMARY KEY (id),
- KEY id (id,ordre)
-);
-
-#
-# Dumping data for table 't2'
-#
-
-INSERT INTO t2 VALUES (1,'Emettre un appel d''offres','en_construction.html',10,'emettre.gif');
-INSERT INTO t2 VALUES (2,'Emettre des soumissions','en_construction.html',20,'emettre.gif');
-INSERT INTO t2 VALUES (7,'Liste des t2','t2_liste_form.phtml',51060,'link.gif');
-INSERT INTO t2 VALUES (8,'Consulter les soumissions','consulter_soumissions.phtml',200,'link.gif');
-INSERT INTO t2 VALUES (9,'Ajouter un type de materiel','typeMateriel_ajoute_form.phtml',51000,'link.gif');
-INSERT INTO t2 VALUES (10,'Lister/modifier un type de materiel','typeMateriel_liste_form.phtml',51010,'link.gif');
-INSERT INTO t2 VALUES (3,'Créer une fiche de client','clients_ajoute_form.phtml',40000,'link.gif');
-INSERT INTO t2 VALUES (4,'Modifier des clients','en_construction.html',40010,'link.gif');
-INSERT INTO t2 VALUES (5,'Effacer des clients','en_construction.html',40020,'link.gif');
-INSERT INTO t2 VALUES (6,'Ajouter un service','t2_ajoute_form.phtml',51050,'link.gif');
-
-
-select t1.id,t1.idservice,t2.ordre,t2.description from t1, t2 where t1.id = 2 and t1.idservice = t2.id order by t2.ordre;
-
-drop table t1,t2;
-
-#
-# Test of ORDER BY on concat() result
-#
-
-create table t1 (first char(10),last char(10));
-insert into t1 values ("Michael","Widenius");
-insert into t1 values ("Allan","Larsson");
-insert into t1 values ("David","Axmark");
-select concat(first," ",last) as name from t1 order by name;
-select concat(last," ",first) as name from t1 order by name;
-drop table t1;
-
-#
-# bug in distinct + order by
-#
-
-create table t1 (i int);
-insert into t1 values(1),(2),(1),(2),(1),(2),(3);
-select distinct i from t1;
-select distinct i from t1 order by rand(5);
-select distinct i from t1 order by i desc;
-select distinct i from t1 order by 1-i;
-select distinct i from t1 order by mod(i,2),i;
-drop table t1;
-
-#
-# bug#3681
-#
-
-create table t1 ( pk int primary key, name varchar(255) not null, number varchar(255) not null);
-insert into t1 values (1, 'Gamma', '123'), (2, 'Gamma Ext', '123a'), (3, 'Alpha', '001'), (4, 'Beta', '200c');
-select distinct t1.name as 'Building Name',t1.number as 'Building Number' from t1 order by t1.name asc;
-drop table t1;
-
-
-#
-# Order by on first index part
-#
-
-create table t1 (id int not null,col1 int not null,col2 int not null,index(col1));
-insert into t1 values(1,2,2),(2,2,1),(3,1,2),(4,1,1),(5,1,4),(6,2,3),(7,3,1),(8,2,4);
-select * from t1 order by col1,col2;
-select col1 from t1 order by id;
-select col1 as id from t1 order by id;
-select concat(col1) as id from t1 order by id;
-drop table t1;
-
-#
-# Test of order by on field()
-#
-
-CREATE TABLE t1 (id int auto_increment primary key,aika varchar(40),aikakentta timestamp);
-insert into t1 (aika) values ('Keskiviikko');
-insert into t1 (aika) values ('Tiistai');
-insert into t1 (aika) values ('Maanantai');
-insert into t1 (aika) values ('Sunnuntai');
-
-SELECT FIELD(SUBSTRING(t1.aika,1,2),'Ma','Ti','Ke','To','Pe','La','Su') AS test FROM t1 ORDER by test;
-drop table t1;
-
-#
-# Test of ORDER BY on IF
-#
-
-CREATE TABLE t1
-(
- a int unsigned NOT NULL,
- b int unsigned NOT NULL,
- c int unsigned NOT NULL,
- UNIQUE(a),
- INDEX(b),
- INDEX(c)
-);
-
-CREATE TABLE t2
-(
- c int unsigned NOT NULL,
- i int unsigned NOT NULL,
- INDEX(c)
-);
-
-CREATE TABLE t3
-(
- c int unsigned NOT NULL,
- v varchar(64),
- INDEX(c)
-);
-
-INSERT INTO t1 VALUES (1,1,1);
-INSERT INTO t1 VALUES (2,1,2);
-INSERT INTO t1 VALUES (3,2,1);
-INSERT INTO t1 VALUES (4,2,2);
-INSERT INTO t2 VALUES (1,50);
-INSERT INTO t2 VALUES (2,25);
-INSERT INTO t3 VALUES (1,'123 Park Place');
-INSERT INTO t3 VALUES (2,'453 Boardwalk');
-
-SELECT a,b,if(b = 1,i,if(b = 2,v,''))
-FROM t1
-LEFT JOIN t2 USING(c)
-LEFT JOIN t3 ON t3.c = t1.c;
-
-SELECT a,b,if(b = 1,i,if(b = 2,v,''))
-FROM t1
-LEFT JOIN t2 ON t1.c = t2.c
-LEFT JOIN t3 ON t3.c = t1.c;
-
-SELECT a,b,if(b = 1,i,if(b = 2,v,''))
-FROM t1
-LEFT JOIN t2 USING(c)
-LEFT JOIN t3 ON t3.c = t1.c
-ORDER BY a;
-
-SELECT a,b,if(b = 1,i,if(b = 2,v,''))
-FROM t1
-LEFT JOIN t2 ON t1.c = t2.c
-LEFT JOIN t3 ON t3.c = t1.c
-ORDER BY a;
-
-drop table t1,t2,t3;
-
-#
-# Test of ORDER BY (Bug found by Dean Edmonds)
-#
-
-create table t1 (ID int not null primary key, TransactionID int not null);
-insert into t1 (ID, TransactionID) values (1, 87), (2, 89), (3, 92), (4, 94), (5, 486), (6, 490), (7, 753), (9, 828), (10, 832), (11, 834), (12, 840);
-create table t2 (ID int not null primary key, GroupID int not null);
- insert into t2 (ID, GroupID) values (87, 87), (89, 89), (92, 92), (94, 94), (486, 486), (490, 490),(753, 753), (828, 828), (832, 832), (834, 834), (840, 840);
-create table t3 (ID int not null primary key, DateOfAction date not null);
-insert into t3 (ID, DateOfAction) values (87, '1999-07-19'), (89, '1999-07-19'), (92, '1999-07-19'), (94, '1999-07-19'), (486, '1999-07-18'), (490, '2000-03-27'), (753, '2000-03-28'), (828, '1999-07-27'), (832, '1999-07-27'),(834, '1999-07-27'), (840, '1999-07-27');
-select t3.DateOfAction, t1.TransactionID from t1 join t2 join t3 where t2.ID = t1.TransactionID and t3.ID = t2.GroupID order by t3.DateOfAction, t1.TransactionID;
-select t3.DateOfAction, t1.TransactionID from t1 join t2 join t3 where t2.ID = t1.TransactionID and t3.ID = t2.GroupID order by t1.TransactionID,t3.DateOfAction;
-drop table t1,t2,t3;
-
-#bug reported by Wouter de Jong
-
-CREATE TABLE t1 (
- member_id int(11) NOT NULL auto_increment,
- inschrijf_datum varchar(20) NOT NULL default '',
- lastchange_datum varchar(20) NOT NULL default '',
- nickname varchar(20) NOT NULL default '',
- password varchar(8) NOT NULL default '',
- voornaam varchar(30) NOT NULL default '',
- tussenvoegsels varchar(10) NOT NULL default '',
- achternaam varchar(50) NOT NULL default '',
- straat varchar(100) NOT NULL default '',
- postcode varchar(10) NOT NULL default '',
- wijk varchar(40) NOT NULL default '',
- plaats varchar(50) NOT NULL default '',
- telefoon varchar(10) NOT NULL default '',
- geboortedatum date NOT NULL default '0000-00-00',
- geslacht varchar(5) NOT NULL default '',
- email varchar(80) NOT NULL default '',
- uin varchar(15) NOT NULL default '',
- homepage varchar(100) NOT NULL default '',
- internet varchar(15) NOT NULL default '',
- scherk varchar(30) NOT NULL default '',
- favo_boek varchar(50) NOT NULL default '',
- favo_tijdschrift varchar(50) NOT NULL default '',
- favo_tv varchar(50) NOT NULL default '',
- favo_eten varchar(50) NOT NULL default '',
- favo_muziek varchar(30) NOT NULL default '',
- info text NOT NULL default '',
- ipnr varchar(30) NOT NULL default '',
- PRIMARY KEY (member_id)
-) ENGINE=MyISAM PACK_KEYS=1;
-
-insert into t1 (member_id) values (1),(2),(3);
-select member_id, nickname, voornaam FROM t1
-ORDER by lastchange_datum DESC LIMIT 2;
-drop table t1;
-
-#
-# Test optimization of ORDER BY DESC
-#
-
-create table t1 (a int not null, b int, c varchar(10), key (a, b, c));
-insert into t1 values (1, NULL, NULL), (1, NULL, 'b'), (1, 1, NULL), (1, 1, 'b'), (1, 1, 'b'), (2, 1, 'a'), (2, 1, 'b'), (2, 2, 'a'), (2, 2, 'b'), (2, 3, 'c'),(1,3,'b');
-
-explain select * from t1 where (a = 1 and b is null and c = 'b') or (a > 2) order by a desc;
-select * from t1 where (a = 1 and b is null and c = 'b') or (a > 2) order by a desc;
-explain select * from t1 where a >= 1 and a < 3 order by a desc;
-select * from t1 where a >= 1 and a < 3 order by a desc;
-explain select * from t1 where a = 1 order by a desc, b desc;
-select * from t1 where a = 1 order by a desc, b desc;
-explain select * from t1 where a = 1 and b is null order by a desc, b desc;
-select * from t1 where a = 1 and b is null order by a desc, b desc;
-explain select * from t1 where a >= 1 and a < 3 and b >0 order by a desc,b desc;
-explain select * from t1 where a = 2 and b >0 order by a desc,b desc;
-explain select * from t1 where a = 2 and b is null order by a desc,b desc;
-explain select * from t1 where a = 2 and (b is null or b > 0) order by a
-desc,b desc;
-explain select * from t1 where a = 2 and b > 0 order by a desc,b desc;
-explain select * from t1 where a = 2 and b < 2 order by a desc,b desc;
-explain select * from t1 where a = 1 order by b desc;
-select * from t1 where a = 1 order by b desc;
-#
-# Test things when we don't have NULL keys
-#
-
-alter table t1 modify b int not null, modify c varchar(10) not null;
-explain select * from t1 order by a, b, c;
-select * from t1 order by a, b, c;
-explain select * from t1 order by a desc, b desc, c desc;
-select * from t1 order by a desc, b desc, c desc;
-# test multiple ranges, NO_MAX_RANGE and EQ_RANGE
-explain select * from t1 where (a = 1 and b = 1 and c = 'b') or (a > 2) order by a desc;
-select * from t1 where (a = 1 and b = 1 and c = 'b') or (a > 2) order by a desc;
-# test NEAR_MAX, NO_MIN_RANGE
-explain select * from t1 where a < 2 and b <= 1 order by a desc, b desc;
-select * from t1 where a < 2 and b <= 1 order by a desc, b desc;
-select count(*) from t1 where a < 5 and b > 0;
-select * from t1 where a < 5 and b > 0 order by a desc,b desc;
-# test HA_READ_AFTER_KEY (at the end of the file), NEAR_MIN
-explain select * from t1 where a between 1 and 3 and b <= 1 order by a desc, b desc;
-select * from t1 where a between 1 and 3 and b <= 1 order by a desc, b desc;
-# test HA_READ_AFTER_KEY (in the middle of the file)
-explain select * from t1 where a between 0 and 1 order by a desc, b desc;
-select * from t1 where a between 0 and 1 order by a desc, b desc;
-drop table t1;
-
-
-CREATE TABLE t1 (
- gid int(10) unsigned NOT NULL auto_increment,
- cid smallint(5) unsigned NOT NULL default '0',
- PRIMARY KEY (gid),
- KEY component_id (cid)
-) ENGINE=MyISAM;
-INSERT INTO t1 VALUES (103853,108),(103867,108),(103962,108),(104505,108),(104619,108),(104620,108);
-ALTER TABLE t1 add skr int(10) not null;
-
-CREATE TABLE t2 (
- gid int(10) unsigned NOT NULL default '0',
- uid smallint(5) unsigned NOT NULL default '1',
- sid tinyint(3) unsigned NOT NULL default '1',
- PRIMARY KEY (gid),
- KEY uid (uid),
- KEY status_id (sid)
-) ENGINE=MyISAM;
-INSERT INTO t2 VALUES (103853,250,5),(103867,27,5),(103962,27,5),(104505,117,5),(104619,75,5),(104620,15,5);
-
-CREATE TABLE t3 (
- uid smallint(6) NOT NULL auto_increment,
- PRIMARY KEY (uid)
-) ENGINE=MyISAM;
-INSERT INTO t3 VALUES (1),(15),(27),(75),(117),(250);
-ALTER TABLE t3 add skr int(10) not null;
-
-select t1.gid, t2.sid, t3.uid from t2, t1, t3 where t2.gid = t1.gid and t2.uid = t3.uid order by t3.uid, t1.gid;
-select t1.gid, t2.sid, t3.uid from t3, t2, t1 where t2.gid = t1.gid and t2.uid = t3.uid order by t3.uid, t1.gid;
-
-# The following ORDER BY can be optimimized
-EXPLAIN select t1.gid, t2.sid, t3.uid from t3, t2, t1 where t2.gid = t1.gid and t2.uid = t3.uid order by t1.gid, t3.uid;
-EXPLAIN SELECT t1.gid, t3.uid from t1, t3 where t1.gid = t3.uid order by t1.gid,t3.skr;
-
-# The following ORDER BY can't be optimimized
-EXPLAIN SELECT t1.gid, t2.sid, t3.uid from t2, t1, t3 where t2.gid = t1.gid and t2.uid = t3.uid order by t3.uid, t1.gid;
-EXPLAIN SELECT t1.gid, t3.uid from t1, t3 where t1.gid = t3.uid order by t3.skr,t1.gid;
-EXPLAIN SELECT t1.gid, t3.uid from t1, t3 where t1.skr = t3.uid order by t1.gid,t3.skr;
-drop table t1,t2,t3;
-
-#
-# Test of bug when doing an ORDER BY with const items
-#
-
-CREATE TABLE t1 (
- `titre` char(80) NOT NULL default '',
- `numeropost` mediumint(8) unsigned NOT NULL auto_increment,
- `date` datetime NOT NULL default '0000-00-00 00:00:00',
- `auteur` char(35) NOT NULL default '',
- `icone` tinyint(2) unsigned NOT NULL default '0',
- `lastauteur` char(35) NOT NULL default '',
- `nbrep` smallint(6) unsigned NOT NULL default '0',
- `dest` char(35) NOT NULL default '',
- `lu` tinyint(1) unsigned NOT NULL default '0',
- `vue` mediumint(8) unsigned NOT NULL default '0',
- `ludest` tinyint(1) unsigned NOT NULL default '0',
- `ouvert` tinyint(1) unsigned NOT NULL default '1',
- PRIMARY KEY (`numeropost`),
- KEY `date` (`date`),
- KEY `dest` (`dest`,`ludest`),
- KEY `auteur` (`auteur`,`lu`),
- KEY `auteur_2` (`auteur`,`date`),
- KEY `dest_2` (`dest`,`date`)
-) CHECKSUM=1;
-
-CREATE TABLE t2 (
- `numeropost` mediumint(8) unsigned NOT NULL default '0',
- `pseudo` char(35) NOT NULL default '',
- PRIMARY KEY (`numeropost`,`pseudo`),
- KEY `pseudo` (`pseudo`)
-);
-
-INSERT INTO t1 (titre,auteur,dest) VALUES ('test','joce','bug');
-INSERT INTO t2 (numeropost,pseudo) VALUES (1,'joce'),(1,'bug');
-SELECT titre,t1.numeropost,auteur,icone,nbrep,0,date,vue,ouvert,lastauteur,dest FROM t2 LEFT JOIN t1 USING(numeropost) WHERE t2.pseudo='joce' ORDER BY date DESC LIMIT 0,30;
-SELECT titre,numeropost,auteur,icone,nbrep,0,date,vue,ouvert,lastauteur,dest FROM t2 LEFT JOIN t1 USING(numeropost) WHERE t2.pseudo='joce' ORDER BY date DESC LIMIT 0,30;
-SELECT titre,t1.numeropost,auteur,icone,nbrep,'0',date,vue,ouvert,lastauteur,dest FROM t2 LEFT JOIN t1 USING(numeropost) WHERE t2.pseudo='joce' ORDER BY date DESC LIMIT 0,30;
-SELECT titre,numeropost,auteur,icone,nbrep,'0',date,vue,ouvert,lastauteur,dest FROM t2 LEFT JOIN t1 USING(numeropost) WHERE t2.pseudo='joce' ORDER BY date DESC LIMIT 0,30;
-drop table t1,t2;
-
-#
-# Test order by with NULL values
-#
-CREATE TABLE t1 (a int, b int);
-INSERT INTO t1 VALUES (1, 2);
-INSERT INTO t1 VALUES (3, 4);
-INSERT INTO t1 VALUES (5, NULL);
-SELECT * FROM t1 ORDER BY b;
-SELECT * FROM t1 ORDER BY b DESC;
-SELECT * FROM t1 ORDER BY (a + b);
-SELECT * FROM t1 ORDER BY (a + b) DESC;
-DROP TABLE t1;
-
-#
-# Test of FORCE INDEX ... ORDER BY
-#
-
-create table t1(id int not null auto_increment primary key, t char(12));
-disable_query_log;
-let $1 = 1000;
-while ($1)
- {
- eval insert into t1(t) values ('$1');
- dec $1;
- }
-enable_query_log;
-explain select id,t from t1 order by id;
-explain select id,t from t1 force index (primary) order by id;
-drop table t1;
-
-#
-# Test of test_if_subkey() function
-#
-CREATE TABLE t1 (
- FieldKey varchar(36) NOT NULL default '',
- LongVal bigint(20) default NULL,
- StringVal mediumtext,
- KEY FieldKey (FieldKey),
- KEY LongField (FieldKey,LongVal),
- KEY StringField (FieldKey,StringVal(32))
-);
-INSERT INTO t1 VALUES ('0',3,'0'),('0',2,'1'),('0',1,'2'),('1',2,'1'),('1',1,'3'), ('1',0,'2'),('2',3,'0'),('2',2,'1'),('2',1,'2'),('2',3,'0'),('2',2,'1'),('2',1,'2'),('3',2,'1'),('3',1,'2'),('3','3','3');
-EXPLAIN SELECT * FROM t1 WHERE FieldKey = '1' ORDER BY LongVal;
-SELECT * FROM t1 WHERE FieldKey = '1' ORDER BY LongVal;
-EXPLAIN SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
-SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
-EXPLAIN SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY FieldKey, LongVal;
-SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY FieldKey, LongVal;
-DROP TABLE t1;
-#
-# Bug #1945 - Crashing bug with bad User Variables in UPDATE ... ORDER BY ...
-#
-CREATE TABLE t1 (a INT, b INT);
-SET @id=0;
-UPDATE t1 SET a=0 ORDER BY (a=@id), b;
-DROP TABLE t1;
-
-#
-# Bug when doing an order by on a 1 byte string (Bug #2147)
-#
-
-CREATE TABLE t1 ( id smallint(6) unsigned NOT NULL default '0', menu tinyint(4) NOT NULL default '0', KEY id (id), KEY menu (menu)) ENGINE=MyISAM;
-INSERT INTO t1 VALUES (11384, 2),(11392, 2);
-SELECT id FROM t1 WHERE id <11984 AND menu =2 ORDER BY id DESC LIMIT 1 ;
-drop table t1;
-
-#
-# REF_OR_NULL optimization + filesort (bug #2419)
-#
-
-create table t1(a int, b int, index(b));
-insert into t1 values (2, 1), (1, 1), (4, NULL), (3, NULL), (6, 2), (5, 2);
-explain select * from t1 where b=1 or b is null order by a;
-select * from t1 where b=1 or b is null order by a;
-explain select * from t1 where b=2 or b is null order by a;
-select * from t1 where b=2 or b is null order by a;
-drop table t1;
-
-#
-# Bug #3155 - Strange results with index (x, y) ... WHERE ... ORDER BY pk
-#
-
-create table t1 (a int not null auto_increment, b int not null, c int not null, d int not null,
-key(a,b,d), key(c,b,a));
-create table t2 like t1;
-insert into t1 values (NULL, 1, 2, 0), (NULL, 2, 1, 1), (NULL, 3, 4, 2), (NULL, 4, 3, 3);
-insert into t2 select null, b, c, d from t1;
-insert into t1 select null, b, c, d from t2;
-insert into t2 select null, b, c, d from t1;
-insert into t1 select null, b, c, d from t2;
-insert into t2 select null, b, c, d from t1;
-insert into t1 select null, b, c, d from t2;
-insert into t2 select null, b, c, d from t1;
-insert into t1 select null, b, c, d from t2;
-insert into t2 select null, b, c, d from t1;
-insert into t1 select null, b, c, d from t2;
-optimize table t1;
-set @row=10;
-insert into t1 select 1, b, c + (@row:=@row - 1) * 10, d - @row from t2 limit 10;
-select * from t1 where a=1 and b in (1) order by c, b, a;
-select * from t1 where a=1 and b in (1);
-drop table t1, t2;
-
-#
-# Bug #4302
-# Ambiguos order by when renamed column is identical to another in result.
-# Should not fail and prefer column from t1 for sorting.
-#
-create table t1 (col1 int, col int);
-create table t2 (col2 int, col int);
-insert into t1 values (1,1),(2,2),(3,3);
-insert into t2 values (1,3),(2,2),(3,1);
-select t1.* , t2.col as t2_col from t1 left join t2 on (t1.col1=t2.col2)
- order by col;
-
-#
-# Let us also test various ambiguos and potentially ambiguos cases
-# related to aliases
-#
---error 1052
-select col1 as col, col from t1 order by col;
---error 1052
-select t1.col as c1, t2.col as c2 from t1, t2 where t1.col1=t2.col2
- order by col;
---error 1052
-select t1.col as c1, t2.col as c2 from t1, t2 where t1.col1=t2.col2
- order by col;
---error 1052
-select col1 from t1, t2 where t1.col1=t2.col2 order by col;
---error 1052
-select t1.col as t1_col, t2.col2 from t1, t2 where t1.col1=t2.col2
- order by col;
-
-select t1.col as t1_col, t2.col from t1, t2 where t1.col1=t2.col2
- order by col;
-select col2 as c, col as c from t2 order by col;
-select col2 as col, col as col2 from t2 order by col;
-select t2.col2, t2.col, t2.col from t2 order by col;
-
-select t2.col2 as col from t2 order by t2.col;
-select t2.col2 as col, t2.col from t2 order by t2.col;
-select t2.col2, t2.col, t2.col from t2 order by t2.col;
-
-drop table t1, t2;
-
-#
-# Bug #5428: a problem with small max_sort_length value
-#
-
-create table t1 (a char(25));
-insert into t1 set a = repeat('x', 20);
-insert into t1 set a = concat(repeat('x', 19), 'z');
-insert into t1 set a = concat(repeat('x', 19), 'ab');
-insert into t1 set a = concat(repeat('x', 19), 'aa');
-set max_sort_length=20;
-select a from t1 order by a;
-drop table t1;
-
-#
-# Bug #7331
-#
-
-create table t1 (
- `sid` decimal(8,0) default null,
- `wnid` varchar(11) not null default '',
- key `wnid14` (`wnid`(4)),
- key `wnid` (`wnid`)
-) engine=myisam default charset=latin1;
-
-insert into t1 (`sid`, `wnid`) values
-('10100','01019000000'),('37986','01019000000'),('37987','01019010000'),
-('39560','01019090000'),('37989','01019000000'),('37990','01019011000'),
-('37991','01019011000'),('37992','01019019000'),('37993','01019030000'),
-('37994','01019090000'),('475','02070000000'),('25253','02071100000'),
-('25255','02071100000'),('25256','02071110000'),('25258','02071130000'),
-('25259','02071190000'),('25260','02071200000'),('25261','02071210000'),
-('25262','02071290000'),('25263','02071300000'),('25264','02071310000'),
-('25265','02071310000'),('25266','02071320000'),('25267','02071320000'),
-('25269','02071330000'),('25270','02071340000'),('25271','02071350000'),
-('25272','02071360000'),('25273','02071370000'),('25281','02071391000'),
-('25282','02071391000'),('25283','02071399000'),('25284','02071400000'),
-('25285','02071410000'),('25286','02071410000'),('25287','02071420000'),
-('25288','02071420000'),('25291','02071430000'),('25290','02071440000'),
-('25292','02071450000'),('25293','02071460000'),('25294','02071470000'),
-('25295','02071491000'),('25296','02071491000'),('25297','02071499000');
-
-explain select * from t1 where wnid like '0101%' order by wnid;
-
-select * from t1 where wnid like '0101%' order by wnid;
-
-drop table t1;
-
-#
-# Bug #7672 - a wrong result for a select query in braces followed by order by
-#
-
-CREATE TABLE t1 (a int);
-INSERT INTO t1 VALUES (2), (1), (1), (2), (1);
-SELECT a FROM t1 ORDER BY a;
-(SELECT a FROM t1) ORDER BY a;
-DROP TABLE t1;
-
-#
-# Bug #18767: global ORDER BY applied to a SELECT with ORDER BY either was
-# ignored or 'concatened' to the latter.
-
-CREATE TABLE t1 (a int, b int);
-INSERT INTO t1 VALUES (1,30), (2,20), (1,10), (2,30), (1,20), (2,10);
-
-(SELECT b,a FROM t1 ORDER BY a,b) ORDER BY b,a;
-(SELECT b FROM t1 ORDER BY b DESC) ORDER BY b ASC;
-(SELECT b,a FROM t1 ORDER BY b,a) ORDER BY a,b;
-(SELECT b,a FROM t1 ORDER by b,a LIMIT 3) ORDER by a,b;
-
-DROP TABLE t1;
-
-#
-# Bug #22457: Column alias in ORDER BY works, but not if in an expression
-#
-
-CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1),(2);
-SELECT a + 1 AS num FROM t1 ORDER BY 30 - num;
-SELECT CONCAT('test', a) AS str FROM t1 ORDER BY UPPER(str);
-SELECT a + 1 AS num FROM t1 GROUP BY 30 - num;
-SELECT a + 1 AS num FROM t1 HAVING 30 - num;
---error 1054
-SELECT a + 1 AS num, num + 1 FROM t1;
-SELECT a + 1 AS num, (select num + 2 FROM t1 LIMIT 1) FROM t1;
---error 1054
-SELECT a.a + 1 AS num FROM t1 a JOIN t1 b ON num = b.a;
-DROP TABLE t1;
-
-#
-# Bug #25427: crash when order by expression contains a name
-# that cannot be resolved unambiguously
-#
-
-CREATE TABLE t1 (a int);
-
-SELECT p.a AS val, q.a AS val1 FROM t1 p, t1 q ORDER BY val > 1;
---error 1052
-SELECT p.a AS val, q.a AS val FROM t1 p, t1 q ORDER BY val;
---error 1052
-SELECT p.a AS val, q.a AS val FROM t1 p, t1 q ORDER BY val > 1;
-
-DROP TABLE t1;
-
-# End of 4.1 tests
-create table t1 (a int not null, b int not null, c int not null);
-insert t1 values (1,1,1),(1,1,2),(1,2,1);
-select a, b from t1 group by a, b order by sum(c);
-drop table t1;
-
-#
-# Bug#21302: Result not properly sorted when using an ORDER BY on a second
-# table in a join
-#
-CREATE TABLE t1 (a int, b int, PRIMARY KEY (a));
-INSERT INTO t1 VALUES (1,1), (2,2), (3,3);
-
-explain SELECT t1.b as a, t2.b as c FROM
- t1 LEFT JOIN t1 t2 ON (t1.a = t2.a AND t2.a = 2)
-ORDER BY c;
-SELECT t2.b as c FROM
- t1 LEFT JOIN t1 t2 ON (t1.a = t2.a AND t2.a = 2)
-ORDER BY c;
-
-# check that it still removes sort of const table
-explain SELECT t1.b as a, t2.b as c FROM
- t1 JOIN t1 t2 ON (t1.a = t2.a AND t2.a = 2)
-ORDER BY c;
-
-CREATE TABLE t2 LIKE t1;
-INSERT INTO t2 SELECT * from t1;
-CREATE TABLE t3 LIKE t1;
-INSERT INTO t3 SELECT * from t1;
-CREATE TABLE t4 LIKE t1;
-INSERT INTO t4 SELECT * from t1;
-INSERT INTO t1 values (0,0),(4,4);
-
-SELECT t2.b FROM t1 LEFT JOIN (t2, t3 LEFT JOIN t4 ON t3.a=t4.a)
-ON (t1.a=t2.a AND t1.b=t3.b) order by t2.b;
-
-DROP TABLE t1,t2,t3,t4;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/order_fill_sortbuf.test b/mysql-test/suite/pbxt/t/order_fill_sortbuf.test
deleted file mode 100644
index 3ddcdb4bff1..00000000000
--- a/mysql-test/suite/pbxt/t/order_fill_sortbuf.test
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# This test does a create-select with ORDER BY, where there is so many
-# rows MySQL needs to use a merge during the sort phase.
-#
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-CREATE TABLE `t1` (
- `id` int(11) NOT NULL default '0',
- `id2` int(11) NOT NULL default '0',
- `id3` int(11) NOT NULL default '0');
-let $1=4000;
-disable_query_log;
-while ($1)
- {
- eval insert into t1 (id,id2,id3) values ($1,$1,$1);
- dec $1;
- }
-enable_query_log;
-create table t2 select id2 from t1 order by id3;
-select count(*) from t2;
-drop table t1,t2;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/overflow.test b/mysql-test/suite/pbxt/t/overflow.test
deleted file mode 100644
index a62ef9c4cd2..00000000000
--- a/mysql-test/suite/pbxt/t/overflow.test
+++ /dev/null
@@ -1,6 +0,0 @@
-connect (con1,localhost,root,,);
-connection con1;
--- error 1064,1102,1280
-drop database AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/partition_charset.test b/mysql-test/suite/pbxt/t/partition_charset.test
deleted file mode 100644
index 6dabadfe756..00000000000
--- a/mysql-test/suite/pbxt/t/partition_charset.test
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# Test for character set related things in combination
-# with the partition storage engine
-#
--- source include/have_partition.inc
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-set names utf8;
-create table t1 (s1 int)
- partition by list (s1)
- (partition c values in (1),
- partition Ç values in (3));
-insert into t1 values (1),(3);
-select * from t1;
-flush tables;
-set names latin1;
-select * from t1;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/partition_error.test b/mysql-test/suite/pbxt/t/partition_error.test
deleted file mode 100644
index 19bb79e460f..00000000000
--- a/mysql-test/suite/pbxt/t/partition_error.test
+++ /dev/null
@@ -1,801 +0,0 @@
-#
-# Simple test for the erroneos statements using the
-# partition storage engine
-#
--- source include/have_partition.inc
-
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
-
-#
-# Partition by key stand-alone error
-#
---error ER_PARSE_ERROR
-partition by list (a)
-partitions 3
-(partition x1 values in (1,2,9,4) tablespace ts1,
- partition x2 values in (3, 11, 5, 7) tablespace ts2,
- partition x3 values in (16, 8, 5+19, 70-43) tablespace ts3);
-
-#
-# Partition by key list, number of partitions defined, no partition defined
-#
---error ER_PARTITIONS_MUST_BE_DEFINED_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by list (a)
-partitions 2;
-
-#
-# Partition by key list, wrong result type
-#
---error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by list (sin(a))
-partitions 3
-(partition x1 values in (1,2,9,4) tablespace ts1,
- partition x2 values in (3, 11, 5, 7) tablespace ts2,
- partition x3 values in (16, 8, 5+19, 70-43) tablespace ts3);
-
-#
-# Partition by key, partition function not allowed
-#
---error ER_PARSE_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by key (a+2)
-partitions 3
-(partition x1 tablespace ts1,
- partition x2 tablespace ts2,
- partition x3 tablespace ts3);
-
-#
-# Partition by key, no partition name
-#
---error ER_PARSE_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by key (a)
-partitions 3
-(partition tablespace ts1,
- partition x2 tablespace ts2,
- partition x3 tablespace ts3);
-
-#
-# Partition by key, invalid field in field list
-#
---error ER_FIELD_NOT_FOUND_PART_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by key (a,d)
-partitions 3
-(partition x1 tablespace ts1,
- partition x2 tablespace ts2,
- partition x3 tablespace ts3);
-
-select load_file('$MYSQLD_DATADIR/test/t1.par');
-#
-# Partition by hash, invalid field in function
-#
---error ER_BAD_FIELD_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by hash (a + d)
-partitions 3
-(partition x1 tablespace ts1,
- partition x2 tablespace ts2,
- partition x3 tablespace ts3);
-
-#
-# Partition by hash, invalid result type
-#
---error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by hash (sin(a))
-partitions 3
-(partition x1 tablespace ts1,
- partition x2 tablespace ts2,
- partition x3 tablespace ts3);
-
-#
-# Partition by key specified 3 partitions but only defined 2 => error
-#
---error ER_PARSE_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by key (a)
-partitions 3
-(partition x1, partition x2);
-
-#
-# Partition by hash, random function
-#
---error ER_PARSE_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by hash (rand(a))
-partitions 2
-(partition x1, partition x2);
-
-#
-# Partition by range, random function
-#
---error ER_PARSE_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (rand(a))
-partitions 2
-(partition x1 values less than (0), partition x2 values less than (2));
-
-#
-# Partition by list, random function
-#
---error ER_PARSE_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by list (rand(a))
-partitions 2
-(partition x1 values in (1), partition x2 values in (2));
-
-#
-# Partition by hash, values less than error
-#
---error ER_PARTITION_WRONG_VALUES_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by hash (a)
-partitions 2
-(partition x1 values less than (4),
- partition x2 values less than (5));
-select load_file('$MYSQLD_DATADIR/test/t1.par');
-
-#
-# Partition by hash, values in error
-#
---error ER_PARTITION_WRONG_VALUES_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by hash (a)
-partitions 2
-(partition x1 values in (4),
- partition x2 values in (5));
-select load_file('$MYSQLD_DATADIR/test/t1.par');
-
-#
-# Partition by hash, values in error
-#
---error ER_PARTITION_WRONG_VALUES_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by hash (a)
-partitions 2
-(partition x1 values in (4,6),
- partition x2 values in (5,7));
-select load_file('$MYSQLD_DATADIR/test/t1.par');
-
-#
-# Subpartition by key, no partitions defined, single field
-#
---error ER_SUBPARTITION_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by key (a)
-subpartition by key (b);
-select load_file('$MYSQLD_DATADIR/test/t1.par');
-
-#
-# Subpartition by key, no partitions defined, list of fields
-#
---error ER_SUBPARTITION_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by key (a)
-subpartition by key (a, b);
-select load_file('$MYSQLD_DATADIR/test/t1.par');
-
-#
-# Subpartition by hash, no partitions defined
-#
---error ER_SUBPARTITION_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by key (a)
-subpartition by hash (a+b);
-select load_file('$MYSQLD_DATADIR/test/t1.par');
-
-#
-# Subpartition by key, no partitions defined, single field
-#
---error ER_SUBPARTITION_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by key (a)
-subpartition by key (b);
-select load_file('$MYSQLD_DATADIR/test/t1.par');
-
-#
-# Subpartition by key, no partitions defined, list of fields
-#
---error ER_SUBPARTITION_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by key (a)
-subpartition by key (a, b);
-select load_file('$MYSQLD_DATADIR/test/t1.par');
-
-#
-# Subpartition by hash, no partitions defined
-#
---error ER_SUBPARTITION_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by key (a)
-subpartition by hash (a+b);
-select load_file('$MYSQLD_DATADIR/test/t1.par');
-
-#
-# Subpartition by hash, no partitions defined, wrong subpartition function
-#
---error ER_PARSE_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by key (a)
-subpartition by hash (rand(a+b));
-
-#
-# Subpartition by hash, wrong subpartition function
-#
---error ER_SUBPARTITION_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by key (a)
-subpartition by hash (sin(a+b))
-(partition x1 (subpartition x11, subpartition x12),
- partition x2 (subpartition x21, subpartition x22));
-select load_file('$MYSQLD_DATADIR/test/t1.par');
-
-#
-# Subpartition by hash, no partitions defined, wrong subpartition function
-#
---error ER_PARSE_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by range (a)
-subpartition by key (a+b)
-(partition x1 values less than (1) (subpartition x11, subpartition x12),
- partition x2 values less than (2) (subpartition x21, subpartition x22));
-
-#
-# Subpartition by hash, no partitions defined, wrong subpartition function
-#
---error ER_FIELD_NOT_FOUND_PART_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by range (a)
-subpartition by key (a,d)
-(partition x1 values less than (1) (subpartition x11, subpartition x12),
- partition x2 values less than (2) (subpartition x21, subpartition x22));
-select load_file('$MYSQLD_DATADIR/test/t1.par');
-
-#
-# Subpartition by hash, no partitions defined, wrong subpartition function
-#
---error ER_SUBPARTITION_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by key (a)
-subpartition by hash (3+4);
-
-#
-# Subpartition by hash, no partitions defined, wrong subpartition function
-#
---error ER_BAD_FIELD_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by range (a)
-subpartition by hash (a+d)
-(partition x1 values less than (1) (subpartition x11, subpartition x12),
- partition x2 values less than (2) (subpartition x21, subpartition x22));
-
-#
-# Partition by range, no partition => error
-#
---error ER_PARTITIONS_MUST_BE_DEFINED_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a);
-select load_file('$MYSQLD_DATADIR/test/t1.par');
-
-#
-# Partition by range, invalid field in function
-#
---error ER_BAD_FIELD_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a+d)
-partitions 2
-(partition x1 values less than (4) tablespace ts1,
- partition x2 values less than (8) tablespace ts2);
-
-#
-# Partition by range, inconsistent partition function and constants
-#
---error ER_VALUES_IS_NOT_INT_TYPE_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (4.0) tablespace ts1,
- partition x2 values less than (8) tablespace ts2);
-
-#
-# Partition by range, constant partition function not allowed
-#
---error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (3+4)
-partitions 2
-(partition x1 values less than (4) tablespace ts1,
- partition x2 values less than (8) tablespace ts2);
-
-#
-# Partition by range, no values less than definition
-#
---error ER_PARTITION_REQUIRES_VALUES_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (4),
- partition x2);
-
-#
-# Partition by range, no values in definition allowed
-#
---error ER_PARTITION_WRONG_VALUES_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a)
-partitions 2
-(partition x1 values in (4),
- partition x2);
-
-#
-# Partition by range, values in error
-#
---error ER_PARTITION_WRONG_VALUES_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a)
-partitions 2
-(partition x1 values in (4),
- partition x2 values less than (5));
-
-#
-# Partition by range, missing parenthesis
-#
---error ER_PARTITION_WRONG_VALUES_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by list (a)
-partitions 2
-(partition x1 values less than 4,
- partition x2 values less than (5));
-
-#
-# Partition by range, maxvalue in wrong place
-#
---error ER_PARTITION_MAXVALUE_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a)
-partitions 2
-(partition x1 values less than maxvalue,
- partition x2 values less than (5));
-
-#
-# Partition by range, maxvalue in several places
-#
---error ER_PARTITION_MAXVALUE_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a)
-partitions 2
-(partition x1 values less than maxvalue,
- partition x2 values less than maxvalue);
-
-#
-# Partition by range, not increasing ranges
-#
---error ER_RANGE_NOT_INCREASING_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (4),
- partition x2 values less than (3));
-
-#
-# Partition by range, wrong result type of partition function
-#
---error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (sin(a))
-partitions 2
-(partition x1 values less than (4),
- partition x2 values less than (5));
-
-#
-# Subpartition by hash, wrong number of subpartitions
-#
---error ER_PARSE_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by list (a)
-subpartition by hash (a+b)
-subpartitions 3
-( partition x1 values in (1,2,4)
- ( subpartition x11 nodegroup 0,
- subpartition x12 nodegroup 1),
- partition x2 values in (3,5,6)
- ( subpartition x21 nodegroup 0,
- subpartition x22 nodegroup 1)
-);
-
-#
-# Subpartition by hash, wrong number of subpartitions
-#
---error ER_PARSE_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by list (a)
-subpartition by hash (a+b)
-( partition x1 values in (1)
- ( subpartition x11 nodegroup 0,
- subpartition xextra,
- subpartition x12 nodegroup 1),
- partition x2 values in (2)
- ( subpartition x21 nodegroup 0,
- subpartition x22 nodegroup 1)
-);
-
-#
-# Subpartition by list => error
-#
---error ER_PARSE_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by key (a)
-subpartition by list (a+b)
-( partition x1
- ( subpartition x11 engine myisam,
- subpartition x12 engine myisam),
- partition x2
- ( subpartition x21 engine myisam,
- subpartition x22 engine myisam)
-);
-
-#
-# Subpartition by list => error
-#
---error ER_PARSE_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by key (a)
-subpartition by list (a+b)
-( partition x1
- ( subpartition x11 engine myisam values in (0),
- subpartition x12 engine myisam values in (1)),
- partition x2
- ( subpartition x21 engine myisam values in (0),
- subpartition x22 engine myisam values in (1))
-);
-
-#
-# Partition by list, no partition => error
-#
---error ER_PARTITIONS_MUST_BE_DEFINED_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by list (a);
-
-#
-# Partition by list, constant partition function not allowed
-#
---error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by list (3+4)
-partitions 2
-(partition x1 values in (4) tablespace ts1,
- partition x2 values in (8) tablespace ts2);
-
-#
-# Partition by list, invalid field in function
-#
---error ER_BAD_FIELD_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by list (a+d)
-partitions 2
-(partition x1 values in (4) tablespace ts1,
- partition x2 values in (8) tablespace ts2);
-
-#
-# Partition by list, no values in definition
-#
---error ER_PARTITION_REQUIRES_VALUES_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by list (a)
-partitions 2
-(partition x1 values in (4),
- partition x2);
-
-#
-# Partition by list, values less than error
-#
---error ER_PARTITION_WRONG_VALUES_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by list (a)
-partitions 2
-(partition x1 values in (4),
- partition x2 values less than (5));
-
-#
-# Partition by list, no values in definition
-#
---error ER_PARTITION_REQUIRES_VALUES_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by list (a)
-partitions 2
-(partition x1 values in (4,6),
- partition x2);
-
-#
-# Partition by list, duplicate values
-#
---error ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by list (a)
-partitions 2
-(partition x1 values in (4, 12+9),
- partition x2 values in (3, 21));
-
-#
-# Partition by list, wrong constant result type (not INT)
-#
---error ER_VALUES_IS_NOT_INT_TYPE_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by list (a)
-partitions 2
-(partition x1 values in (4.0, 12+8),
- partition x2 values in (3, 21));
-
-#
-# Partition by list, missing parenthesis
-#
---error ER_PARSE_ERROR
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by list (a)
-partitions 2
-(partition x1 values in 4,
- partition x2 values in (5));
-
-#
-# Bug #13439: Crash when LESS THAN (non-literal)
-#
---error ER_BAD_FIELD_ERROR
-CREATE TABLE t1 (a int)
-PARTITION BY RANGE (a)
-(PARTITION p0 VALUES LESS THAN (x1));
-
-#
-# No partition for the given value
-#
-CREATE TABLE t1(a int)
- PARTITION BY RANGE (a) (PARTITION p1 VALUES LESS THAN(5));
---error ER_NO_PARTITION_FOR_GIVEN_VALUE
-insert into t1 values (10);
-drop table t1;
-
---error ER_PARTITION_CONST_DOMAIN_ERROR
-create table t1 (a bigint unsigned)
-partition by range (a)
-(partition p0 values less than (-1));
-#
-# Bug 18198 Partitions: Verify that erroneus partition functions doesn't work
-#
--- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
-create table t1 (v varchar(12))
-partition by range (ascii(v))
-(partition p0 values less than (10));
-#drop table t1;
-
--- error ER_PARSE_ERROR
-create table t1 (a int)
-partition by hash (rand(a));
--- error ER_PARSE_ERROR
-create table t1 (a int)
-partition by hash(CURTIME() + a);
--- error ER_PARSE_ERROR
-create table t1 (a int)
-partition by hash (NOW()+a);
--- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
-create table t1 (a int)
-partition by hash (extract(hour from convert_tz(a, '+00:00', '+00:00')));
--- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
-create table t1 (a int)
-partition by range (a + (select count(*) from t1))
-(partition p1 values less than (1));
--- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
-create table t1 (a char(10))
-partition by hash (extractvalue(a,'a'));
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-
diff --git a/mysql-test/suite/pbxt/t/partition_grant.test b/mysql-test/suite/pbxt/t/partition_grant.test
deleted file mode 100644
index 8997efa7e5c..00000000000
--- a/mysql-test/suite/pbxt/t/partition_grant.test
+++ /dev/null
@@ -1,62 +0,0 @@
--- source include/have_partition.inc
-# Grant tests not performed with embedded server
--- source include/not_embedded.inc
-
---disable_warnings
-drop schema if exists mysqltest_1;
---enable_warnings
-
-
-#
-# Bug #17139: ALTER TABLE ... DROP PARTITION should require DROP privilege
-#
-
-create schema mysqltest_1;
-use mysqltest_1;
-
-create table t1 (a int) partition by list (a) (partition p1 values in (1), partition p2 values in (2), partition p3 values in (3));
-insert into t1 values (1),(2);
-
-# We don't have DROP USER IF EXISTS. Use this workaround to
-# cleanup possible grants for mysqltest_1 left by previous tests
-# and ensure consistent results of SHOW GRANTS command below.
---disable_warnings
-grant usage on *.* to mysqltest_1@localhost;
-revoke all privileges on *.* from mysqltest_1@localhost;
---enable_warnings
-
-grant select,alter on mysqltest_1.* to mysqltest_1@localhost;
-
-connect (conn1,localhost,mysqltest_1,,mysqltest_1);
-show grants for current_user;
-alter table t1 add b int;
---error ER_TABLEACCESS_DENIED_ERROR
-alter table t1 drop partition p2;
-disconnect conn1;
-
-connection default;
-grant drop on mysqltest_1.* to mysqltest_1@localhost;
-
-connect (conn2,localhost,mysqltest_1,,mysqltest_1);
-alter table t1 drop partition p2;
-disconnect conn2;
-
-connection default;
-revoke alter on mysqltest_1.* from mysqltest_1@localhost;
-
-connect (conn3,localhost,mysqltest_1,,mysqltest_1);
---error ER_TABLEACCESS_DENIED_ERROR
-alter table t1 drop partition p3;
-disconnect conn3;
-
-connection default;
-
-revoke select,alter,drop on mysqltest_1.* from mysqltest_1@localhost;
-drop user mysqltest_1@localhost;
-drop table t1;
-drop schema mysqltest_1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
---echo End of 5.1 tests
diff --git a/mysql-test/suite/pbxt/t/partition_hash.test b/mysql-test/suite/pbxt/t/partition_hash.test
deleted file mode 100644
index 087443fda59..00000000000
--- a/mysql-test/suite/pbxt/t/partition_hash.test
+++ /dev/null
@@ -1,149 +0,0 @@
-#--disable_abort_on_error
-#
-# Simple test for the partition storage engine
-# Taken fromm the select test
-#
--- source include/have_partition.inc
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-#
-# More partition pruning tests, especially on interval walking
-#
-create table t1 (a int unsigned)
-partition by hash(a div 2)
-partitions 4;
-insert into t1 values (null),(0),(1),(2),(3),(4),(5),(6),(7);
-select * from t1 where a < 0;
-select * from t1 where a is null or (a >= 5 and a <= 7);
-select * from t1 where a is null;
-select * from t1 where a is not null;
-select * from t1 where a >= 1 and a < 3;
-select * from t1 where a >= 3 and a <= 5;
-select * from t1 where a > 2 and a < 4;
-select * from t1 where a > 3 and a <= 6;
-select * from t1 where a > 5;
-select * from t1 where a >= 1 and a <= 5;
-explain partitions select * from t1 where a < 0;
-explain partitions select * from t1 where a is null or (a >= 5 and a <= 7);
-explain partitions select * from t1 where a is null;
-explain partitions select * from t1 where a is not null;
-explain partitions select * from t1 where a >= 1 and a < 3;
-explain partitions select * from t1 where a >= 3 and a <= 5;
-explain partitions select * from t1 where a > 2 and a < 4;
-explain partitions select * from t1 where a > 3 and a <= 6;
-explain partitions select * from t1 where a > 5;
-explain partitions select * from t1 where a >= 1 and a <= 5;
-
-drop table t1;
-
-#
-# Partition by hash, basic
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by hash (a + 2)
-partitions 3
-(partition x1 tablespace ts1,
- partition x2 tablespace ts2,
- partition x3 tablespace ts3);
-
-insert into t1 values (1,1,1);
-insert into t1 values (2,1,1);
-insert into t1 values (3,1,1);
-insert into t1 values (4,1,1);
-insert into t1 values (5,1,1);
-
-select * from t1;
-
-update t1 set c=3 where b=1;
-select * from t1;
-
-select b from t1 where a=3;
-select b,c from t1 where a=1 AND b=1;
-
-delete from t1 where a=1;
-delete from t1 where c=3;
-
-select * from t1;
-
-ALTER TABLE t1
-partition by hash (a + 3)
-partitions 3
-(partition x1 tablespace ts1,
- partition x2 tablespace ts2,
- partition x3 tablespace ts3);
-select * from t1;
-drop table t1;
-
-#
-# Partition by hash, only one partition
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by hash (a)
-(partition x1);
-
-drop table t1;
-#
-# Partition by key, only one partition
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by key (a)
-(partition x1);
-
-drop table t1;
-
-#
-# Bug# 15968 - crash when INSERT with f1 = -1 into partition by hash(f1)
-#
-CREATE TABLE t1 (f1 INTEGER, f2 char(20)) ENGINE = 'MYISAM' PARTITION BY HASH(f1) PARTITIONS 2;
-INSERT INTO t1 SET f1 = 0 - 1, f2 = '#######';
-select * from t1;
-drop table t1;
-
-#
-# BUG# 14524 Partitions: crash if blackhole
-#
-# Disable warnings to allow this test case to run without
-# the Blackhole storage engine.
---disable_warnings
-CREATE TABLE t1 (s1 int) ENGINE=BLACKHOLE PARTITION BY HASH (s1);
---enable_warnings
---error 0,ER_BINLOG_LOGGING_IMPOSSIBLE
-INSERT INTO t1 VALUES (0);
-DROP TABLE t1;
-
-#
-# BUG 18423 Hash partitioning can lose rows in some queries
-#
-create table t1 (c1 int DEFAULT NULL,
- c2 varchar (30) DEFAULT NULL,
- c3 date DEFAULT NULL)
-engine = myisam
-partition by hash (to_days(c3))
-partitions 12;
-
-insert into t1 values
-(136,'abc','2002-01-05'),(142,'abc','2002-02-14'),(162,'abc','2002-06-28'),
-(182,'abc','2002-11-09'),(158,'abc','2002-06-01'),(184,'abc','2002-11-22');
-select * from t1;
-select * from t1 where c3 between '2002-01-01' and '2002-12-31';
-
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/partition_list.test b/mysql-test/suite/pbxt/t/partition_list.test
deleted file mode 100644
index 7059a7c1931..00000000000
--- a/mysql-test/suite/pbxt/t/partition_list.test
+++ /dev/null
@@ -1,185 +0,0 @@
-#--disable_abort_on_error
-#
-# Simple test for the partition storage engine
-# testing list partitioning
-#
--- source include/have_partition.inc
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-#
-# Bug 20733: Zerofill columns gives wrong result with partitioned tables
-#
-create table t1 (a int unsigned)
-partition by list (a)
-(partition p0 values in (0),
- partition p1 values in (1),
- partition pnull values in (null),
- partition p2 values in (2));
-
-insert into t1 values (null),(0),(1),(2);
-select * from t1 where a < 2;
-select * from t1 where a <= 0;
-select * from t1 where a < 1;
-select * from t1 where a > 0;
-select * from t1 where a > 1;
-select * from t1 where a >= 0;
-select * from t1 where a >= 1;
-select * from t1 where a is null;
-select * from t1 where a is not null;
-select * from t1 where a is null or a > 0;
-drop table t1;
-
-create table t1 (a int unsigned, b int)
-partition by list (a)
-subpartition by hash (b)
-subpartitions 2
-(partition p0 values in (0),
- partition p1 values in (1),
- partition pnull values in (null, 2),
- partition p3 values in (3));
-insert into t1 values (0,0),(0,1),(1,0),(1,1),(null,0),(null,1);
-insert into t1 values (2,0),(2,1),(3,0),(3,1);
-
-explain partitions select * from t1 where a is null;
-select * from t1 where a is null;
-explain partitions select * from t1 where a = 2;
-select * from t1 where a = 2;
-select * from t1 where a <= 0;
-select * from t1 where a < 3;
-select * from t1 where a >= 1 or a is null;
-drop table t1;
-
-#
-# Test ordinary list partitioning that it works ok
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null)
-partition by list(a)
-partitions 2
-(partition x123 values in (1,5,6),
- partition x234 values in (4,7,8));
-
-INSERT into t1 VALUES (1,1,1);
---error ER_NO_PARTITION_FOR_GIVEN_VALUE
-INSERT into t1 VALUES (2,1,1);
---error ER_NO_PARTITION_FOR_GIVEN_VALUE
-INSERT into t1 VALUES (3,1,1);
-INSERT into t1 VALUES (4,1,1);
-INSERT into t1 VALUES (5,1,1);
-INSERT into t1 VALUES (6,1,1);
-INSERT into t1 VALUES (7,1,1);
-INSERT into t1 VALUES (8,1,1);
---error ER_NO_PARTITION_FOR_GIVEN_VALUE
-INSERT into t1 VALUES (9,1,1);
-INSERT into t1 VALUES (1,2,1);
-INSERT into t1 VALUES (1,3,1);
-INSERT into t1 VALUES (1,4,1);
-INSERT into t1 VALUES (7,2,1);
-INSERT into t1 VALUES (7,3,1);
-INSERT into t1 VALUES (7,4,1);
-
-SELECT * from t1;
-SELECT * from t1 WHERE a=1;
-SELECT * from t1 WHERE a=7;
-SELECT * from t1 WHERE b=2;
-
-UPDATE t1 SET a=8 WHERE a=7 AND b=3;
-SELECT * from t1 order by a, b; # PBXT: required for consistent result
-UPDATE t1 SET a=8 WHERE a=5 AND b=1;
-SELECT * from t1 order by a, b; # PBXT: required for consistent result
-
-DELETE from t1 WHERE a=8;
-SELECT * from t1 order by a, b; # PBXT: required for consistent result
-DELETE from t1 WHERE a=2;
-SELECT * from t1 order by a, b; # PBXT: required for consistent result
-DELETE from t1 WHERE a=5 OR a=6;
-SELECT * from t1 order by a, b; # PBXT: required for consistent result
-
-ALTER TABLE t1
-partition by list(a)
-partitions 2
-(partition x123 values in (1,5,6),
- partition x234 values in (4,7,8));
-SELECT * from t1;
-INSERT into t1 VALUES (6,2,1);
---error ER_NO_PARTITION_FOR_GIVEN_VALUE
-INSERT into t1 VALUES (2,2,1);
-
-drop table t1;
-#
-# Subpartition by hash, two partitions and two subpartitions
-# Defined node group
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by list (a)
-subpartition by hash (a+b)
-( partition x1 values in (1,2,3)
- ( subpartition x11 nodegroup 0,
- subpartition x12 nodegroup 1),
- partition x2 values in (4,5,6)
- ( subpartition x21 nodegroup 0,
- subpartition x22 nodegroup 1)
-);
-
-INSERT into t1 VALUES (1,1,1);
-INSERT into t1 VALUES (4,1,1);
---error ER_NO_PARTITION_FOR_GIVEN_VALUE
-INSERT into t1 VALUES (7,1,1);
-UPDATE t1 SET a=5 WHERE a=1;
-SELECT * from t1;
-UPDATE t1 SET a=6 WHERE a=4;
-SELECT * from t1;
-DELETE from t1 WHERE a=6;
-SELECT * from t1;
-
-drop table t1;
-
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by list (a)
-(partition x1 values in (1,2,9,4) tablespace ts1);
-
-drop table t1;
-
-#
-#Bug #17173 Partitions: less-than search fails
-#
-CREATE TABLE t1 (s1 int) PARTITION BY LIST (s1)
-(PARTITION p1 VALUES IN (1),
-PARTITION p2 VALUES IN (2),
-PARTITION p3 VALUES IN (3),
-PARTITION p4 VALUES IN (4),
-PARTITION p5 VALUES IN (5));
-INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
-SELECT COUNT(*) FROM t1 WHERE s1 < 3;
-DROP TABLE t1;
-
-#
-# Bug 19281 Partitions: Auto-increment value lost
-#
-create table t1 (a int auto_increment primary key)
-auto_increment=100
-partition by list (a)
-(partition p0 values in (1, 100));
-create index inx on t1 (a);
-insert into t1 values (null);
-select * from t1;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-
diff --git a/mysql-test/suite/pbxt/t/partition_order.test b/mysql-test/suite/pbxt/t/partition_order.test
deleted file mode 100644
index 857b1fe33e7..00000000000
--- a/mysql-test/suite/pbxt/t/partition_order.test
+++ /dev/null
@@ -1,848 +0,0 @@
-#--disable_abort_on_error
-#
-# Simple test for the partition storage engine
-# Focuses on tests of ordered index read
-#
--- source include/have_partition.inc
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-#
-# Ordered index read, int type
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, 1);
-INSERT into t1 values (2, 5);
-INSERT into t1 values (30, 4);
-INSERT into t1 values (35, 2);
-
-select * from t1 order by b;
-
-select * from t1 force index (b) where b > 0 order by b;
-
-drop table t1;
-
-#
-# Ordered index read, unsigned int type
-#
-CREATE TABLE t1 (
-a int not null,
-b int unsigned not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, 1);
-INSERT into t1 values (2, 5);
-INSERT into t1 values (30, 4);
-INSERT into t1 values (35, 2);
-
-select * from t1 force index (b) where b > 0 order by b;
-
-drop table t1;
-
-#
-# Ordered index read, tiny int type
-#
-CREATE TABLE t1 (
-a int not null,
-b tinyint not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, 1);
-INSERT into t1 values (2, 5);
-INSERT into t1 values (30, 4);
-INSERT into t1 values (35, 2);
-
-select * from t1 force index (b) where b > 0 order by b;
-
-drop table t1;
-
-#
-# Ordered index read, unsigned tinyint type
-#
-CREATE TABLE t1 (
-a int not null,
-b tinyint unsigned not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, 1);
-INSERT into t1 values (2, 5);
-INSERT into t1 values (30, 4);
-INSERT into t1 values (35, 2);
-
-select * from t1 force index (b) where b > 0 order by b;
-
-drop table t1;
-
-#
-# Ordered index read, smallint type
-#
-CREATE TABLE t1 (
-a int not null,
-b smallint not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, 1);
-INSERT into t1 values (2, 5);
-INSERT into t1 values (30, 4);
-INSERT into t1 values (35, 2);
-
-select * from t1 force index (b) where b > 0 order by b;
-
-drop table t1;
-
-#
-# Ordered index read, unsigned smallint type
-#
-CREATE TABLE t1 (
-a int not null,
-b smallint unsigned not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, 1);
-INSERT into t1 values (2, 5);
-INSERT into t1 values (30, 4);
-INSERT into t1 values (35, 2);
-
-select * from t1 force index (b) where b > 0 order by b;
-
-drop table t1;
-#
-# Ordered index read, mediumint type
-#
-CREATE TABLE t1 (
-a int not null,
-b mediumint not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, 1);
-INSERT into t1 values (2, 5);
-INSERT into t1 values (30, 4);
-INSERT into t1 values (35, 2);
-
-select * from t1 force index (b) where b > 0 order by b;
-
-drop table t1;
-
-#
-# Ordered index read, unsigned int type
-#
-CREATE TABLE t1 (
-a int not null,
-b mediumint unsigned not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, 1);
-INSERT into t1 values (2, 5);
-INSERT into t1 values (30, 4);
-INSERT into t1 values (35, 2);
-
-select * from t1 force index (b) where b > 0 order by b;
-
-drop table t1;
-
-#
-# Ordered index read, unsigned bigint type
-#
-CREATE TABLE t1 (
-a int not null,
-b bigint unsigned not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, 1);
-INSERT into t1 values (2, 5);
-INSERT into t1 values (30, 4);
-INSERT into t1 values (35, 2);
-
-select * from t1 force index (b) where b > 0 order by b;
-
-drop table t1;
-
-#
-# Ordered index read, bigint type
-#
-CREATE TABLE t1 (
-a int not null,
-b bigint not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, 1);
-INSERT into t1 values (2, 5);
-INSERT into t1 values (30, 4);
-INSERT into t1 values (35, 2);
-
-select * from t1 force index (b) where b > 0 order by b;
-
-drop table t1;
-#
-# Ordered index read, bigint type
-#
-CREATE TABLE t1 (
-a int not null,
-b bigint not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, 1);
-INSERT into t1 values (2, 5);
-INSERT into t1 values (30, 4);
-INSERT into t1 values (35, 2);
-
-select * from t1 force index (b) where b > 0 order by b;
-
-drop table t1;
-
-#
-# Ordered index read, float type
-#
-CREATE TABLE t1 (
-a int not null,
-b float not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, 1);
-INSERT into t1 values (2, 5);
-INSERT into t1 values (30, 4);
-INSERT into t1 values (35, 2);
-
-select * from t1 force index (b) where b > 0 order by b;
-
-drop table t1;
-
-#
-# Ordered index read, double type
-#
-CREATE TABLE t1 (
-a int not null,
-b double not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, 1);
-INSERT into t1 values (2, 5);
-INSERT into t1 values (30, 4);
-INSERT into t1 values (35, 2);
-
-select * from t1 force index (b) where b > 0 order by b;
-
-drop table t1;
-
-#
-# Ordered index read, unsigned double type
-#
-CREATE TABLE t1 (
-a int not null,
-b double unsigned not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, 1);
-INSERT into t1 values (2, 5);
-INSERT into t1 values (30, 4);
-INSERT into t1 values (35, 2);
-
-select * from t1 force index (b) where b > 0 order by b;
-
-drop table t1;
-
-#
-# Ordered index read, unsigned float type
-#
-CREATE TABLE t1 (
-a int not null,
-b float unsigned not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, 1);
-INSERT into t1 values (2, 5);
-INSERT into t1 values (30, 4);
-INSERT into t1 values (35, 2);
-
-select * from t1 force index (b) where b > 0 order by b;
-
-drop table t1;
-
-#
-# Ordered index read, double precision type
-#
-CREATE TABLE t1 (
-a int not null,
-b double precision not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, 1);
-INSERT into t1 values (2, 5);
-INSERT into t1 values (30, 4);
-INSERT into t1 values (35, 2);
-
-select * from t1 force index (b) where b > 0 order by b;
-
-drop table t1;
-#
-# Ordered index read, unsigned double precision type
-#
-CREATE TABLE t1 (
-a int not null,
-b double precision unsigned not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, 1);
-INSERT into t1 values (2, 5);
-INSERT into t1 values (30, 4);
-INSERT into t1 values (35, 2);
-
-select * from t1 force index (b) where b > 0 order by b;
-
-drop table t1;
-
-#
-# Ordered index read, decimal type
-#
-CREATE TABLE t1 (
-a int not null,
-b decimal not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, 1);
-INSERT into t1 values (2, 5);
-INSERT into t1 values (30, 4);
-INSERT into t1 values (35, 2);
-
-select * from t1 force index (b) where b > 0 order by b;
-
-drop table t1;
-#
-# Ordered index read, char type
-#
-CREATE TABLE t1 (
-a int not null,
-b char(10) not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, '1');
-INSERT into t1 values (2, '5');
-INSERT into t1 values (30, '4');
-INSERT into t1 values (35, '2');
-
-select * from t1 force index (b) where b > 0 order by b;
-
-drop table t1;
-
-#
-# Ordered index read, varchar type
-#
-CREATE TABLE t1 (
-a int not null,
-b varchar(10) not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, '1');
-INSERT into t1 values (2, '5');
-INSERT into t1 values (30, '4');
-INSERT into t1 values (35, '2');
-
-select * from t1 force index (b) where b > '0' order by b;
-
-drop table t1;
-#
-# Ordered index read, varchar type limited index size
-#
-CREATE TABLE t1 (
-a int not null,
-b varchar(10) not null,
-primary key(a),
-index (b(5)))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, '1');
-INSERT into t1 values (2, '5');
-INSERT into t1 values (30, '4');
-INSERT into t1 values (35, '2');
-
-select * from t1 force index (b) where b > '0' order by b;
-
-drop table t1;
-
-#
-# Ordered index read, varchar binary type
-#
-CREATE TABLE t1 (
-a int not null,
-b varchar(10) binary not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, '1');
-INSERT into t1 values (2, '5');
-INSERT into t1 values (30, '4');
-INSERT into t1 values (35, '2');
-
-select * from t1 force index (b) where b > '0' order by b;
-
-drop table t1;
-
-#
-# Ordered index read, tinytext type
-#
-CREATE TABLE t1 (
-a int not null,
-b tinytext not null,
-primary key(a),
-index (b(10)))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, '1');
-INSERT into t1 values (2, '5');
-INSERT into t1 values (30, '4');
-INSERT into t1 values (35, '2');
-
-select * from t1 force index (b) where b > '0' order by b;
-
-drop table t1;
-#
-# Ordered index read, text type
-#
-CREATE TABLE t1 (
-a int not null,
-b text not null,
-primary key(a),
-index (b(10)))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, '1');
-INSERT into t1 values (2, '5');
-INSERT into t1 values (30, '4');
-INSERT into t1 values (35, '2');
-
-select * from t1 force index (b) where b > '0' order by b;
-
-drop table t1;
-
-#
-# Ordered index read, mediumtext type
-#
-CREATE TABLE t1 (
-a int not null,
-b mediumtext not null,
-primary key(a),
-index (b(10)))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, '1');
-INSERT into t1 values (2, '5');
-INSERT into t1 values (30, '4');
-INSERT into t1 values (35, '2');
-
-select * from t1 force index (b) where b > '0' order by b;
-
-drop table t1;
-#
-# Ordered index read, longtext type
-#
-CREATE TABLE t1 (
-a int not null,
-b longtext not null,
-primary key(a),
-index (b(10)))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, '1');
-INSERT into t1 values (2, '5');
-INSERT into t1 values (30, '4');
-INSERT into t1 values (35, '2');
-
-select * from t1 force index (b) where b > '0' order by b;
-
-drop table t1;
-#
-# Ordered index read, enum type
-#
-CREATE TABLE t1 (
-a int not null,
-b enum('1','2', '4', '5') not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, '1');
-INSERT into t1 values (2, '5');
-INSERT into t1 values (30, '4');
-INSERT into t1 values (35, '2');
-
-select * from t1 force index (b) where b >= '1' order by b;
-
-drop table t1;
-#
-# Ordered index read, set type
-#
-CREATE TABLE t1 (
-a int not null,
-b set('1','2', '4', '5') not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, '1');
-INSERT into t1 values (2, '5');
-INSERT into t1 values (30, '4');
-INSERT into t1 values (35, '2');
-
-select * from t1 force index (b) where b >= '1' order by b;
-
-drop table t1;
-#
-# Ordered index read, date type
-#
-CREATE TABLE t1 (
-a int not null,
-b date not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, '2001-01-01');
-INSERT into t1 values (2, '2005-01-01');
-INSERT into t1 values (30, '2004-01-01');
-INSERT into t1 values (35, '2002-01-01');
-
-select * from t1 force index (b) where b > '2000-01-01' order by b;
-
-drop table t1;
-#
-# Ordered index read, datetime type
-#
-CREATE TABLE t1 (
-a int not null,
-b datetime not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, '2001-01-01 00:00:00');
-INSERT into t1 values (2, '2005-01-01 00:00:00');
-INSERT into t1 values (30, '2004-01-01 00:00:00');
-INSERT into t1 values (35, '2002-01-01 00:00:00');
-
-select * from t1 force index (b) where b > '2000-01-01 00:00:00' order by b;
-
-drop table t1;
-#
-# Ordered index read, timestamp type
-#
-CREATE TABLE t1 (
-a int not null,
-b timestamp not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, '2001-01-01 00:00:00');
-INSERT into t1 values (2, '2005-01-01 00:00:00');
-INSERT into t1 values (30, '2004-01-01 00:00:00');
-INSERT into t1 values (35, '2002-01-01 00:00:00');
-
-select * from t1 force index (b) where b > '2000-01-01 00:00:00' order by b;
-
-drop table t1;
-#
-# Ordered index read, time type
-#
-CREATE TABLE t1 (
-a int not null,
-b time not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, '01:00:00');
-INSERT into t1 values (2, '05:00:00');
-INSERT into t1 values (30, '04:00:00');
-INSERT into t1 values (35, '02:00:00');
-
-select * from t1 force index (b) where b > '00:00:00' order by b;
-
-drop table t1;
-#
-# Ordered index read, year type
-#
-CREATE TABLE t1 (
-a int not null,
-b year not null,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, 2001);
-INSERT into t1 values (2, 2005);
-INSERT into t1 values (30, 2004);
-INSERT into t1 values (35, 2002);
-
-select * from t1 force index (b) where b > 2000 order by b;
-
-drop table t1;
-#
-# Ordered index read, bit(5) type
-#
-CREATE TABLE t1 (
-a int not null,
-b bit(5) not null,
-c int,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, b'00001', NULL);
-INSERT into t1 values (2, b'00101', 2);
-INSERT into t1 values (30, b'00100', 2);
-INSERT into t1 values (35, b'00010', NULL);
-
-select a from t1 force index (b) where b > b'00000' order by b;
-
-drop table t1;
-#
-# Ordered index read, bit(15) type
-#
-CREATE TABLE t1 (
-a int not null,
-b bit(15) not null,
-c int,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, b'000000000000001', NULL);
-INSERT into t1 values (2, b'001010000000101', 2);
-INSERT into t1 values (30, b'001000000000100', 2);
-INSERT into t1 values (35, b'000100000000010', NULL);
-
-select a from t1 force index (b) where b > b'000000000000000' order by b;
-
-drop table t1;
-
-#
-# Ordered index read, NULL values
-#
-CREATE TABLE t1 (
-a int not null,
-b int,
-primary key(a),
-index (b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (25),
- partition x2 values less than (100));
-
-# Insert a couple of tuples
-INSERT into t1 values (1, 1);
-INSERT into t1 values (5, NULL);
-INSERT into t1 values (2, 4);
-INSERT into t1 values (3, 3);
-INSERT into t1 values (4, 5);
-INSERT into t1 values (7, 1);
-INSERT into t1 values (6, 6);
-INSERT into t1 values (30, 4);
-INSERT into t1 values (35, 2);
-INSERT into t1 values (40, NULL);
-
-select * from t1 force index (b) where b < 10 OR b IS NULL order by b;
-select * from t1 force index (b) where b < 10 ORDER BY b;
-select * from t1 force index (b) where b < 10 ORDER BY b DESC;
-drop table t1;
-
-create table t1 (a int not null, b int, c varchar(20), key (a,b,c))
-partition by range (b)
-(partition p0 values less than (5),
- partition p1 values less than (10));
-INSERT into t1 values (1,1,'1'),(2,2,'2'),(1,3,'3'),(2,4,'4'),(1,5,'5');
-INSERT into t1 values (2,6,'6'),(1,7,'7'),(2,8,'8'),(1,9,'9');
-INSERT into t1 values (1, NULL, NULL), (2, NULL, '10');
-select * from t1 where a = 1 order by a desc, b desc;
-select * from t1 where a = 1 order by b desc;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/partition_pruning.test b/mysql-test/suite/pbxt/t/partition_pruning.test
deleted file mode 100644
index ad8660e58f7..00000000000
--- a/mysql-test/suite/pbxt/t/partition_pruning.test
+++ /dev/null
@@ -1,762 +0,0 @@
-#
-# Partition pruning tests. Currently we only detect which partitions to
-# prune, so the test is EXPLAINs.
-#
--- source include/have_partition.inc
-
---disable_warnings
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
---enable_warnings
-
-
-# Check if we can infer from condition on partition fields that
-# no records will match.
-create table t1 ( a int not null) partition by hash(a) partitions 2;
-insert into t1 values (1),(2),(3);
-explain select * from t1 where a=5 and a=6;
-drop table t1;
-
-# Simple HASH partitioning
-create table t1 (
- a int(11) not null
-) partition by hash (a) partitions 2;
-insert into t1 values (1),(2),(3);
-
-explain partitions select * from t1 where a=1;
-explain partitions select * from t1 where a=2;
-explain partitions select * from t1 where a=1 or a=2;
-
-# Partitioning over several fields
-create table t2 (
- a int not null,
- b int not null
-) partition by key(a,b) partitions 2;
-insert into t2 values (1,1),(2,2),(3,3);
-
-explain partitions select * from t2 where a=1;
-explain partitions select * from t2 where b=1;
-
-explain partitions select * from t2 where a=1 and b=1;
-
-# RANGE(expr) partitioning
-create table t3 (
- a int
-)
-partition by range (a*1) (
- partition p0 values less than (10),
- partition p1 values less than (20)
-);
-insert into t3 values (5),(15);
-
-explain partitions select * from t3 where a=11;
-explain partitions select * from t3 where a=10;
-explain partitions select * from t3 where a=20;
-
-explain partitions select * from t3 where a=30;
-
-# LIST(expr) partitioning
-create table t4 (a int not null, b int not null) partition by LIST (a+b) (
- partition p0 values in (12),
- partition p1 values in (14)
-);
-insert into t4 values (10,2), (10,4);
-
-# empty OR one
-explain partitions select * from t4 where (a=10 and b=1) or (a=10 and b=2);
-
-# empty OR one OR empty
-explain partitions select * from t4
- where (a=10 and b=1) or (a=10 and b=2) or (a=10 and b = 3);
-
-# one OR empty OR one
-explain partitions select * from t4 where (a=10 and b=2) or (a=10 and b=3)
- or (a=10 and b = 4);
-
-# empty OR full
-explain partitions select * from t4 where (a=10 and b=1) or a=11;
-
-# one OR full
-explain partitions select * from t4 where (a=10 and b=2) or a=11;
-
-drop table t1, t2, t3, t4;
-
-# LIST(expr)/HASH subpartitioning.
-create table t5 (a int not null, b int not null,
- c int not null, d int not null)
-partition by LIST(a+b) subpartition by HASH (c+d) subpartitions 2
-(
- partition p0 values in (12),
- partition p1 values in (14)
-);
-
-insert into t5 values (10,2,0,0), (10,4,0,0), (10,2,0,1), (10,4,0,1);
-explain partitions select * from t5;
-
-# empty OR one OR empty
-explain partitions select * from t5
- where (a=10 and b=1) or (a=10 and b=2) or (a=10 and b = 3);
-
-# one OR empty OR one
-explain partitions select * from t5 where (a=10 and b=2) or (a=10 and b=3)
- or (a=10 and b = 4);
-
-# conditions on subpartitions only
-explain partitions select * from t5 where (c=1 and d=1);
-explain partitions select * from t5 where (c=2 and d=1);
-
-# mixed partition/subpartitions.
-explain partitions select * from t5 where (a=10 and b=2 and c=1 and d=1) or
-(c=2 and d=1);
-
-# same as above
-explain partitions select * from t5 where (a=10 and b=2 and c=1 and d=1) or
-(b=2 and c=2 and d=1);
-
-# LIST(field) partitioning, interval analysis.
-create table t6 (a int not null) partition by LIST(a) (
- partition p1 values in (1),
- partition p3 values in (3),
- partition p5 values in (5),
- partition p7 values in (7),
- partition p9 values in (9)
-);
-insert into t6 values (1),(3),(5);
-
-explain partitions select * from t6 where a < 1;
-explain partitions select * from t6 where a <= 1;
-explain partitions select * from t6 where a > 9;
-explain partitions select * from t6 where a >= 9;
-
-explain partitions select * from t6 where a > 0 and a < 5;
-explain partitions select * from t6 where a > 5 and a < 12;
-explain partitions select * from t6 where a > 3 and a < 8 ;
-
-explain partitions select * from t6 where a >= 0 and a <= 5;
-explain partitions select * from t6 where a >= 5 and a <= 12;
-explain partitions select * from t6 where a >= 3 and a <= 8;
-
-explain partitions select * from t6 where a > 3 and a < 5;
-
-drop table t6;
-
-create table t6 (a int unsigned not null) partition by LIST(a) (
- partition p1 values in (1),
- partition p3 values in (3),
- partition p5 values in (5),
- partition p7 values in (7),
- partition p9 values in (9)
-);
-insert into t6 values (1),(3),(5);
-
-explain partitions select * from t6 where a < 1;
-explain partitions select * from t6 where a <= 1;
-explain partitions select * from t6 where a > 9;
-explain partitions select * from t6 where a >= 9;
-
-explain partitions select * from t6 where a > 0 and a < 5;
-explain partitions select * from t6 where a > 5 and a < 12;
-explain partitions select * from t6 where a > 3 and a < 8 ;
-
-explain partitions select * from t6 where a >= 0 and a <= 5;
-explain partitions select * from t6 where a >= 5 and a <= 12;
-explain partitions select * from t6 where a >= 3 and a <= 8;
-
-explain partitions select * from t6 where a > 3 and a < 5;
-
-# RANGE(field) partitioning, interval analysis.
-create table t7 (a int not null) partition by RANGE(a) (
- partition p10 values less than (10),
- partition p30 values less than (30),
- partition p50 values less than (50),
- partition p70 values less than (70),
- partition p90 values less than (90)
-);
-insert into t7 values (10),(30),(50);
-
-# leftmost intervals
-explain partitions select * from t7 where a < 5;
-explain partitions select * from t7 where a < 10;
-explain partitions select * from t7 where a <= 10;
-explain partitions select * from t7 where a = 10;
-
-#rightmost intervals
-explain partitions select * from t7 where a < 90;
-explain partitions select * from t7 where a = 90;
-explain partitions select * from t7 where a > 90;
-explain partitions select * from t7 where a >= 90;
-
-# misc intervals
-explain partitions select * from t7 where a > 11 and a < 29;
-
-drop table t7;
-
-create table t7 (a int unsigned not null) partition by RANGE(a) (
- partition p10 values less than (10),
- partition p30 values less than (30),
- partition p50 values less than (50),
- partition p70 values less than (70),
- partition p90 values less than (90)
-);
-insert into t7 values (10),(30),(50);
-
-# leftmost intervals
-explain partitions select * from t7 where a < 5;
-explain partitions select * from t7 where a < 10;
-explain partitions select * from t7 where a <= 10;
-explain partitions select * from t7 where a = 10;
-
-#rightmost intervals
-explain partitions select * from t7 where a < 90;
-explain partitions select * from t7 where a = 90;
-explain partitions select * from t7 where a > 90;
-explain partitions select * from t7 where a >= 90;
-
-# misc intervals
-explain partitions select * from t7 where a > 11 and a < 29;
-
-# LIST(monontonic_func) partitioning
-create table t8 (a date not null) partition by RANGE(YEAR(a)) (
- partition p0 values less than (1980),
- partition p1 values less than (1990),
- partition p2 values less than (2000)
-);
-insert into t8 values ('1985-05-05'),('1995-05-05');
-
-explain partitions select * from t8 where a < '1980-02-02';
-
-# LIST(strict_monotonic_func) partitioning
-create table t9 (a date not null) partition by RANGE(TO_DAYS(a)) (
- partition p0 values less than (732299), -- 2004-12-19
- partition p1 values less than (732468), -- 2005-06-06
- partition p2 values less than (732664) -- 2005-12-19
-);
-insert into t9 values ('2005-05-05'), ('2005-04-04');
-
-explain partitions select * from t9 where a < '2004-12-19';
-explain partitions select * from t9 where a <= '2004-12-19';
-
-drop table t5,t6,t7,t8,t9;
-
-# Test the case where we can't create partitioning 'index'
-#
-# Not supported after bug#18198 is fixed
-#
-#create table t1 (a enum('a','b','c','d') default 'a')
-# partition by hash (ascii(a)) partitions 2;
-#insert into t1 values ('a'),('b'),('c');
-#explain partitions select * from t1 where a='b';
-#drop table t1;
-
-#
-# Test cases for bugs found in code review:
-#
-create table t1 (
- a1 int not null
-)
-partition by range (a1) (
- partition p0 values less than (3),
- partition p1 values less than (6),
- partition p2 values less than (9)
-);
-insert into t1 values (1),(2),(3);
-explain partitions select * from t1 where a1 > 3;
-explain partitions select * from t1 where a1 >= 3;
-
-explain partitions select * from t1 where a1 < 3 and a1 > 3;
-drop table t1;
-
-#
-create table t3 (a int, b int)
- partition by list(a) subpartition by hash(b) subpartitions 4 (
- partition p0 values in (1),
- partition p1 values in (2),
- partition p2 values in (3),
- partition p3 values in (4)
- );
-insert into t3 values (1,1),(2,2),(3,3);
-
-explain partitions select * from t3 where a=2 or b=1;
-explain partitions select * from t3 where a=4 or b=2;
-explain partitions select * from t3 where (a=2 or b=1) and (a=4 or b=2) ;
-drop table t3;
-
-# Test for NULLs
-create table t1 (a int) partition by hash(a) partitions 2;
-insert into t1 values (1),(2);
-explain partitions select * from t1 where a is null;
-
-# this uses both partitions
-explain partitions select * from t1 where a is not null;
-drop table t1;
-
-# Join tests
-create table t1 (a int not null, b int not null, key(a), key(b))
- partition by hash(a) partitions 4;
-insert into t1 values (1,1),(2,2),(3,3),(4,4);
-
-explain partitions
-select * from t1 X, t1 Y
-where X.b = Y.b and (X.a=1 or X.a=2) and (Y.a=2 or Y.a=3);
-
-explain partitions
-select * from t1 X, t1 Y where X.a = Y.a and (X.a=1 or X.a=2);
-
-drop table t1;
-
-# Tests for "short ranges"
-create table t1 (a int) partition by hash(a) partitions 20;
-insert into t1 values (1),(2),(3);
-explain partitions select * from t1 where a > 1 and a < 3;
-explain partitions select * from t1 where a >= 1 and a < 3;
-explain partitions select * from t1 where a > 1 and a <= 3;
-explain partitions select * from t1 where a >= 1 and a <= 3;
-drop table t1;
-
-create table t1 (a int, b int)
- partition by list(a) subpartition by hash(b) subpartitions 20
-(
- partition p0 values in (0),
- partition p1 values in (1),
- partition p2 values in (2),
- partition p3 values in (3)
-);
-insert into t1 values (1,1),(2,2),(3,3);
-
-explain partitions select * from t1 where b > 1 and b < 3;
-explain partitions select * from t1 where b > 1 and b < 3 and (a =1 or a =2);
-drop table t1;
-
-# Test partition pruning for single-table UPDATE/DELETE.
-# TODO: Currently we test only "all partitions pruned away" case. Add more
-# tests when the patch that makes use of partition pruning results at
-# execution phase is pushed.
-
-create table t1 (a int) partition by list(a) (
- partition p0 values in (1,2),
- partition p1 values in (3,4)
-);
-insert into t1 values (1),(1),(2),(2),(3),(4),(3),(4);
-
-# This won't do any table access
-flush status;
-update t1 set a=100 where a=5;
-show status like 'Handler_read_rnd_next';
-
-# ... as compared to this, which will scan both partitions
-flush status;
-update t1 set a=100 where a+1=5+1;
-show status like 'Handler_read_rnd_next';
-
-# Same as above for DELETE:
-flush status;
-delete from t1 where a=5;
-show status like 'Handler_read_rnd_next';
-
-flush status;
-delete from t1 where a+1=5+1;
-show status like 'Handler_read_rnd_next';
-
-# Same as above multi-table UPDATE/DELETE
-create table t2 like t1;
-insert into t2 select * from t2;
-
-flush status;
-update t1,t2 set t1.a=1000, t2.a=1000 where t1.a=5 and t2.a=5;
-show status like 'Handler_read_rnd_next';
-# ^ This shows 3 accesses, these are caused by const table reads.
-# They should vanish when partition pruning results are used.
-
-flush status;
-delete t1,t2 from t1, t2 where t1.a=5 and t2.a=5;
-show status like 'Handler_read_rnd_next';
-drop table t1,t2;
-
-#
-# WL#2986 Tests (Checking if partition pruning results are used at query
-# execution phase)
-#
-CREATE TABLE `t1` (
- `a` int(11) default NULL
-);
-INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-
-CREATE TABLE `t2` (
- `a` int(11) default NULL,
- KEY `a` (`a`)
-) ;
-
-insert into t2 select A.a + 10*(B.a + 10* C.a) from t1 A, t1 B, t1 C ;
-insert into t1 select a from t2;
-
-drop table t2;
-CREATE TABLE `t2` (
- `a` int(11) default NULL,
- `b` int(11) default NULL
-)
-PARTITION BY RANGE (a) (
-PARTITION p0 VALUES LESS THAN (200),
-PARTITION p1 VALUES LESS THAN (400),
-PARTITION p2 VALUES LESS THAN (600),
-PARTITION p3 VALUES LESS THAN (800),
-PARTITION p4 VALUES LESS THAN (1001));
-
-insert into t2 select a,1 from t1 where a < 200;
-insert into t2 select a,2 from t1 where a >= 200 and a < 400;
-insert into t2 select a,3 from t1 where a >= 400 and a < 600;
-insert into t2 select a,4 from t1 where a >= 600 and a < 800;
-insert into t2 select a,5 from t1 where a >= 800 and a < 1001;
-
-explain partitions select * from t2;
-explain partitions select * from t2 where a < 801 and a > 200;
-explain partitions select * from t2 where a < 801 and a > 800;
-explain partitions select * from t2 where a > 600;
-explain partitions select * from t2 where a > 600 and b = 1;
-explain partitions select * from t2 where a > 600 and b = 4;
-explain partitions select * from t2 where a > 600 and b = 5;
-explain partitions select * from t2 where b = 5;
-
-flush status;
-update t2 set b = 100 where b = 6;
-show status like 'Handler_read_rnd_next';
-flush status;
-update t2 set a = 1002 where a = 1001;
-show status like 'Handler_read_rnd_next';
-flush status;
-update t2 set b = 6 where a = 600;
-show status like 'Handler_read_rnd_next';
-flush status;
-update t2 set b = 6 where a > 600 and a < 800;
-show status like 'Handler_read_rnd_next';
-flush status;
-delete from t2 where a > 600;
-show status like 'Handler_read_rnd_next';
-
-drop table t2;
-CREATE TABLE `t2` (
- `a` int(11) default NULL,
- `b` int(11) default NULL,
- index (b)
-)
-PARTITION BY RANGE (a) (
-PARTITION p0 VALUES LESS THAN (200),
-PARTITION p1 VALUES LESS THAN (400),
-PARTITION p2 VALUES LESS THAN (600),
-PARTITION p3 VALUES LESS THAN (800),
-PARTITION p4 VALUES LESS THAN (1001));
-
-insert into t2 select a,1 from t1 where a < 100;
-insert into t2 select a,2 from t1 where a >= 200 and a < 300;
-insert into t2 select a,3 from t1 where a >= 300 and a < 400;
-insert into t2 select a,4 from t1 where a >= 400 and a < 500;
-insert into t2 select a,5 from t1 where a >= 500 and a < 600;
-insert into t2 select a,6 from t1 where a >= 600 and a < 700;
-insert into t2 select a,7 from t1 where a >= 700 and a < 800;
-insert into t2 select a,8 from t1 where a >= 800 and a < 900;
-insert into t2 select a,9 from t1 where a >= 900 and a < 1001;
-
-explain partitions select * from t2;
-# not using indexes
-explain partitions select * from t2 where a = 101;
-explain partitions select * from t2 where a = 550;
-explain partitions select * from t2 where a = 833;
-explain partitions select * from t2 where (a = 100 OR a = 900);
-explain partitions select * from t2 where (a > 100 AND a < 600);
-# PBXT: wait for sweeper
-analyze table t2;
---replace_column 9 #
-explain partitions select * from t2 where b = 4;
---replace_column 9 #
-explain extended select * from t2 where b = 6;
-explain partitions select * from t2 where b = 6;
-explain extended select * from t2 where b in (1,3,5);
-explain partitions select * from t2 where b in (1,3,5);
-explain extended select * from t2 where b in (2,4,6);
-explain partitions select * from t2 where b in (2,4,6);
-explain extended select * from t2 where b in (7,8,9);
-explain partitions select * from t2 where b in (7,8,9);
-explain extended select * from t2 where b > 5;
-explain partitions select * from t2 where b > 5;
-explain extended select * from t2 where b > 5 and b < 8;
-explain partitions select * from t2 where b > 5 and b < 8;
-explain extended select * from t2 where b > 5 and b < 7;
-explain partitions select * from t2 where b > 5 and b < 7;
-explain extended select * from t2 where b > 0 and b < 5;
-explain partitions select * from t2 where b > 0 and b < 5;
-
-flush status;
-update t2 set a = 111 where b = 10;
-show status like 'Handler_read_rnd_next';
-show status like 'Handler_read_key';
-flush status;
-update t2 set a = 111 where b in (5,6);
-show status like 'Handler_read_rnd_next';
-show status like 'Handler_read_key';
-flush status;
-update t2 set a = 222 where b = 7;
-show status like 'Handler_read_rnd_next';
-show status like 'Handler_read_key';
-flush status;
-delete from t2 where b = 7;
-show status like 'Handler_read_rnd_next';
-show status like 'Handler_read_key';
-flush status;
-delete from t2 where b > 5;
-show status like 'Handler_read_rnd_next';
-show status like 'Handler_read_key';
-show status like 'Handler_read_prev';
-show status like 'Handler_read_next';
-flush status;
-delete from t2 where b < 5 or b > 3;
-show status like 'Handler_read_rnd_next';
-show status like 'Handler_read_key';
-show status like 'Handler_read_prev';
-show status like 'Handler_read_next';
-
-drop table t1, t2;
-
-# BUG#18025
-# part1: mediumint columns
-create table t1 ( f_int1 mediumint, f_int2 integer)
-partition by list(mod(f_int1,4)) (
- partition p_3 values in (-3),
- partition p_2 values in (-2),
- partition p_1 values in (-1),
- partition p0 values in (0),
- partition p1 values in (1),
- partition p2 values in (2),
- partition p3 values in (3)
-);
-
-insert into t1 values (9, 9), (8, 8), (7, 7), (6, 6), (5, 5),
- (4, 4), (3, 3), (2, 2), (1, 1);
-select * from t1 where f_int1 between 5 and 15 order by f_int1;
-
-drop table t1;
-
-# part2: bug in pruning code
-#create table t1 (a char(10) binary)
-#partition by list(ascii(a))
-# (partition p1 values in (ascii('a')),
-# partition p2 values in (ascii('b')),
-# partition p3 values in (ascii('c')),
-# partition p4 values in (ascii('d')),
-# partition p5 values in (ascii('e')));
-#insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee');
-#select * from t1 where a>='a' and a <= 'dddd';
-#explain partitions select * from t1 where a>='a' and a <= 'dddd';
-#drop table t1;
-
-# BUG#18659: Assertion failure when subpartitioning is used and partition is
-# "IS NULL"
-create table t1 (f_int1 integer) partition by list(abs(mod(f_int1,2)))
- subpartition by hash(f_int1) subpartitions 2
-(
- partition part1 values in (0),
- partition part2 values in (1),
- partition part4 values in (null)
-);
-insert into t1 set f_int1 = null;
-
-select * from t1 where f_int1 is null;
-explain partitions select * from t1 where f_int1 is null;
-drop table t1;
-
-#
-# BUG#18558
-#
-create table t1 (a int not null, b int not null)
-partition by list(a)
- subpartition by hash(b) subpartitions 4
-(
- partition p0 values in (1),
- partition p1 values in (2),
- partition p2 values in (3)
-);
-insert into t1 values (1,1),(1,2),(1,3),(1,4),
- (2,1),(2,2),(2,3),(2,4);
-explain partitions select * from t1 where a=1 AND (b=1 OR b=2);
-drop table t1;
-
-create table t1 (a int, b int not null)
-partition by list(a)
- subpartition by hash(b) subpartitions 2
-(
- partition p0 values in (1),
- partition p1 values in (2),
- partition p2 values in (3),
- partition pn values in (NULL)
-);
-insert into t1 values (1,1),(1,2),(1,3),(1,4),
- (2,1),(2,2),(2,3),(2,4), (NULL,1);
-
-explain partitions select * from t1 where a IS NULL AND (b=1 OR b=2);
-
-explain partitions select * from t1 where (a IS NULL or a < 1) AND (b=1 OR b=2);
-explain partitions select * from t1 where (a IS NULL or a < 2) AND (b=1 OR b=2);
-explain partitions select * from t1 where (a IS NULL or a <= 1) AND (b=1 OR b=2);
-
-drop table t1;
-
-create table t1 ( a int) partition by list (MOD(a, 10))
-( partition p0 values in (0), partition p1 values in (1),
- partition p2 values in (2), partition p3 values in (3),
- partition p4 values in (4), partition p5 values in (5),
- partition p6 values in (6), partition pn values in (NULL)
-);
-insert into t1 values (NULL), (0),(1),(2),(3),(4),(5),(6);
-explain partitions select * from t1 where a is null or a < 2;
-drop table t1;
-
-# Testcase from BUG#18751
-create table t1 (s1 int) partition by list (s1)
- (partition p1 values in (0),
- partition p2 values in (1),
- partition p3 values in (null));
-
-insert into t1 values (0),(1),(null);
-
-select count(*) from t1 where s1 < 0 or s1 is null;
-explain partitions select count(*) from t1 where s1 < 0 or s1 is null;
-drop table t1;
-
-# No tests for NULLs in RANGE(monotonic_expr()) - they depend on BUG#15447
-# being fixed.
-
-#
-# BUG#17946 Like searches fail with partitioning
-#
-create table t1 (a char(32) primary key)
-partition by key()
-partitions 100;
-insert into t1 values ('na');
-select * from t1;
-select * from t1 where a like 'n%';
-drop table t1;
-
-
-# BUG#19055 Crashes for varchar_col=NUMBER or varchar_col IS NULL
-create table t1 (s1 varchar(15)) partition by key (s1);
-select * from t1 where s1 = 0 or s1 is null;
-insert into t1 values ('aa'),('bb'),('0');
-explain partitions select * from t1 where s1 = 0 or s1 is null;
-drop table t1;
-
-#
-# BUG#19684: EXPLAIN PARTITIONS produces garbage in 'partitions' column when
-# the length of string to be displayed exceeds some limit.
-create table t2 (a int, b int)
- partition by LIST(a)
- subpartition by HASH(b) subpartitions 40
-( partition p_0_long_partition_name values in(1),
- partition p_1_long_partition_name values in(2));
-
-insert into t2 values (1,1),(2,2);
-
---vertical_results
-explain partitions select * from t2;
---horizontal_results
-drop table t2;
-
-
-# BUG#20484 "Partitions: crash with explain and union"
-create table t1 (s1 int);
-explain partitions select 1 from t1 union all select 2;
-drop table t1;
-
-
-# BUG#20257: partition pruning test coverage for BIGINT UNSIGNED
-create table t1 (a bigint unsigned not null) partition by range(a) (
- partition p0 values less than (10),
- partition p1 values less than (100),
- partition p2 values less than (1000),
- partition p3 values less than (18446744073709551000),
- partition p4 values less than (18446744073709551614)
-);
-insert into t1 values (5),(15),(105),(1005);
-insert into t1 values (18446744073709551000+1);
-insert into t1 values (18446744073709551614-1);
-
-explain partitions select * from t1 where a < 10;
-explain partitions select * from t1
- where a >= 18446744073709551000-1 and a <= 18446744073709551000+1;
-
-explain partitions select * from t1
- where a between 18446744073709551001 and 18446744073709551002;
-
-explain partitions select * from t1 where a = 18446744073709551000;
-explain partitions select * from t1 where a = 18446744073709551613;
-explain partitions select * from t1 where a = 18446744073709551614;
-drop table t1;
-#
-# Test all variants of usage for interval_via_mapping
-# and interval_via_walking
-#
-# t1 will use interval_via_mapping since it uses a
-# monotonic function, whereas t2 will use
-# interval_via_walking since the intervals are short
-# and the function isn't monotonic (it is, but it isn't
-# discovered in this version).
-#
- create table t1 (a int)
- partition by range(a) (
- partition p0 values less than (64),
- partition p1 values less than (128),
- partition p2 values less than (255)
-);
-
-create table t2 (a int)
- partition by range(a+0) (
- partition p0 values less than (64),
- partition p1 values less than (128),
- partition p2 values less than (255)
-);
-
-insert into t1 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE);
-insert into t2 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE);
-explain partitions select * from t1 where a=0;
-explain partitions select * from t2 where a=0;
-explain partitions select * from t1 where a=0xFE;
-explain partitions select * from t2 where a=0xFE;
-explain partitions select * from t1 where a > 0xFE AND a <= 0xFF;
-explain partitions select * from t2 where a > 0xFE AND a <= 0xFF;
-explain partitions select * from t1 where a >= 0xFE AND a <= 0xFF;
-explain partitions select * from t2 where a >= 0xFE AND a <= 0xFF;
-explain partitions select * from t1 where a < 64 AND a >= 63;
-explain partitions select * from t2 where a < 64 AND a >= 63;
-explain partitions select * from t1 where a <= 64 AND a >= 63;
-explain partitions select * from t2 where a <= 64 AND a >= 63;
-drop table t1;
-drop table t2;
-
-create table t1(a bigint unsigned not null) partition by range(a+0) (
- partition p1 values less than (10),
- partition p2 values less than (20),
- partition p3 values less than (2305561538531885056),
- partition p4 values less than (2305561538531950591)
-);
-
-insert into t1 values (9),(19),(0xFFFF0000FFFF000-1), (0xFFFF0000FFFFFFF-1);
-insert into t1 values (9),(19),(0xFFFF0000FFFF000-1), (0xFFFF0000FFFFFFF-1);
-
-explain partitions select * from t1 where
- a >= 2305561538531885056-10 and a <= 2305561538531885056-8;
-
-explain partitions select * from t1 where
- a > 0xFFFFFFFFFFFFFFEC and a < 0xFFFFFFFFFFFFFFEE;
-
-explain partitions select * from t1 where a>=0 and a <= 0xFFFFFFFFFFFFFFFF;
-drop table t1;
-
-create table t1 (a bigint) partition by range(a+0) (
- partition p1 values less than (-1000),
- partition p2 values less than (-10),
- partition p3 values less than (10),
- partition p4 values less than (1000)
-);
-insert into t1 values (-15),(-5),(5),(15),(-15),(-5),(5),(15);
-explain partitions select * from t1 where a>-2 and a <=0;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/partition_range.test b/mysql-test/suite/pbxt/t/partition_range.test
deleted file mode 100644
index ec9e78670d4..00000000000
--- a/mysql-test/suite/pbxt/t/partition_range.test
+++ /dev/null
@@ -1,763 +0,0 @@
-#--disable_abort_on_error
-#
-# Simple test for the partition storage engine
-# Focuses on range partitioning tests
-#
--- source include/have_partition.inc
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-#
-# BUG 18198: Various tests for partition functions
-#
-#create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int)
-#partition by range (ascii(a) * b)
-#(partition p0 values less than (2), partition p1 values less than (4000));
-#insert into t1 values ('a ', 2),('a',3);
-#drop table t1;
-
-#create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int)
-#partition by range (b* ascii(a) * b)
-#(partition p0 values less than (2), partition p1 values less than (4000));
-#insert into t1 values ('a ', 2),('a',3);
-#drop table t1;
-
-#create table t1 (a varchar(10) charset latin1 collate latin1_bin,
-# b varchar(10) charset latin1 collate latin1_bin)
-#partition by range (ascii(b) * ascii(a))
-#(partition p0 values less than (2), partition p1 values less than (40000));
-#insert into t1 values ('a ', 'b '),('a','b');
-#drop table t1;
-
-#create table t1 (a varchar(10) charset latin1 collate latin1_bin,
-# b varchar(10) charset latin1 collate latin1_bin)
-#partition by range (ascii(a) * ascii(b))
-#(partition p0 values less than (2), partition p1 values less than (40000));
-#insert into t1 values ('a ', 'b '),('a','b');
-#drop table t1;
-
-#create table t1 (a varchar(10) charset latin1 collate latin1_bin,
-# b varchar(10) charset latin1 collate latin1_bin, c int)
-#partition by range (ascii(a) * c)
-#(partition p0 values less than (2), partition p1 values less than (4000));
-#insert into t1 values ('a ', 'b ', 2),('a','b', 3);
-#drop table t1;
-
-#create table t1 (a varchar(10) charset latin1 collate latin1_bin,
-# b varchar(10) charset latin1 collate latin1_bin, c int)
-#partition by range (c * ascii(a))
-#(partition p0 values less than (2), partition p1 values less than (4000));
-#insert into t1 values ('a ', 'b ', 2),('a','b', 3);
-#drop table t1;
-
-#
-# More checks for partition pruning
-#
-create table t1 (a int unsigned)
-partition by range (a)
-(partition pnull values less than (0),
- partition p0 values less than (1),
- partition p1 values less than(2));
-insert into t1 values (null),(0),(1);
-
-select * from t1 where a is null;
-select * from t1 where a >= 0;
-select * from t1 where a < 0;
-select * from t1 where a <= 0;
-select * from t1 where a > 1;
-explain partitions select * from t1 where a is null;
-explain partitions select * from t1 where a >= 0;
-explain partitions select * from t1 where a < 0;
-explain partitions select * from t1 where a <= 0;
-explain partitions select * from t1 where a > 1;
-drop table t1;
-
-create table t1 (a int unsigned, b int unsigned)
-partition by range (a)
-subpartition by hash (b)
-subpartitions 2
-(partition pnull values less than (0),
- partition p0 values less than (1),
- partition p1 values less than(2));
-insert into t1 values (null,0),(null,1),(0,0),(0,1),(1,0),(1,1);
-
-select * from t1 where a is null;
-select * from t1 where a >= 0;
-select * from t1 where a < 0;
-select * from t1 where a <= 0;
-select * from t1 where a > 1;
-explain partitions select * from t1 where a is null;
-explain partitions select * from t1 where a >= 0;
-explain partitions select * from t1 where a < 0;
-explain partitions select * from t1 where a <= 0;
-explain partitions select * from t1 where a > 1;
-
-drop table t1;
-
-#
-# Partition by range, basic
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a)
-partitions 3
-(partition x1 values less than (5) tablespace ts1,
- partition x2 values less than (10) tablespace ts2,
- partition x3 values less than maxvalue tablespace ts3);
-
-# Simple insert and verify test
-INSERT into t1 values (1, 1, 1);
-INSERT into t1 values (6, 1, 1);
-INSERT into t1 values (10, 1, 1);
-INSERT into t1 values (15, 1, 1);
-
-select * from t1;
-show create table t1;
-
-ALTER TABLE t1
-partition by range (a)
-partitions 3
-(partition x1 values less than (5) tablespace ts1,
- partition x2 values less than (10) tablespace ts2,
- partition x3 values less than maxvalue tablespace ts3);
-
-select * from t1;
-show create table t1;
-
-drop table if exists t1;
-
-#
-# Partition by range, basic
-# No primary key
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null)
-partition by range (a)
-partitions 3
-(partition x1 values less than (5) tablespace ts1,
- partition x2 values less than (10) tablespace ts2,
- partition x3 values less than maxvalue tablespace ts3);
-
-# Simple insert and verify test
-INSERT into t1 values (1, 1, 1);
-INSERT into t1 values (6, 1, 1);
-INSERT into t1 values (10, 1, 1);
-INSERT into t1 values (15, 1, 1);
-
-select * from t1;
-
-ALTER TABLE t1
-partition by range (a)
-partitions 3
-(partition x1 values less than (5) tablespace ts1,
- partition x2 values less than (10) tablespace ts2,
- partition x3 values less than maxvalue tablespace ts3);
-
-select * from t1;
-
-drop table if exists t1;
-
-#
-# Partition by range, basic
-# No max value used
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a)
-partitions 3
-(partition x1 values less than (5) tablespace ts1,
- partition x2 values less than (10) tablespace ts2,
- partition x3 values less than (15) tablespace ts3);
-
-
-# Simple insert and verify test
-INSERT into t1 values (1, 1, 1);
-INSERT into t1 values (6, 1, 1);
-INSERT into t1 values (10, 1, 1);
---error ER_NO_PARTITION_FOR_GIVEN_VALUE
-INSERT into t1 values (15, 1, 1);
-
-select * from t1;
-
-ALTER TABLE t1
-partition by range (a)
-partitions 3
-(partition x1 values less than (5) tablespace ts1,
- partition x2 values less than (10) tablespace ts2,
- partition x3 values less than (15) tablespace ts3);
-
-select * from t1;
-
-drop table t1;
-
-#
-# Partition by range, only one partition
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a)
-(partition x1 values less than (1));
-
-drop table t1;
-
-#
-# Subpartition by hash, two partitions and two subpartitions
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by range (a)
-subpartition by hash (a+b)
-( partition x1 values less than (1)
- ( subpartition x11,
- subpartition x12),
- partition x2 values less than (5)
- ( subpartition x21,
- subpartition x22)
-);
-
-SELECT * from t1;
-show create table t1;
-
-ALTER TABLE t1 ADD COLUMN d int;
-show create table t1;
-
-drop table t1;
-
-#
-# Subpartition by hash, two partitions and two subpartitions
-# Defined tablespace, engine and node group
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by range (a)
-subpartition by hash (a+b)
-( partition x1 values less than (1)
- ( subpartition x11 tablespace t1 nodegroup 0,
- subpartition x12 tablespace t2 nodegroup 1),
- partition x2 values less than (5)
- ( subpartition x21 tablespace t1 nodegroup 0,
- subpartition x22 tablespace t2 nodegroup 1)
-);
-
-SELECT * from t1;
-
-drop table t1;
-
-#
-# Subpartition by hash, two partitions and two subpartitions
-# Defined tablespace, node group
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by range (a)
-subpartition by hash (a+b)
-( partition x1 values less than (1)
- ( subpartition x11 tablespace t1 nodegroup 0,
- subpartition x12 tablespace t2 nodegroup 1),
- partition x2 values less than (5)
- ( subpartition x21 tablespace t1 nodegroup 0,
- subpartition x22 tablespace t2 nodegroup 1)
-);
-
-SELECT * from t1;
-
-drop table t1;
-
-#
-# Subpartition by hash, two partitions and two subpartitions
-# Defined engine and node group
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by range (a)
-subpartition by hash (a+b)
-( partition x1 values less than (1)
- ( subpartition x11 nodegroup 0,
- subpartition x12 nodegroup 1),
- partition x2 values less than (5)
- ( subpartition x21 nodegroup 0,
- subpartition x22 nodegroup 1)
-);
-
-INSERT into t1 VALUES (1,1,1);
-INSERT into t1 VALUES (4,1,1);
---error ER_NO_PARTITION_FOR_GIVEN_VALUE
-INSERT into t1 VALUES (5,1,1);
-
-SELECT * from t1;
-
-ALTER TABLE t1
-partition by range (a)
-subpartition by hash (a+b)
-( partition x1 values less than (1)
- ( subpartition x11 nodegroup 0,
- subpartition x12 nodegroup 1),
- partition x2 values less than (5)
- ( subpartition x21 nodegroup 0,
- subpartition x22 nodegroup 1)
-);
-
-SELECT * from t1;
-
-drop table t1;
-
-#
-# Subpartition by hash, two partitions and two subpartitions
-# Defined tablespace, engine
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by range (a)
-subpartition by hash (a+b)
-( partition x1 values less than (1)
- ( subpartition x11 tablespace t1,
- subpartition x12 tablespace t2),
- partition x2 values less than (5)
- ( subpartition x21 tablespace t1,
- subpartition x22 tablespace t2)
-);
-
-INSERT into t1 VALUES (1,1,1);
-INSERT into t1 VALUES (4,1,1);
---error ER_NO_PARTITION_FOR_GIVEN_VALUE
-INSERT into t1 VALUES (5,1,1);
-
-SELECT * from t1;
-
-ALTER TABLE t1
-partition by range (a)
-subpartition by hash (a+b)
-( partition x1 values less than (1)
- ( subpartition x11 tablespace t1,
- subpartition x12 tablespace t2),
- partition x2 values less than (5)
- ( subpartition x21 tablespace t1,
- subpartition x22 tablespace t2)
-);
-
-SELECT * from t1;
-
-drop table t1;
-
-#
-# Subpartition by hash, two partitions and two subpartitions
-# Defined tablespace
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by range (a)
-subpartition by hash (a+b)
-( partition x1 values less than (1)
- ( subpartition x11 tablespace t1,
- subpartition x12 tablespace t2),
- partition x2 values less than (5)
- ( subpartition x21 tablespace t1,
- subpartition x22 tablespace t2)
-);
-
-INSERT into t1 VALUES (1,1,1);
-INSERT into t1 VALUES (4,1,1);
---error ER_NO_PARTITION_FOR_GIVEN_VALUE
-INSERT into t1 VALUES (5,1,1);
-
-SELECT * from t1;
-
-ALTER TABLE t1
-partition by range (a)
-subpartition by hash (a+b)
-( partition x1 values less than (1)
- ( subpartition x11 tablespace t1,
- subpartition x12 tablespace t2),
- partition x2 values less than (5)
- ( subpartition x21 tablespace t1,
- subpartition x22 tablespace t2)
-);
-
-SELECT * from t1;
-
-drop table t1;
-
-#
-# Subpartition by hash, two partitions and two subpartitions
-# Defined engine
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by range (a)
-subpartition by hash (a+b)
-( partition x1 values less than (1)
- ( subpartition x11,
- subpartition x12),
- partition x2 values less than (5)
- ( subpartition x21,
- subpartition x22)
-);
-
-INSERT into t1 VALUES (1,1,1);
-INSERT into t1 VALUES (4,1,1);
---error ER_NO_PARTITION_FOR_GIVEN_VALUE
-INSERT into t1 VALUES (5,1,1);
-
-SELECT * from t1;
-
-ALTER TABLE t1
-partition by range (a)
-subpartition by hash (a+b)
-( partition x1 values less than (1)
- ( subpartition x11,
- subpartition x12),
- partition x2 values less than (5)
- ( subpartition x21,
- subpartition x22)
-);
-
-SELECT * from t1;
-
-drop table t1;
-
-#
-# Bug #17894 Comparison with "less than" operator fails with Range partition
-#
-CREATE TABLE t1 (c1 int default NULL, c2 varchar(30) default NULL,
-c3 date default NULL) engine=myisam
-PARTITION BY RANGE (year(c3)) (PARTITION p0 VALUES LESS THAN (1995),
-PARTITION p1 VALUES LESS THAN (1996) , PARTITION p2 VALUES LESS THAN (1997) ,
-PARTITION p3 VALUES LESS THAN (1998) , PARTITION p4 VALUES LESS THAN (1999) ,
-PARTITION p5 VALUES LESS THAN (2000) , PARTITION p6 VALUES LESS THAN (2001) ,
-PARTITION p7 VALUES LESS THAN (2002) , PARTITION p8 VALUES LESS THAN (2003) ,
-PARTITION p9 VALUES LESS THAN (2004) , PARTITION p10 VALUES LESS THAN (2010),
-PARTITION p11 VALUES LESS THAN MAXVALUE );
-INSERT INTO t1 VALUES (1, 'testing partitions', '1995-07-17'),
-(3, 'testing partitions','1995-07-31'),
-(5, 'testing partitions','1995-08-13'),
-(7, 'testing partitions','1995-08-26'),
-(9, 'testing partitions','1995-09-09'),
-(0, 'testing partitions','2000-07-10'),
-(2, 'testing partitions','2000-07-23'),
-(4, 'testing partitions','2000-08-05'),
-(6, 'testing partitions','2000-08-19'),
-(8, 'testing partitions','2000-09-01');
-SELECT COUNT(*) FROM t1 WHERE c3 BETWEEN '1996-12-31' AND '2000-12-31';
-SELECT COUNT(*) FROM t1 WHERE c3 < '2000-12-31';
-DROP TABLE t1;
-
-#
-# BUG 16002: Unsigned partition functions not handled correctly
-#
---error ER_RANGE_NOT_INCREASING_ERROR
-create table t1 (a bigint unsigned)
-partition by range (a)
-(partition p0 values less than (10),
- partition p1 values less than (0));
-
-create table t1 (a bigint unsigned)
-partition by range (a)
-(partition p0 values less than (0),
- partition p1 values less than (10));
-show create table t1;
-drop table t1;
-
-create table t1 (a bigint unsigned)
-partition by range (a)
-(partition p0 values less than (2),
- partition p1 values less than (10));
-show create table t1;
---error ER_NO_PARTITION_FOR_GIVEN_VALUE
-insert into t1 values (0xFFFFFFFFFFFFFFFF);
-drop table t1;
-
-#
-# BUG 18962 Errors in DROP PARTITION
-#
-create table t1 (a int)
-partition by range (MOD(a,3))
-subpartition by hash(a)
-subpartitions 2
-(partition p0 values less than (1),
- partition p1 values less than (2),
- partition p2 values less than (3),
- partition p3 values less than (4));
-ALTER TABLE t1 DROP PARTITION p3;
-ALTER TABLE t1 DROP PARTITION p1;
-ALTER TABLE t1 DROP PARTITION p2;
-drop table t1;
-
-create table t1 (a int)
-partition by range (MOD(a,3))
-subpartition by hash(a)
-subpartitions 2
-(partition p0 values less than (1),
- partition p1 values less than (2),
- partition p2 values less than (3),
- partition p3 values less than (4));
-ALTER TABLE t1 DROP PARTITION p0;
-ALTER TABLE t1 DROP PARTITION p1;
-ALTER TABLE t1 DROP PARTITION p2;
-drop table t1;
-
-#
-# Bug 19830: ALTER TABLE t1 REORGANIZE PARTITION crashes
-#
-create table t1 (a int DEFAULT NULL,
- b varchar(30) DEFAULT NULL,
- c date DEFAULT NULL)
-ENGINE=MYISAM DEFAULT CHARSET=latin1;
-
-insert into t1 values (1, 'abc', '1995-01-01');
-insert into t1 values (1, 'abc', '1995-01-02');
-insert into t1 values (1, 'abc', '1995-01-03');
-insert into t1 values (1, 'abc', '1995-01-04');
-insert into t1 values (1, 'abc', '1995-01-05');
-insert into t1 values (1, 'abc', '1995-01-06');
-insert into t1 values (1, 'abc', '1995-01-07');
-insert into t1 values (1, 'abc', '1995-01-08');
-insert into t1 values (1, 'abc', '1995-01-09');
-insert into t1 values (1, 'abc', '1995-01-10');
-insert into t1 values (1, 'abc', '1995-01-11');
-insert into t1 values (1, 'abc', '1995-01-12');
-insert into t1 values (1, 'abc', '1995-01-13');
-insert into t1 values (1, 'abc', '1995-01-14');
-insert into t1 values (1, 'abc', '1995-01-15');
-insert into t1 values (1, 'abc', '1997-01-01');
-insert into t1 values (1, 'abc', '1997-01-02');
-insert into t1 values (1, 'abc', '1997-01-03');
-insert into t1 values (1, 'abc', '1997-01-04');
-insert into t1 values (1, 'abc', '1997-01-05');
-insert into t1 values (1, 'abc', '1997-01-06');
-insert into t1 values (1, 'abc', '1997-01-07');
-insert into t1 values (1, 'abc', '1997-01-08');
-insert into t1 values (1, 'abc', '1997-01-09');
-insert into t1 values (1, 'abc', '1997-01-10');
-insert into t1 values (1, 'abc', '1997-01-11');
-insert into t1 values (1, 'abc', '1997-01-12');
-insert into t1 values (1, 'abc', '1997-01-13');
-insert into t1 values (1, 'abc', '1997-01-14');
-insert into t1 values (1, 'abc', '1997-01-15');
-insert into t1 values (1, 'abc', '1998-01-01');
-insert into t1 values (1, 'abc', '1998-01-02');
-insert into t1 values (1, 'abc', '1998-01-03');
-insert into t1 values (1, 'abc', '1998-01-04');
-insert into t1 values (1, 'abc', '1998-01-05');
-insert into t1 values (1, 'abc', '1998-01-06');
-insert into t1 values (1, 'abc', '1998-01-07');
-insert into t1 values (1, 'abc', '1998-01-08');
-insert into t1 values (1, 'abc', '1998-01-09');
-insert into t1 values (1, 'abc', '1998-01-10');
-insert into t1 values (1, 'abc', '1998-01-11');
-insert into t1 values (1, 'abc', '1998-01-12');
-insert into t1 values (1, 'abc', '1998-01-13');
-insert into t1 values (1, 'abc', '1998-01-14');
-insert into t1 values (1, 'abc', '1998-01-15');
-insert into t1 values (1, 'abc', '1999-01-01');
-insert into t1 values (1, 'abc', '1999-01-02');
-insert into t1 values (1, 'abc', '1999-01-03');
-insert into t1 values (1, 'abc', '1999-01-04');
-insert into t1 values (1, 'abc', '1999-01-05');
-insert into t1 values (1, 'abc', '1999-01-06');
-insert into t1 values (1, 'abc', '1999-01-07');
-insert into t1 values (1, 'abc', '1999-01-08');
-insert into t1 values (1, 'abc', '1999-01-09');
-insert into t1 values (1, 'abc', '1999-01-10');
-insert into t1 values (1, 'abc', '1999-01-11');
-insert into t1 values (1, 'abc', '1999-01-12');
-insert into t1 values (1, 'abc', '1999-01-13');
-insert into t1 values (1, 'abc', '1999-01-14');
-insert into t1 values (1, 'abc', '1999-01-15');
-insert into t1 values (1, 'abc', '2000-01-01');
-insert into t1 values (1, 'abc', '2000-01-02');
-insert into t1 values (1, 'abc', '2000-01-03');
-insert into t1 values (1, 'abc', '2000-01-04');
-insert into t1 values (1, 'abc', '2000-01-05');
-insert into t1 values (1, 'abc', '2000-01-06');
-insert into t1 values (1, 'abc', '2000-01-07');
-insert into t1 values (1, 'abc', '2000-01-08');
-insert into t1 values (1, 'abc', '2000-01-09');
-insert into t1 values (1, 'abc', '2000-01-15');
-insert into t1 values (1, 'abc', '2000-01-11');
-insert into t1 values (1, 'abc', '2000-01-12');
-insert into t1 values (1, 'abc', '2000-01-13');
-insert into t1 values (1, 'abc', '2000-01-14');
-insert into t1 values (1, 'abc', '2000-01-15');
-insert into t1 values (1, 'abc', '2001-01-01');
-insert into t1 values (1, 'abc', '2001-01-02');
-insert into t1 values (1, 'abc', '2001-01-03');
-insert into t1 values (1, 'abc', '2001-01-04');
-insert into t1 values (1, 'abc', '2001-01-05');
-insert into t1 values (1, 'abc', '2001-01-06');
-insert into t1 values (1, 'abc', '2001-01-07');
-insert into t1 values (1, 'abc', '2001-01-08');
-insert into t1 values (1, 'abc', '2001-01-09');
-insert into t1 values (1, 'abc', '2001-01-15');
-insert into t1 values (1, 'abc', '2001-01-11');
-insert into t1 values (1, 'abc', '2001-01-12');
-insert into t1 values (1, 'abc', '2001-01-13');
-insert into t1 values (1, 'abc', '2001-01-14');
-insert into t1 values (1, 'abc', '2001-01-15');
-
-alter table t1
-partition by range (year(c))
-(partition p5 values less than (2000), partition p10 values less than (2010));
-
-alter table t1
-reorganize partition p5 into
-(partition p1 values less than (1996),
- partition p2 values less than (1997),
- partition p3 values less than (1998),
- partition p4 values less than (1999),
- partition p5 values less than (2000));
-
-drop table t1;
-
-#
-# New test cases for date based partitioning
-#
-CREATE TABLE t1 (a date)
-PARTITION BY RANGE (TO_DAYS(a))
-(PARTITION p3xx VALUES LESS THAN (TO_DAYS('2004-01-01')),
- PARTITION p401 VALUES LESS THAN (TO_DAYS('2004-02-01')),
- PARTITION p402 VALUES LESS THAN (TO_DAYS('2004-03-01')),
- PARTITION p403 VALUES LESS THAN (TO_DAYS('2004-04-01')),
- PARTITION p404 VALUES LESS THAN (TO_DAYS('2004-05-01')),
- PARTITION p405 VALUES LESS THAN (TO_DAYS('2004-06-01')),
- PARTITION p406 VALUES LESS THAN (TO_DAYS('2004-07-01')),
- PARTITION p407 VALUES LESS THAN (TO_DAYS('2004-08-01')),
- PARTITION p408 VALUES LESS THAN (TO_DAYS('2004-09-01')),
- PARTITION p409 VALUES LESS THAN (TO_DAYS('2004-10-01')),
- PARTITION p410 VALUES LESS THAN (TO_DAYS('2004-11-01')),
- PARTITION p411 VALUES LESS THAN (TO_DAYS('2004-12-01')),
- PARTITION p412 VALUES LESS THAN (TO_DAYS('2005-01-01')),
- PARTITION p501 VALUES LESS THAN (TO_DAYS('2005-02-01')),
- PARTITION p502 VALUES LESS THAN (TO_DAYS('2005-03-01')),
- PARTITION p503 VALUES LESS THAN (TO_DAYS('2005-04-01')),
- PARTITION p504 VALUES LESS THAN (TO_DAYS('2005-05-01')),
- PARTITION p505 VALUES LESS THAN (TO_DAYS('2005-06-01')),
- PARTITION p506 VALUES LESS THAN (TO_DAYS('2005-07-01')),
- PARTITION p507 VALUES LESS THAN (TO_DAYS('2005-08-01')),
- PARTITION p508 VALUES LESS THAN (TO_DAYS('2005-09-01')),
- PARTITION p509 VALUES LESS THAN (TO_DAYS('2005-10-01')),
- PARTITION p510 VALUES LESS THAN (TO_DAYS('2005-11-01')),
- PARTITION p511 VALUES LESS THAN (TO_DAYS('2005-12-01')),
- PARTITION p512 VALUES LESS THAN (TO_DAYS('2006-01-01')),
- PARTITION p601 VALUES LESS THAN (TO_DAYS('2006-02-01')),
- PARTITION p602 VALUES LESS THAN (TO_DAYS('2006-03-01')),
- PARTITION p603 VALUES LESS THAN (TO_DAYS('2006-04-01')),
- PARTITION p604 VALUES LESS THAN (TO_DAYS('2006-05-01')),
- PARTITION p605 VALUES LESS THAN (TO_DAYS('2006-06-01')),
- PARTITION p606 VALUES LESS THAN (TO_DAYS('2006-07-01')),
- PARTITION p607 VALUES LESS THAN (TO_DAYS('2006-08-01')));
-
-INSERT INTO t1 VALUES ('2003-01-13'),('2003-06-20'),('2003-08-30');
-INSERT INTO t1 VALUES ('2003-04-13'),('2003-07-20'),('2003-10-30');
-INSERT INTO t1 VALUES ('2003-05-13'),('2003-11-20'),('2003-12-30');
-
-INSERT INTO t1 VALUES ('2004-01-13'),('2004-01-20'),('2004-01-30');
-INSERT INTO t1 VALUES ('2004-02-13'),('2004-02-20'),('2004-02-28');
-INSERT INTO t1 VALUES ('2004-03-13'),('2004-03-20'),('2004-03-30');
-INSERT INTO t1 VALUES ('2004-04-13'),('2004-04-20'),('2004-04-30');
-INSERT INTO t1 VALUES ('2004-05-13'),('2004-05-20'),('2004-05-30');
-INSERT INTO t1 VALUES ('2004-06-13'),('2004-06-20'),('2004-06-30');
-INSERT INTO t1 VALUES ('2004-07-13'),('2004-07-20'),('2004-07-30');
-INSERT INTO t1 VALUES ('2004-08-13'),('2004-08-20'),('2004-08-30');
-INSERT INTO t1 VALUES ('2004-09-13'),('2004-09-20'),('2004-09-30');
-INSERT INTO t1 VALUES ('2004-10-13'),('2004-10-20'),('2004-10-30');
-INSERT INTO t1 VALUES ('2004-11-13'),('2004-11-20'),('2004-11-30');
-INSERT INTO t1 VALUES ('2004-12-13'),('2004-12-20'),('2004-12-30');
-
-INSERT INTO t1 VALUES ('2005-01-13'),('2005-01-20'),('2005-01-30');
-INSERT INTO t1 VALUES ('2005-02-13'),('2005-02-20'),('2005-02-28');
-INSERT INTO t1 VALUES ('2005-03-13'),('2005-03-20'),('2005-03-30');
-INSERT INTO t1 VALUES ('2005-04-13'),('2005-04-20'),('2005-04-30');
-INSERT INTO t1 VALUES ('2005-05-13'),('2005-05-20'),('2005-05-30');
-INSERT INTO t1 VALUES ('2005-06-13'),('2005-06-20'),('2005-06-30');
-INSERT INTO t1 VALUES ('2005-07-13'),('2005-07-20'),('2005-07-30');
-INSERT INTO t1 VALUES ('2005-08-13'),('2005-08-20'),('2005-08-30');
-INSERT INTO t1 VALUES ('2005-09-13'),('2005-09-20'),('2005-09-30');
-INSERT INTO t1 VALUES ('2005-10-13'),('2005-10-20'),('2005-10-30');
-INSERT INTO t1 VALUES ('2005-11-13'),('2005-11-20'),('2005-11-30');
-INSERT INTO t1 VALUES ('2005-12-13'),('2005-12-20'),('2005-12-30');
-
-INSERT INTO t1 VALUES ('2006-01-13'),('2006-01-20'),('2006-01-30');
-INSERT INTO t1 VALUES ('2006-02-13'),('2006-02-20'),('2006-02-28');
-INSERT INTO t1 VALUES ('2006-03-13'),('2006-03-20'),('2006-03-30');
-INSERT INTO t1 VALUES ('2006-04-13'),('2006-04-20'),('2006-04-30');
-INSERT INTO t1 VALUES ('2006-05-13'),('2006-05-20'),('2006-05-30');
-INSERT INTO t1 VALUES ('2006-06-13'),('2006-06-20'),('2006-06-30');
-INSERT INTO t1 VALUES ('2006-07-13'),('2006-07-20'),('2006-07-30');
-
-SELECT * FROM t1
-WHERE a >= '2004-07-01' AND a <= '2004-09-30';
-EXPLAIN PARTITIONS SELECT * FROM t1
-WHERE a >= '2004-07-01' AND a <= '2004-09-30';
-SELECT * from t1
-WHERE (a >= '2004-07-01' AND a <= '2004-09-30') OR
- (a >= '2005-07-01' AND a <= '2005-09-30');
-EXPLAIN PARTITIONS SELECT * from t1
-WHERE (a >= '2004-07-01' AND a <= '2004-09-30') OR
- (a >= '2005-07-01' AND a <= '2005-09-30');
-DROP TABLE t1;
-
-#
-# Bug 18198: Try with a couple of cases using VARCHAR fields in
-# partition function.
-#create table t1 (a varchar(20))
-#partition by range (ascii(a))
-#(partition p0 values less than (100),
-# partition p1 values less than maxvalue);
-
-#insert into t1 values ("12345678901234567890");
-#insert into t1 values ("A2345678901234567890");
-#insert into t1 values ("B2345678901234567890");
-#insert into t1 values ("1234567890123456789");
-#insert into t1 values ("1234567890123456");
-#select * from t1;
-#explain partitions select * from t1 where a = "12345678901234567890";
-#explain partitions select * from t1 where a = "12345678901234567890" OR
-# a = "A2345678901234567890" OR
-# a = "B2345678901234567890" OR
-# a = "C2345678901234567890";
-#explain partitions select * from t1 where a = "01234567890123456";
-#select * from t1 where a = "01234567890123456";
-#select * from t1 where a = "12345678901234567890" OR
-# a = "A2345678901234567890" OR
-# a = "B2345678901234567890" OR
-# a = "C2345678901234567890";
-#select * from t1 where a = "12345678901234567890";
-#drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/pbxt_assertions.test b/mysql-test/suite/pbxt/t/pbxt_assertions.test
deleted file mode 100644
index 3699ab04568..00000000000
--- a/mysql-test/suite/pbxt/t/pbxt_assertions.test
+++ /dev/null
@@ -1,31 +0,0 @@
-
-#
-# BUG: doing a SELECT COUNT(*) on a table with extended records and without indexes
-# caused assertion violation in debug version
-#
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-CREATE TABLE t1 (c1 VARCHAR(255), c2 VARCHAR(255), c3 INT);
-INSERT INTO t1 VALUES (REPEAT('x', 255), REPEAT('y', 255), 1);
-INSERT INTO t1 VALUES (REPEAT('x', 255), REPEAT('y', 255), 2);
-INSERT INTO t1 VALUES (REPEAT('x', 255), REPEAT('y', 255), 3);
-SELECT COUNT(*) FROM t1;
-
-#
-# BUG: the following SELECT query caused assertion violation. The engine
-# code expected that index_int/index_end will be called nested in relation to
-# handler locking functions, which was not true for the case below
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-create table t1 (a int, unique index indexa (a));
-insert into t1 values (-1), (-4), (-2), (NULL);
-select -10 IN (select a from t1 FORCE INDEX (indexa));
-
---disable_query_log
-drop table t1;
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/pbxt_bugs.test b/mysql-test/suite/pbxt/t/pbxt_bugs.test
deleted file mode 100644
index bff98e36bf3..00000000000
--- a/mysql-test/suite/pbxt/t/pbxt_bugs.test
+++ /dev/null
@@ -1,985 +0,0 @@
---disable_warnings
-drop table if exists t1,t2,t3;
---enable_warnings
-
-#----------------------------------------
-# Bug with auto_increment settings
-
-create table t1 (id int auto_increment key) engine=pbxt auto_increment=200;
-show create table t1;
-
-alter table t1 add column text char(40);
-show create table t1;
-
-alter table t1 auto_increment = 100;
-show create table t1;
-
-#----------------------------------------
-# Short fields
-drop table if exists t1;
-create table t1 (
- id int,
- c_char char(3),
- c_varchar varchar(3),
- c_char_bin char(3) binary,
- c_varchar_bin varchar(3) binary,
- c_char_uni char(3) unicode,
- c_varchar_uni varchar(3) unicode,
- c_dec decimal(3),
- index(c_char),
- index(c_varchar),
- index(c_char_bin),
- index(c_varchar_bin),
- index(c_char_uni),
- index(c_varchar_uni),
- index(c_dec)
-) engine=pbxt;
-
-insert t1 values (1, "ab", "ab", "ab", "ab", "ab", "ab", 12);
-insert t1 values (2, "ab ", "ab ", "ab ", "ab ", "ab ", "ab ", 123);
-select c_char from t1 where c_char = "ab";
-select c_varchar from t1 where c_varchar = "ab";
-select c_char_bin from t1 where c_char_bin = "ab";
-select c_varchar_bin from t1 where c_varchar_bin = "ab";
-select c_char_uni from t1 where c_char_uni = "ab";
-select c_varchar_uni from t1 where c_varchar_uni = "ab";
-select c_dec from t1 where c_dec = 12;
-select * from t1 where c_char = "ab ";
-select * from t1 where c_varchar = "ab ";
-select * from t1 where c_char_bin = "ab ";
-select * from t1 where c_varchar_bin = "ab ";
-select * from t1 where c_char_uni = "ab ";
-select * from t1 where c_varchar_uni = "ab ";
-select * from t1 where c_dec = 123;
-
-
-#----------------------------------------
-# Medium fields
-drop table if exists t1;
-create table t1 (
- id int,
- c_char char(100),
- c_varchar varchar(100),
- c_char_bin char(100) binary,
- c_varchar_bin varchar(100) binary,
- c_char_uni char(100) unicode,
- c_varchar_uni varchar(100) unicode,
- c_dec decimal(65),
- index(c_char),
- index(c_varchar),
- index(c_char_bin),
- index(c_varchar_bin),
- index(c_char_uni),
- index(c_varchar_uni),
- index(c_dec)
-) engine=pbxt;
-
-insert t1 values (1, "ab", "ab", "ab", "ab", "ab", "ab", 12);
-insert t1 values (2, "ab ", "ab ", "ab ", "ab ", "ab ", "ab ", 123);
-select * from t1 where c_char = "ab";
-select * from t1 where c_varchar = "ab";
-select * from t1 where c_char_bin = "ab";
-select * from t1 where c_varchar_bin = "ab";
-select * from t1 where c_char_uni = "ab";
-select * from t1 where c_varchar_uni = "ab";
-select * from t1 where c_dec = 12;
-select c_char from t1 where c_char = "ab ";
-select c_varchar from t1 where c_varchar = "ab ";
-select c_char_bin from t1 where c_char_bin = "ab ";
-select c_varchar_bin from t1 where c_varchar_bin = "ab ";
-select c_char_uni from t1 where c_char_uni = "ab ";
-select c_varchar_uni from t1 where c_varchar_uni = "ab ";
-select c_dec from t1 where c_dec = 123;
-
-
-#----------------------------------------
-# Large fields
-drop table if exists t1;
-create table t1 (
- id int,
- c_varchar varchar(300),
- c_varchar_bin varchar(300) binary,
- c_varchar_uni varchar(300) unicode,
- c_ttext TINYTEXT,
- c_text TEXT,
- c_mtext MEDIUMTEXT,
- c_ltext LONGTEXT,
- index(c_varchar),
- index(c_varchar_bin),
- index(c_varchar_uni),
- index(c_ttext(100)),
- index(c_text(100)),
- index(c_mtext(100)),
- index(c_ltext(100))
-) engine=pbxt;
-
-insert t1 values (1, "ab", "ab", "ab", "ab", "ab", "ab", "ab");
-insert t1 values (2, "ab ", "ab ", "ab ", "ab ", "ab ", "ab ", "ab ");
-select c_varchar from t1 where c_varchar = "ab";
-select c_varchar_bin from t1 where c_varchar_bin = "ab";
-select c_varchar_uni from t1 where c_varchar_uni = "ab";
-select c_ttext from t1 where c_ttext = "ab";
-select c_text from t1 where c_text = "ab";
-select c_mtext from t1 where c_mtext = "ab";
-select c_ltext from t1 where c_ltext = "ab";
-
-select * from t1 where c_varchar = "ab ";
-select * from t1 where c_varchar_bin = "ab ";
-select * from t1 where c_varchar_uni = "ab ";
-select * from t1 where c_ttext = "ab ";
-select * from t1 where c_text = "ab ";
-select * from t1 where c_mtext = "ab ";
-select * from t1 where c_ltext = "ab ";
-
-#----------------------------------------
-# Short fields NOT NULL
-drop table if exists t1;
-create table t1 (
- id int not null,
- c_char char(3) not null,
- c_varchar varchar(3) not null,
- c_char_bin char(3) binary not null,
- c_varchar_bin varchar(3) binary not null,
- c_char_uni char(3) unicode not null,
- c_varchar_uni varchar(3) unicode not null,
- c_dec decimal(3) not null,
- index(c_char),
- index(c_varchar),
- index(c_char_bin),
- index(c_varchar_bin),
- index(c_char_uni),
- index(c_varchar_uni),
- index(c_dec)
-) engine=pbxt;
-
-insert t1 values (1, "ab", "ab", "ab", "ab", "ab", "ab", 12);
-insert t1 values (2, "ab ", "ab ", "ab ", "ab ", "ab ", "ab ", 123);
-select * from t1 where c_char = "ab";
-select * from t1 where c_varchar = "ab";
-select * from t1 where c_char_bin = "ab";
-select * from t1 where c_varchar_bin = "ab";
-select * from t1 where c_char_uni = "ab";
-select * from t1 where c_varchar_uni = "ab";
-select * from t1 where c_dec = 12;
-select c_char from t1 where c_char = "ab ";
-select c_varchar from t1 where c_varchar = "ab ";
-select c_char_bin from t1 where c_char_bin = "ab ";
-select c_varchar_bin from t1 where c_varchar_bin = "ab ";
-select c_char_uni from t1 where c_char_uni = "ab ";
-select c_varchar_uni from t1 where c_varchar_uni = "ab ";
-select c_dec from t1 where c_dec = 123;
-
-
-#----------------------------------------
-# Medium fields NOT NULL
-drop table if exists t1;
-create table t1 (
- id int not null,
- c_char char(100) not null,
- c_varchar varchar(100) not null,
- c_char_bin char(100) binary not null,
- c_varchar_bin varchar(100) binary not null,
- c_char_uni char(100) unicode not null,
- c_varchar_uni varchar(100) unicode not null,
- c_dec decimal(65),
- index(c_char),
- index(c_varchar),
- index(c_char_bin),
- index(c_varchar_bin),
- index(c_char_uni),
- index(c_varchar_uni),
- index(c_dec)
-) engine=pbxt;
-
-insert t1 values (1, "ab", "ab", "ab", "ab", "ab", "ab", 12);
-insert t1 values (2, "ab ", "ab ", "ab ", "ab ", "ab ", "ab ", 123);
-select c_char from t1 where c_char = "ab";
-select c_varchar from t1 where c_varchar = "ab";
-select c_char_bin from t1 where c_char_bin = "ab";
-select c_varchar_bin from t1 where c_varchar_bin = "ab";
-select c_char_uni from t1 where c_char_uni = "ab";
-select c_varchar_uni from t1 where c_varchar_uni = "ab";
-select c_dec from t1 where c_dec = 12;
-select * from t1 where c_char = "ab ";
-select * from t1 where c_varchar = "ab ";
-select * from t1 where c_char_bin = "ab ";
-select * from t1 where c_varchar_bin = "ab ";
-select * from t1 where c_char_uni = "ab ";
-select * from t1 where c_varchar_uni = "ab ";
-select * from t1 where c_dec = 123;
-
-
-#----------------------------------------
-# Large fields NOT NULL
-drop table if exists t1;
-create table t1 (
- id int,
- c_varchar varchar(300) not null,
- c_varchar_bin varchar(300) binary not null,
- c_varchar_uni varchar(300) unicode not null,
- c_ttext TINYTEXT not null,
- c_text TEXT not null,
- c_mtext MEDIUMTEXT not null,
- c_ltext LONGTEXT not null,
- index(c_varchar),
- index(c_varchar_bin),
- index(c_varchar_uni),
- index(c_ttext(100)),
- index(c_text(100)),
- index(c_mtext(100)),
- index(c_ltext(100))
-) engine=pbxt;
-
-insert t1 values (1, "ab", "ab", "ab", "ab", "ab", "ab", "ab");
-insert t1 values (2, "ab ", "ab ", "ab ", "ab ", "ab ", "ab ", "ab ");
-select * from t1 where c_varchar = "ab";
-select * from t1 where c_varchar_bin = "ab";
-select * from t1 where c_varchar_uni = "ab";
-select * from t1 where c_ttext = "ab";
-select * from t1 where c_text = "ab";
-select * from t1 where c_mtext = "ab";
-select * from t1 where c_ltext = "ab";
-
-select c_varchar from t1 where c_varchar = "ab ";
-select c_varchar_bin from t1 where c_varchar_bin = "ab ";
-select c_varchar_uni from t1 where c_varchar_uni = "ab ";
-select c_ttext from t1 where c_ttext = "ab ";
-select c_text from t1 where c_text = "ab ";
-select c_mtext from t1 where c_mtext = "ab ";
-select c_ltext from t1 where c_ltext = "ab ";
-
-#----------------------------------------
-# UNICODE Tests
-
-drop table if exists t1;
-create table t1 (
- id int,
- c_char_suni char(4) unicode,
- c_varchar_suni varchar(4) unicode,
- c_char_uni char(255) unicode,
- c_varchar_uni varchar(300) unicode,
- index(c_char_suni),
- index(c_varchar_suni),
- index(c_char_uni),
- index(c_varchar_uni)
-) engine=pbxt;
-
-insert t1 values (1, "ab", "ab", "ab", "ab");
-insert t1 values (1, "abcd", "abcd", "abcd", "abcd");
-insert t1 values (1, "ab ", "ab ", "abcd123123123123123123123123123123123123", "abcd123123123123123123123123123123123123");
-select * from t1 where c_char_suni = "ab";
-select * from t1 where c_varchar_suni = "ab";
-select * from t1 where c_char_uni = "ab";
-select * from t1 where c_varchar_uni = "ab";
-
-
-#----------------------------------------
-# Duplicate key tests
-
-drop table if exists t1;
-create table t1 (id int, name char(10) key) engine=pbxt;
-insert t1 values (1, "ab");
-select * from t1 where name = "ab";
--- error 1062
-insert t1 values (2, "ab ");
-
-drop table if exists t1;
-create table t1 (id int, name char(100) key) engine=pbxt;
-insert t1 values (1, "ab");
-select * from t1 where name = "ab";
--- error 1062
-insert t1 values (2, "ab ");
-
-drop table if exists t1;
-create table t1 (id int, name varchar(10) key) engine=pbxt;
-insert t1 values (1, "ab");
-select * from t1 where name = "ab";
--- error 1062
-insert t1 values (2, "ab ");
-
-drop table if exists t1;
-create table t1 (id int, name varchar(100) key) engine=pbxt;
-insert t1 values (1, "ab");
-select * from t1 where name = "ab";
--- error 1062
-insert t1 values (2, "ab ");
-
-drop table if exists t1;
-create table t1 (id int, name varchar(400) key) engine=pbxt;
-insert t1 values (1, "ab");
-select * from t1 where name = "ab";
--- error 1062
-insert t1 values (2, "ab ");
-
-drop table if exists t1;
-create table t1 (id int, name char(10) key) engine=pbxt;
-insert t1 values (1, "ab");
-select * from t1 where name = "ab";
--- error 1062
-insert t1 values (2, "ab ");
-
-drop table if exists t1;
-create table t1 (id int, name char(100) key) engine=pbxt;
-insert t1 values (1, "ab");
-select * from t1 where name = "ab";
--- error 1062
-insert t1 values (2, "ab ");
-
-
-drop table if exists t1;
-create table t1 (id int, name varchar(10), index(name)) engine=pbxt;
-insert t1 values (1, "ab");
-select * from t1 where name = "ab";
-insert t1 values (2, "ab ");
-insert t1 values (3, "ab ");
-select * from t1 where name = "ab";
-insert t1 values (4, "ab ");
-
-drop table if exists t1;
-create table t1 (id int, name varchar(100), index(name)) engine=pbxt;
-insert t1 values (1, "ab");
-select * from t1 where name = "ab";
-insert t1 values (2, "ab ");
-insert t1 values (3, "ab ");
-select * from t1 where name = "ab";
-insert t1 values (4, "ab ");
-
-drop table if exists t1;
-create table t1 (id int, name varchar(400), index(name)) engine=pbxt;
-insert t1 values (1, "ab");
-select * from t1 where name = "ab";
-insert t1 values (2, "ab ");
-insert t1 values (3, "ab ");
-select * from t1 where name = "ab";
-insert t1 values (4, "ab ");
-
-drop table if exists t1;
-create table t1 (id int, name char(10), index(name)) engine=pbxt;
-insert t1 values (1, "ab");
-select * from t1 where name = "ab";
-insert t1 values (2, "ab ");
-insert t1 values (3, "ab ");
-select * from t1 where name = "ab";
-insert t1 values (4, "ab ");
-
-drop table if exists t1;
-create table t1 (id int, name char(100), index(name)) engine=pbxt;
-insert t1 values (1, "ab");
-select * from t1 where name = "ab";
-insert t1 values (2, "ab ");
-insert t1 values (3, "ab ");
-select * from t1 where name = "ab";
-insert t1 values (4, "ab ");
-
-
-# BUG: "-49: Record format unknown, either corrupted or upgrade required"
-
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 ( id int, name varchar(300)) engine=pbxt;
-begin;
-insert t1(id, name) values(1, "aaa");
-update t1 set name=REPEAT('A', 300) where id = 1;
-commit;
-flush tables;
-select * from t1;
-
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 ( id int, name varchar(300)) engine=pbxt;
-begin;
-insert t1(id, name) values(1, REPEAT('A', 300));
-update t1 set name="aaa" where id = 1;
-commit;
-flush tables;
-select * from t1;
-
-
-# BUG: failing TRUNCATE TABLE puts handler into an invalid state with later crash
-
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
-create table t1 (s1 int primary key) engine = pbxt;
-insert into t1 values (1);
-create table t2 (s1 int, foreign key (s1) references t1 (s1)) engine = pbxt;
-insert into t2 values (1);
-# this should fail because of FK constraint
---error 1451
-truncate table t1;
-# this caused a crash
-alter table t1 engine myisam;
-show create table t1;
-
-# BUG: Foreign Keys: missing row in table_constraints
-
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
-
-create table t1 (s1 int primary key, s2 int unique not null) engine = pbxt;
-create table t2 (s1 int, foreign key (s1) references t1 (s1)) engine = pbxt;
-
-select * from information_schema.table_constraints
- where constraint_type = 'FOREIGN KEY' and table_name = 't2';
-
-select * from information_schema.referential_constraints where table_name = 't2';
-
-drop table t2, t1;
-
-create table t1 (s1 int, s2 int, unique key ix1 (s1, s2)) engine = pbxt;
-create table t2 (s1 int, s2 int, foreign key (s1, s2) references t1 (s1, s2)) engine = pbxt;
-
-select * from information_schema.table_constraints
- where constraint_type = 'FOREIGN KEY' and table_name = 't2';
-
-select * from information_schema.referential_constraints where table_name = 't2';
-
-drop table t2, t1;
-
-create table t1 (s1 int, s2 int, unique key ix1 (s1, s2), unique key ix2 (s1, s2)) engine = pbxt;
-create table t2 (s1 int, s2 int, foreign key (s1, s2) references t1 (s1, s2)) engine = pbxt;
-
-select * from information_schema.table_constraints
- where constraint_type = 'FOREIGN KEY' and table_name = 't2';
-
-select * from information_schema.referential_constraints where table_name = 't2';
-
-drop table t2, t1;
-
-create table t1 (s1 int, s2 int, unique key ix1 (s1, s2)) engine = pbxt;
-create table t2 (s1 int, s2 int,
- foreign key (s1, s2) references t1 (s1, s2) on delete cascade on update set null) engine = pbxt;
-
-select * from information_schema.table_constraints
- where constraint_type = 'FOREIGN KEY' and table_name = 't2';
-
-select * from information_schema.referential_constraints where table_name = 't2';
-
-drop table t2, t1;
-
-create table t2 (s1 int, s2 int, s3 int, s4 int, unique key ix34 (s3, s4),
- foreign key (s1, s2) references t2 (s3, s4)) engine = pbxt;
-
-select * from information_schema.table_constraints
- where constraint_type = 'FOREIGN KEY' and table_name = 't2';
-
-select * from information_schema.referential_constraints where table_name = 't2';
-
-drop table t2;
-
-create table t1 (s1 int, s2 int, unique key ix1 (s1, s2)) engine = pbxt;
-create table t2 (s1 int, s2 int,
- foreign key (s1, s2) references t1 (s1, s2)) engine = pbxt;
-alter table t1 add constraint s2 foreign key (s1, s2) references t2 (s1, s2);
-
-select * from information_schema.table_constraints
- where constraint_type = 'FOREIGN KEY' and (table_name = 't1' or table_name = 't2');
-
-select * from information_schema.referential_constraints where (table_name = 't1' or table_name = 't2');
-
-set foreign_key_checks = 0;
-drop table t2, t1;
-set foreign_key_checks = 1;
-
-create table t1 (id int primary key, s1 int, foreign key (s1) references t1 (id)) engine = pbxt;
-
-select * from information_schema.table_constraints
- where constraint_type = 'FOREIGN KEY' and table_name = 't1';
-
-select * from information_schema.referential_constraints where table_name = 't1';
-
-drop table t1;
-
-# BUGS:
-# 1. Foreign keys: crash if update cascade and autocommit=0,
-# 2. Foreign keys: crash if update cascade and multi-level recursion
-
-# original test-case
-
---disable_warnings
-drop table if exists t2,t1;
---enable_warnings
-
-create table t1 (s1 int primary key) engine = pbxt;
-create table t2 (s1 int primary key, foreign key (s1) references t1 (s1) on update cascade) engine = pbxt;
-
-set @@autocommit = 0;
-insert into t1 values (1);
-insert into t2 values (1);
-update t1 set s1 = 2;
-set @@autocommit = 1;
-
-select * from t1, t2;
-
-# test-case with multiple columns/indexes
-
-drop table t2, t1;
-
-create table t1 (s1 int primary key, s2 int, key (s1, s2)) engine = pbxt;
-create table t2 (s1 int primary key, s2 int, key (s1, s2), foreign key (s1) references t1 (s1) on update cascade) engine = pbxt;
-
-set @@autocommit = 0;
-insert into t1 values (1, 5);
-insert into t2 values (1, 6);
-update t1 set s1 = 2;
-set @@autocommit = 1;
-
-select * from t1, t2;
-
-drop table t2, t1;
-
-# test case for the second bug
-
-set @@autocommit = 1;
-
-SET foreign_key_checks = 0;
---disable_warnings
-DROP TABLE IF EXISTS t15,t14,t13,t12,t11,t10,t9,t8,t7,t6,t5,t4,t3,t2,t1;
---enable_warnings
-SET foreign_key_checks = 1;
-
-CREATE TABLE t1 (s1 INT PRIMARY KEY, s2 INT) engine = pbxt;
-CREATE TABLE t2 (s1 INT PRIMARY KEY, FOREIGN KEY (s1) REFERENCES t1 (s1) ON UPDATE CASCADE) engine = pbxt;
-CREATE TABLE t3 (s1 INT PRIMARY KEY, FOREIGN KEY (s1) REFERENCES t2 (s1) ON UPDATE CASCADE) engine = pbxt;
-CREATE TABLE t4 (s1 INT PRIMARY KEY, FOREIGN KEY (s1) REFERENCES t3 (s1) ON UPDATE CASCADE) engine = pbxt;
-CREATE TABLE t5 (s1 INT PRIMARY KEY, FOREIGN KEY (s1) REFERENCES t4 (s1) ON UPDATE CASCADE) engine = pbxt;
-CREATE TABLE t6 (s1 INT PRIMARY KEY, FOREIGN KEY (s1) REFERENCES t5 (s1) ON UPDATE CASCADE) engine = pbxt;
-CREATE TABLE t7 (s1 INT PRIMARY KEY, FOREIGN KEY (s1) REFERENCES t6 (s1) ON UPDATE CASCADE) engine = pbxt;
-CREATE TABLE t8 (s1 INT PRIMARY KEY, FOREIGN KEY (s1) REFERENCES t7 (s1) ON UPDATE CASCADE) engine = pbxt;
-CREATE TABLE t9 (s1 INT PRIMARY KEY, FOREIGN KEY (s1) REFERENCES t8 (s1) ON UPDATE CASCADE) engine = pbxt;
-CREATE TABLE t10(s1 INT PRIMARY KEY, FOREIGN KEY (s1) REFERENCES t9 (s1) ON UPDATE CASCADE) engine = pbxt;
-CREATE TABLE t11(s1 INT PRIMARY KEY, FOREIGN KEY (s1) REFERENCES t10(s1) ON UPDATE CASCADE) engine = pbxt;
-CREATE TABLE t12(s1 INT PRIMARY KEY, FOREIGN KEY (s1) REFERENCES t11(s1) ON UPDATE CASCADE) engine = pbxt;
-CREATE TABLE t13(s1 INT PRIMARY KEY, FOREIGN KEY (s1) REFERENCES t12(s1) ON UPDATE CASCADE) engine = pbxt;
-CREATE TABLE t14(s1 INT PRIMARY KEY, FOREIGN KEY (s1) REFERENCES t13(s1) ON UPDATE CASCADE) engine = pbxt;
-CREATE TABLE t15(s1 INT PRIMARY KEY, FOREIGN KEY (s1) REFERENCES t14(s1) ON UPDATE CASCADE) engine = pbxt;
-
-ALTER TABLE t1 ADD FOREIGN KEY (s2) REFERENCES t15(s1) ON UPDATE CASCADE;
-
-SET foreign_key_checks = 0;
-
-INSERT INTO t1 VALUES (1,NULL);
-INSERT INTO t2 VALUES (1);
-INSERT INTO t3 VALUES (1);
-INSERT INTO t4 VALUES (1);
-INSERT INTO t5 VALUES (1);
-INSERT INTO t6 VALUES (1);
-INSERT INTO t7 VALUES (1);
-INSERT INTO t8 VALUES (1);
-INSERT INTO t9 VALUES (1);
-INSERT INTO t10 VALUES (1);
-INSERT INTO t11 VALUES (1);
-INSERT INTO t12 VALUES (1);
-INSERT INTO t13 VALUES (1);
-INSERT INTO t14 VALUES (1);
-INSERT INTO t15 VALUES (1);
-
-SET foreign_key_checks = 1;
-
-UPDATE t1 SET s1 = 2;
-select * from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15;
-
-UPDATE t1 SET s2 = 2;
-select * from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15;
-
-# this query works with pbxt, fails with innodb, falcon 6.0.5 ignores constraint actions
-UPDATE t1 SET s1 = 3;
-select * from t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15;
-
-SET foreign_key_checks = 0;
-DROP TABLE IF EXISTS t15,t14,t13,t12,t11,t10,t9,t8,t7,t6,t5,t4,t3,t2,t1;
-SET foreign_key_checks = 1;
-
-# BUG: Foreign keys: can't reference with enum
-# correct behavior: references between ENUMs and SETs are allowed as long as they have equal number of members
-
---disable_warnings
-DROP TABLE IF EXISTS t2,t1;
---enable_warnings
-
-CREATE TABLE t1 (s1 ENUM('a','b') PRIMARY KEY) engine = pbxt;
-CREATE TABLE t2 (s1 ENUM('A','B'), FOREIGN KEY (s1) REFERENCES t1 (s1)) engine = pbxt;
-
-DROP TABLE t2,t1;
-
-CREATE TABLE t1 (s1 ENUM('a','b') PRIMARY KEY) engine = pbxt;
--- error 1005
-CREATE TABLE t2 (s1 ENUM('A','B', 'C'), FOREIGN KEY (s1) REFERENCES t1 (s1)) engine = pbxt;
-
-DROP TABLE t1;
-
-CREATE TABLE t1 (s1 ENUM('a','b','c') PRIMARY KEY) engine = pbxt;
-CREATE TABLE t2 (s1 ENUM('d','e','f'), FOREIGN KEY (s1) REFERENCES t1 (s1)) engine = pbxt;
-
-DROP TABLE t2,t1;
-
-CREATE TABLE t1 (s1 SET('a','b') PRIMARY KEY) engine = pbxt;
-CREATE TABLE t2 (s1 SET('A','B'), FOREIGN KEY (s1) REFERENCES t1 (s1)) engine = pbxt;
-
-DROP TABLE t2,t1;
-
-CREATE TABLE t1 (s1 SET('a','b') PRIMARY KEY) engine = pbxt;
--- error 1005
-CREATE TABLE t2 (s1 SET('A','B', 'C'), FOREIGN KEY (s1) REFERENCES t1 (s1)) engine = pbxt;
-
-DROP TABLE t1;
-
-CREATE TABLE t1 (s1 SET('a','b','c') PRIMARY KEY) engine = pbxt;
-CREATE TABLE t2 (s1 SET('d','e','f'), FOREIGN KEY (s1) REFERENCES t1 (s1)) engine = pbxt;
-
-DROP TABLE t2,t1;
-
-CREATE TABLE t1 (s1 SET('a','b') PRIMARY KEY) engine = pbxt;
--- error 1005
-CREATE TABLE t2 (s1 ENUM('a','b'), FOREIGN KEY (s1) REFERENCES t1 (s1)) engine = pbxt;
-
-DROP TABLE t1;
-
-CREATE TABLE t1 (s1 ENUM('a','b') PRIMARY KEY) engine = pbxt;
--- error 1005
-CREATE TABLE t2 (s1 SET('a','b'), FOREIGN KEY (s1) REFERENCES t1 (s1)) engine = pbxt;
-
-DROP TABLE t1;
-
-# RN155: Errors during cascade update of VARCHAR values with trailing spaces
-
-DROP TABLE IF EXISTS t2, t1;
-CREATE TABLE t1 (s1 VARCHAR(50) PRIMARY KEY) engine = pbxt;
-CREATE TABLE t2 (s1 VARCHAR(50), FOREIGN KEY (s1) REFERENCES t1 (s1)) engine = pbxt;
-
-INSERT INTO t1 VALUES ('A');
-INSERT INTO t2 VALUES ('A ');
-
-UPDATE t1 SET s1 = 'A ';
-
-DELETE FROM t2;
-DELETE FROM t1;
-
-INSERT INTO t1 VALUES ('A');
-INSERT INTO t2 VALUES ('A');
-
-UPDATE t1 SET s1 = 'A ';
-UPDATE t2 SET s1 = 'A ';
-UPDATE t1 SET s1 = 'a';
-UPDATE t2 SET s1 = 'a';
-
-DROP TABLE t2, t1;
-
-# SET DEFAULT produces error
-
-DROP TABLE IF EXISTS t2,t1;
-CREATE TABLE t1 (s1 INT PRIMARY KEY);
-CREATE TABLE t2 (s1 INT DEFAULT 2, FOREIGN KEY (s1) REFERENCES t1 (s1) ON DELETE SET DEFAULT);
-INSERT INTO t1 VALUES (1),(2);
-INSERT INTO t2 VALUES (1);
-DELETE FROM t1 WHERE s1 = 1;
-SELECT * FROM t2;
-
-DROP TABLE IF EXISTS t2,t1;
-CREATE TABLE t1 (s1 DATE NOT NULL UNIQUE);
-CREATE TABLE t2 (s1 DATE DEFAULT '2000-01-01', FOREIGN KEY (s1) REFERENCES t1 (s1) ON UPDATE SET DEFAULT);
-
-INSERT INTO t1 VALUES ('2001-01-01');
-INSERT INTO t2 VALUES ('2001-01-01');
-UPDATE t1 SET s1 = '2001-01-02';
-SELECT * FROM t2;
-
-DROP TABLE IF EXISTS t2,t1;
-CREATE TABLE t1 (s1 INT PRIMARY KEY);
-CREATE TABLE t2 (s1 INT DEFAULT NULL, FOREIGN KEY (s1) REFERENCES t1 (s1) ON DELETE SET DEFAULT);
-INSERT INTO t1 VALUES (1),(2);
-INSERT INTO t2 VALUES (1);
-DELETE FROM t1 WHERE s1 = 1;
-SELECT * FROM t2;
-
-DROP TABLE IF EXISTS t2,t1;
-CREATE TABLE t1 (s1 VARCHAR(45) primary key);
-CREATE TABLE t2 (s1 VARCHAR(45) DEFAULT NULL, FOREIGN KEY (s1) REFERENCES t1 (s1) ON DELETE SET DEFAULT);
-INSERT INTO t1 VALUES (1),(2);
-INSERT INTO t2 VALUES (1);
-DELETE FROM t1 WHERE s1 = 1;
-SELECT * FROM t2;
-
-DROP TABLE IF EXISTS t2,t1;
-CREATE TABLE t1 (s1 VARCHAR(45), INDEX (s1(10)));
-CREATE TABLE t2 (s1 VARCHAR(45) DEFAULT "12345678901", FOREIGN KEY (s1) REFERENCES t1 (s1) ON DELETE SET DEFAULT);
-INSERT INTO t1 VALUES (1),(2);
-INSERT INTO t2 VALUES (1);
-DELETE FROM t1 WHERE s1 = 1;
-SELECT * FROM t2;
-
-# A crash if inserting into a table that has an FK that references a column that has no index on it
-
-DROP TABLE IF EXISTS t2,t1;
-CREATE TABLE t1 (s1 INT);
-CREATE TABLE t2 (s1 INT DEFAULT NULL, FOREIGN KEY (s1) REFERENCES t1 (s1) ON DELETE SET DEFAULT);
-INSERT INTO t1 VALUES (1);
---error 1297
-INSERT INTO t2 VALUES (1); # this used to crash
-
-# A crash if cascade operation on child table triggers a subsequent cascade operation and that operation fails
-# (e.g. because of contraint violation)
-
---disable_warnings
-DROP TABLE IF EXISTS t3,t2,t1;
---enable_warnings
-CREATE TABLE t1 (s1 INT primary key);
-CREATE TABLE t2 (s1 INT DEFAULT NULL, FOREIGN KEY (s1) REFERENCES t1 (s1) ON DELETE SET NULL);
-CREATE TABLE t3 (s1 INT DEFAULT NULL, FOREIGN KEY (s1) REFERENCES t2 (s1) ON DELETE SET NULL);
-INSERT INTO t1 VALUES (1),(2);
-INSERT INTO t2 VALUES (1);
-INSERT INTO t3 VALUES (1);
-
-# we don't have on-update action for t3 which means NO ACTION which is basically the same as RESTICT, and the constraints check fails
---error 1451
-DELETE FROM t1 WHERE s1 = 1;
-
-SELECT * FROM t1;
-SELECT * FROM t2;
-SELECT * FROM t3;
-
-# Same as previous test but action is SET DEFAULT
-
---disable_warnings
-DROP TABLE IF EXISTS t3,t2,t1;
---enable_warnings
-CREATE TABLE t1 (s1 INT primary key);
-CREATE TABLE t2 (s1 INT DEFAULT NULL, FOREIGN KEY (s1) REFERENCES t1 (s1) ON DELETE SET DEFAULT);
-CREATE TABLE t3 (s1 INT DEFAULT NULL, FOREIGN KEY (s1) REFERENCES t2 (s1) ON DELETE SET DEFAULT);
-INSERT INTO t1 VALUES (1),(2);
-INSERT INTO t2 VALUES (1);
-INSERT INTO t3 VALUES (1);
-
-# we don't have on-update action for t3 which means NO ACTION which is basically the same as RESTICT, and the constraints check fails
---error 1451
-DELETE FROM t1 WHERE s1 = 1;
-
-SELECT * FROM t1;
-SELECT * FROM t2;
-SELECT * FROM t3;
-
-DROP TABLE IF EXISTS t3,t2,t1;
-
-# RN203: Fixed foreign key bug: REPLACE fails with 'on delete cascade'
-
---disable_warnings
-DROP TABLE IF EXISTS t2,t1;
---enable_warnings
-CREATE TABLE t1 (s1 INT PRIMARY KEY, s2 char(1));
-CREATE TABLE t2 (s1 INT, s2 INT PRIMARY KEY,
- FOREIGN KEY (s1) REFERENCES t1 (s1) ON DELETE CASCADE);
-INSERT INTO t1 VALUES (1,'a');
-INSERT INTO t2 VALUES (1,1);
-REPLACE INTO t1 VALUES (1,'b');
-SELECT COUNT(*) FROM t2;
-
-set foreign_key_checks = 0;
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (s1 INT PRIMARY KEY, s2 char(1));
-set foreign_key_checks = 1;
-INSERT INTO t1 VALUES (1,'a');
-REPLACE INTO t1 VALUES (1,'b');
-
-# RN204: Foreign key references are now checked on CREATE TABLE.
-
---disable_warnings
-DROP TABLE IF EXISTS t3,t2,t1;
---enable_warnings
-CREATE TABLE t1 (s1 INT PRIMARY KEY, s2 INT);
-CREATE TABLE t2 (s1 INT PRIMARY KEY, FOREIGN KEY (s1) REFERENCES t1 (s1) ON UPDATE CASCADE);
-CREATE TABLE t3 (s1 INT PRIMARY KEY, FOREIGN KEY (s1) REFERENCES t2 (s1) ON UPDATE CASCADE);
-
-DROP TABLE IF EXISTS t3,t2,t1;
-CREATE TABLE t1 (s1 ENUM('a','b') PRIMARY KEY);
---error 1005
-CREATE TABLE t2 (s1 ENUM('A','B','C'), FOREIGN KEY (s1) REFERENCES t1 (s1));
-
-DROP TABLE IF EXISTS t2,t1;
-
-CREATE TABLE t1 (s1 INT PRIMARY KEY, s2 INT);
-CREATE TABLE t2 (s1 INT PRIMARY KEY, FOREIGN KEY (s1) REFERENCES t1 (s1) ON UPDATE CASCADE);
-
-DROP TABLE IF EXISTS t2,t1;
-
-# Relax restrictions on data types
-
-create table t1 (s1 varchar(40) primary key);
-create table t2 (s1 VARCHAR(30), foreign key (s1) references t1 (s1));
-insert into t1 values ("1");
-insert into t2 values ("1");
-
-DROP TABLE IF EXISTS t2,t1;
-
-# bug 340316: Issue with bigint unsigned auto-increment field
-
---disable_warnings
-DROP TABLE IF EXISTS t5;
---enable_warnings
-CREATE TABLE t5 (
- c1 BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
- c2 BIGINT SIGNED NULL,
- c3 BIGINT SIGNED NOT NULL,
- c4 TINYINT, c5 SMALLINT,
- c6 MEDIUMINT,
- c7 INT,
- c8 INTEGER,
- PRIMARY KEY(c1,c2), UNIQUE INDEX(c3));
-
-INSERT INTO t5 VALUES
- (0,-9223372036854775808,1,2,3,4,5,5),
- (255,-2147483648,6,7,8,9,10,10),
- (65535,-8388608,11,12,13,14,15,15),
- (16777215,-32768,16,17,18,19,20,20),
- (4294967295,-128,21,22,23,24,25,25),
- (18446744073709551615,9223372036854775807,26,27,28,29,30,30);
-
---error 1467
-INSERT INTO t5(c2,c3) VALUES(33,34) /* tries to increment out of range */;
---error 1467
-INSERT INTO t5(c2,c3) VALUES(33,34);
-
-SELECT * FROM t5;
-
-DROP TABLE t5;
-
-/* same test as above with signed bigint */
-CREATE TABLE t5 (
- c1 BIGINT SIGNED NOT NULL AUTO_INCREMENT,
- c2 BIGINT SIGNED NULL,
- c3 BIGINT SIGNED NOT NULL,
- c4 TINYINT, c5 SMALLINT,
- c6 MEDIUMINT,
- c7 INT,
- c8 INTEGER,
- PRIMARY KEY(c1,c2), UNIQUE INDEX(c3));
-
-INSERT INTO t5 VALUES
- (0,-9223372036854775808,1,2,3,4,5,5),
- (255,-2147483648,6,7,8,9,10,10),
- (65535,-8388608,11,12,13,14,15,15),
- (16777215,-32768,16,17,18,19,20,20),
- (4294967295,-128,21,22,23,24,25,25),
- (9223372036854775807,9223372036854775807,26,27,28,29,30,30);
-
---error 1467
-INSERT INTO t5(c2,c3) VALUES(33,34) /* tries to increment out of range */;
---error 1467
-INSERT INTO t5(c2,c3) VALUES(33,34);
-
-SELECT * FROM t5;
-
-# bug 341115: wrong key comparison algorithm led to endless resultset
-
-CREATE TABLE t2(c1 INT SIGNED NOT NULL, c2 INT UNSIGNED NULL, c3 INT, KEY(c1), KEY(c2));
-INSERT INTO t2 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,NULL,11),(-12,12,12);
-INSERT INTO t2 VALUES(-2147483648,0,13),(2147483647,4294967295,14),(0,2147483648,15),(2147483647,2147483647,16);
---sorted_result
-SELECT * FROM t2;
-
-# make sure it uses index scan
-EXPLAIN SELECT c1 FROM t2;
---sorted_result
-SELECT c1 FROM t2;
-
-UPDATE t2 SET c1=-2147483648 WHERE c2 <> 0 ORDER BY c2 LIMIT 2;
---sorted_result
-SELECT * FROM t2 WHERE c2 <> 0 ORDER BY c2;
-UPDATE t2 SET c1=-2147483648 WHERE c2 >= 0 ORDER BY c2 DESC LIMIT 2;
---sorted_result
-SELECT * FROM t2 WHERE c2 >= 0 ORDER BY c2 DESC;
-UPDATE t2 SET c1=-2147483648 WHERE c2 <= 3 ORDER BY c2 LIMIT 2;
---sorted_result
-SELECT * FROM t2 WHERE c2 <= 3 ORDER BY c2;
-UPDATE t2 SET c1=-2147483648 WHERE c2 <=> 4 ORDER BY c2 DESC LIMIT 2;
---sorted_result
-SELECT * FROM t2 WHERE c2 <=> 4 ORDER BY c2;
-UPDATE t2 SET c1=-2147483648 WHERE c2 BETWEEN 4 AND 7 ORDER BY c2 LIMIT 2;
---sorted_result
-SELECT * FROM t2 WHERE c2 BETWEEN 4 AND 7 ORDER BY c2;
-UPDATE t2 SET c1=-2147483648 WHERE c2 IN(8,9) ORDER BY c2 DESC LIMIT 2;
---sorted_result
-SELECT * FROM t2 WHERE c2 IN(8,9) ORDER BY c2 DESC;
-UPDATE t2 SET c1=-2147483648 WHERE c2 IS NULL ORDER BY c2 LIMIT 2;
---sorted_result
-SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c2;
-UPDATE t2 SET c1=-2147483648 WHERE c2>= 6 AND c2 < 9 ORDER BY c2 LIMIT 2;
---sorted_result
-SELECT * FROM t2 WHERE c2>= 6 AND c2 < 9 ORDER BY c2;
-UPDATE t2 SET c1=-2147483648 WHERE c1=-12 OR c2=1;
---sorted_result
-SELECT * FROM t2 WHERE c1=-2147483648;
---sorted_result
-SELECT * FROM t2;
-
-# make sure it uses index scan
-EXPLAIN SELECT c1 FROM t2;
---sorted_result
-SELECT c1 FROM t2;
-
-# bug 313391: LOAD DATA..REPLACE broken
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARCHAR(255));
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/pbxt_load_unique_error1.inc' REPLACE INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (@c1,c2) SET c1 = @c1 % 2;
---sorted_result
-SELECT * FROM t1 ORDER BY c1;
-DROP TABLE t1;
-
-create table parent (id int primary key);
-create table child (id int PRIMARY KEY, FOREIGN KEY (id) REFERENCES parent(id));
-insert into parent values (2), (3), (4);
-insert into child values (3), (4);
-
---error 1451
-delete ignore from parent;
---sorted_result
-select * from parent;
-
-drop table child, parent;
-
-# bug 378222: Drop sakila causes error: Cannot delete or update a parent row: a foreign key constraint fails
-
-create schema test378222;
-use test378222;
-create table t1 (id int primary key);
-create table t2 (id int primary key);
-alter table t1 add constraint foreign key (id) references t2 (id);
-alter table t2 add constraint foreign key (id) references t1 (id);
-drop schema test378222;
-
-create schema test378222a;
-create schema test378222b;
-create table test378222a.t1 (id int primary key);
-create table test378222b.t2 (id int primary key);
-alter table test378222a.t1 add constraint foreign key (id) references test378222b.t2 (id);
-alter table test378222b.t2 add constraint foreign key (id) references test378222a.t1 (id);
-set foreign_key_checks = 1;
---error 1217
-drop schema test378222a;
---error 1217
-drop schema test378222b;
-set foreign_key_checks = 0;
-drop schema test378222a;
-drop schema test378222b;
-set foreign_key_checks = 1;
-use test;
-
-# bug 369086: Incosistent/Incorrect Truncate behavior
-CREATE TABLE t1(c1 TINYINT AUTO_INCREMENT NULL KEY ) AUTO_INCREMENT=10;
-SHOW CREATE TABLE t1;
-INSERT INTO t1 VALUES(null);
-INSERT INTO t1 VALUES(null);
-INSERT INTO t1 VALUES(null);
-SELECT * FROM t1;
-TRUNCATE TABLE t1;
-INSERT INTO t1 VALUES(null);
-SELECT * FROM t1;
-DROP TABLE t1;
-
---disable_query_log
-
-DROP TABLE t2, t5;
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/pbxt_locking.test b/mysql-test/suite/pbxt/t/pbxt_locking.test
deleted file mode 100644
index cdc54df5441..00000000000
--- a/mysql-test/suite/pbxt/t/pbxt_locking.test
+++ /dev/null
@@ -1,128 +0,0 @@
-# This test covers various aspects of PBXT locking mechanism, including
-# internal permanent/temporary row locking and MySQL locking
-
-# SHOW PROCESSLIST has hardcoded "Writing to net" as state.
--- source include/not_embedded.inc
-
-# TEST: select for update test
-
-drop table if exists t1;
-create table t1 (id int, index (id)) engine = pbxt;
-insert into t1 values (1), (2), (3), (4), (5);
-begin;
-select * from t1 where id < 5 for update;
-
-connect (con1,localhost,root,,);
-
-connection con1;
-
-# this shouldn't lock
-# note this implies usage of the index, table scan will block
-update t1 set id = 8 where id = 5;
-
-# this should block
-send update t1 set id = 8 where id = 4;
-
-connection default;
-sleep 1;
-replace_column 1 x 3 x 6 x;
-show processlist;
-commit;
-
-connection con1;
-reap;
-select * from t1;
-
-# TEST: make sure no unneeded temporary locks are set
-
-connection default;
-
-drop table if exists t1;
-# notice absence of index
-create table t1 (id int) engine = pbxt;
-insert into t1 values (1), (2), (3), (4), (5);
-
-begin;
-# after this statement all rows should be unlocked
-select * from t1 where id > 10 for update;
-
-connection con1;
-# this shouldn't block
-update t1 set id = 8;
-
-connection default;
-commit;
-select * from t1;
-
-# TEST: last row temp->perm locking
-
-connection default;
-
-drop table if exists t1;
-create table t1 (id int, index (id)) engine = pbxt;
-insert into t1 values (1), (2), (3), (4), (5);
-
-begin;
-select * from t1 where id = 5 for update;
-
-connection con1;
-
-update t1 set id = 8 where id < 4;
-# this should block
-send update t1 set id = 8 where id = 5;
-
-connection default;
-sleep 1;
-replace_column 1 x 3 x 6 x;
-show processlist;
-commit;
-
-connection con1;
-reap;
-
-connection default;
-select * from t1;
-
-# TEST: select for update in auto-commit mode
-# although this is not a widely used case in practice, make sure it operates correctly
-
-connection default;
-
-drop table if exists t1;
-create table t1 (id int, index (id)) engine = pbxt;
-insert into t1 values (1), (2), (3), (4), (5);
-
-# auto-commit mode - should unlock immediately
-select * from t1 for update;
-
-connection con1;
-# this shouldn't block
-update t1 set id = 8;
-
-# TEST: same as before but from a stored routine
-
-connection default;
-
-drop table if exists t1;
-create table t1 (id int, index (id)) engine = pbxt;
-insert into t1 values (1), (2), (3), (4), (5);
-
-delimiter |;
-create procedure p1 ()
-begin
- select * from t1 for update;
-end|
-
-delimiter ;|
-call p1 ();
-
-connection con1;
-
-# this shouldn't block
-update t1 set id = 8;
-
---disable_query_log
-drop procedure p1;
-drop table t1;
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/pbxt_my_fail2.test b/mysql-test/suite/pbxt/t/pbxt_my_fail2.test
deleted file mode 100644
index a8baf637dad..00000000000
--- a/mysql-test/suite/pbxt/t/pbxt_my_fail2.test
+++ /dev/null
@@ -1,74 +0,0 @@
-# This test demonstrates how the flag OPTION_STATUS_NO_TRANS_UPDATE is
-# not correctly reset, and leads to an incorrect warning
-
-delimiter |;
-
---disable_warnings
-drop table if exists t4|
---enable_warnings
-create table t4 (
- a mediumint(8) unsigned not null auto_increment,
- b smallint(5) unsigned not null,
- c char(32) not null,
- primary key (a)
-) engine=myisam default charset=latin1|
-insert into t4 values (1, 2, 'oneword')|
-insert into t4 values (2, 2, 'anotherword')|
-
---disable_warnings
-drop table if exists t3|
---enable_warnings
-
-create table t3 ( x int unique ) engine=pbxt|
-
-create procedure bug7049_1()
-begin
- insert into t3 values (42);
- insert into t3 values (42);
-end|
-
-create procedure bug7049_2()
-begin
- declare exit handler for sqlexception
- select 'Caught it' as 'Result';
-
- call bug7049_1();
- select 'Missed it' as 'Result';
-end|
-
-create function bug7049_1()
- returns int
-begin
- insert into t3 values (42);
- insert into t3 values (42);
- return 42;
-end|
-
-create function bug7049_2()
- returns int
-begin
- declare x int default 0;
- declare continue handler for sqlexception
- set x = 1;
-
- set x = bug7049_1();
- return x;
-end|
-
-# This cause the following warning:
-# Warning 1196: Some non-transactional changed tables couldn't be rolled back
-# which is not correct
-# PMC - This bug was fixed in 5.1.12 (confirmed 2006-9-15).
-call bug7049_2()|
-
-drop procedure bug7049_1|
-drop function bug7049_1|
-drop procedure bug7049_2|
-drop function bug7049_2|
-
-delimiter ;|
-
---disable_query_log
-drop table t3, t4;
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/pbxt_ref_int.test b/mysql-test/suite/pbxt/t/pbxt_ref_int.test
deleted file mode 100644
index 483e461cb67..00000000000
--- a/mysql-test/suite/pbxt/t/pbxt_ref_int.test
+++ /dev/null
@@ -1,391 +0,0 @@
-# Test PBXT referential integrity
-
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
-
-CREATE TABLE t1
-(
- id INT PRIMARY KEY
-) ENGINE=pbxt; # PBXT: Instead of InnoDB
-
-CREATE TABLE t2
-(
- v INT,
- CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id)
-) ENGINE=pbxt; # PBXT: Instead of InnoDB
-
---error 1452
-INSERT INTO t2 VALUES(2);
-
-set foreign_key_checks = 0;
-drop table t1;
-set foreign_key_checks = 1;
-
---error 1452
-INSERT INTO t2 VALUES(2);
-
---disable_warnings
-drop table if exists parent, child, child_child;
---enable_warnings
-CREATE TABLE parent (
- id INT NOT NULL,
- PRIMARY KEY (id)
-) ENGINE=PBXT;
-
-CREATE TABLE child (
- id INT PRIMARY KEY,
- parent_id INT,
- INDEX par_ind (parent_id),
- FOREIGN KEY (parent_id) REFERENCES parent(id) ON DELETE SET NULL ON UPDATE SET NULL
-) ENGINE=PBXT;
-
-insert parent values(1);
-insert parent values(2);
-insert child values(100, 1);
-insert child values(200, 1);
-insert child values(300, 2);
-insert child values(400, 2);
-
-update parent set id = 3 where id = 1;
-
-select * from parent;
-select * from child order by id;
-
-delete from parent where id = 2;
-
-select * from parent;
-select * from child order by id;
-
-set foreign_key_checks = 0;
---disable_warnings
-drop table if exists parent, child, child_child;
---enable_warnings
-set foreign_key_checks = 1;
-
-CREATE TABLE parent (
- id INT NOT NULL,
- PRIMARY KEY (id)
-) ENGINE=PBXT;
-
-CREATE TABLE child (
- id INT PRIMARY KEY,
- parent_id INT,
- INDEX par_ind (parent_id),
- FOREIGN KEY (parent_id) REFERENCES parent(id) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=PBXT;
-
-CREATE TABLE child_child (
- id INT PRIMARY KEY,
- child_id INT,
- INDEX (child_id),
- FOREIGN KEY (child_id) REFERENCES child(id) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=PBXT;
-
-delete from parent;
-delete from child;
-delete from child_child;
-insert parent values(1);
-insert parent values(2);
-insert child values(100, 1);
-insert child values(200, 1);
-insert child values(300, 2);
-insert child values(400, 2);
-insert child_child values(1000, 100);
-insert child_child values(2000, 200);
-insert child_child values(3000, 300);
-insert child_child values(4000, 300);
-insert child_child values(5000, 400);
-
-select * from parent;
-select * from child order by id;
-select * from child_child;
-
-update parent set id = 3 where id = 1;
-
-select * from parent;
-select * from child order by id;
-
-delete from parent where id = 2;
-
-select * from parent;
-select * from child order by id;
-select * from child_child;
-
-set foreign_key_checks = 0;
---disable_warnings
-drop table if exists parent, child, child_child;
---enable_warnings
-set foreign_key_checks = 1;
-
-CREATE TABLE parent (
- id INT NOT NULL,
- PRIMARY KEY (id)
-) ENGINE=PBXT;
-
-CREATE TABLE child (
- id INT,
- parent_id INT,
- INDEX par_ind (parent_id),
- FOREIGN KEY (parent_id) REFERENCES parent(id)
-) ENGINE=PBXT;
-
-insert parent values(2);
-insert parent values(1);
-insert child values(100, 1);
-insert child values(200, 1);
-
---error 1451
-update parent set id = 3 where id = 1;
-
---error 1451
-delete from parent where id = 1;
-
-select * from parent;
-select * from child order by id;
-
-delete from child;
-
-insert child values(100, 1);
-insert child values(200, 1);
-
-create index child_ind on child(id);
-show create table child;
-drop index child_ind on child;
-show create table child;
-
-alter table parent add column c1 varchar(40);
-
-insert child values(2000, 2);
-
-select * from parent;
-select * from child order by id;
-
-show create table parent;
-
-alter table parent drop column c1;
-
-select * from parent;
-show create table parent;
-
-alter table parent add column c1 int;
-
-alter table parent drop column id;
-
---error 1215
-insert child values(300, 1);
-
-alter table parent add column id int, add index (id);
-
-select * from parent;
-
---error 1452
-insert child values(300, 1);
-
-update parent set id = 1 where id is null limit 1;
-update parent set id = 2 where id is null limit 1;
-
-insert child values(300, 1);
-
-select * from parent order by id;
-select * from child order by id;
-
-show create table parent;
-show create table child;
-
-alter table child add column c1 varchar(40);
-
-insert child values(400, 1, "asd");
-
-select * from parent order by id;
-select * from child order by id;
-
-alter table child drop key par_ind, drop column parent_id, add column parent_id int, add key par_ind (parent_id);
-
-insert child (id, parent_id, c1) values(500, 1, "asd");
-
---disable_warnings
-drop table if exists child, parent;
---enable_warnings
-CREATE TABLE parent (
- id INT NOT NULL,
- PRIMARY KEY (id)
-) ENGINE=PBXT;
-
-CREATE TABLE child (
- id INT,
- parent_id INT,
- INDEX par_ind (parent_id),
- FOREIGN KEY (parent_id)
- REFERENCES parent(id) ON DELETE CASCADE
-) ENGINE=PBXT;
-
-show create table parent;
-show create table child;
-
-insert parent values(1);
-insert child values(100, 1);
---error 1452
-insert child values(102, 2);
-
-set foreign_key_checks = 0;
---disable_warnings
-drop table if exists parent, child;
---enable_warnings
-set foreign_key_checks = 1;
-
-CREATE TABLE parent (
- id INT NOT NULL,
- PRIMARY KEY (id)
-) ENGINE=PBXT;
-
-CREATE TABLE child (
- id INT,
- parent_id INT,
- INDEX par_ind (parent_id),
- FOREIGN KEY (parent_id)
- REFERENCES parent(glump) ON DELETE CASCADE
-) ENGINE=PBXT;
-
-insert parent values(1);
---error 1215
-insert child values(100, 1);
-
---disable_warnings
-drop table if exists test1;
---enable_warnings
-CREATE TABLE test1 (
- id INT NOT NULL,
- c1 varchar(30),
- PRIMARY KEY (id)
-) ENGINE=pbxt;
-
-insert test1 values(1, "asd");
-insert test1 values(2, "qwer");
-
-alter table test1 drop column id, drop primary key, add column id int;
-
-show create table test1;
-select * from test1;
-
-# Test some extended table and column names.
---disable_warnings
-drop table if exists ``, t2;
---enable_warnings
-
-create table `` (
- id int primary key
-) engine=pbxt;
-
-CREATE TABLE t2
-(
- int NOT NULL,
- cc varchar(20),
- foreign key () references `` (id),
- index ()
-) engine=pbxt;
-
-insert `` values (1);
-insert t2 values (1, "asd");
-
-select * from ``;
-
-set foreign_key_checks = 0;
---disable_warnings
-drop table if exists test1, parent, child, child_child, ``, t2;
---enable_warnings
-set foreign_key_checks = 1;
-
-SET CHARACTER SET koi8r;
-SET NAMES binary;
-
-create table `тест` (
- id int primary key
-) engine=pbxt;
-
-
-CREATE TABLE `2тест` (
- `тест` int,
- foreign key (`тест`) references `тест`(id),
- index (`тест`)
-) engine=pbxt;
-
-select * from `тест`;
-select * from `2тест`;
-
-set foreign_key_checks = 0;
---disable_warnings
-drop table if exists `тест`, `2тест`;
---enable_warnings
-set foreign_key_checks = 1;
-
-# Test processing of foreign_key_checks flag
-
---disable_warnings
-drop table if exists t2, t1;
---enable_warnings
-
-set foreign_key_checks = 1;
---error 1005
-CREATE TABLE t2 (s1 INT DEFAULT NULL, FOREIGN KEY (s1) REFERENCES t1 (s1));
-
-set foreign_key_checks = 0;
-CREATE TABLE t2 (s1 INT DEFAULT NULL, FOREIGN KEY (s1) REFERENCES t1 (s1));
-
-set foreign_key_checks = 1;
---error 1452
-insert into t2 values (1);
-
-set foreign_key_checks = 0;
-insert into t2 values (1);
-
-CREATE TABLE t1 (s1 INT PRIMARY KEY);
-set foreign_key_checks = 1;
---error 1217
-DROP TABLE t1;
-set foreign_key_checks = 0;
-DROP TABLE t1;
-DROP TABLE t2;
-
-# check that table with self-refs can be dropped
-set foreign_key_checks = 1;
-CREATE TABLE t1 (s1 INT DEFAULT NULL, s2 INT DEFAULT NULL, s3 INT DEFAULT NULL, s4 INT DEFAULT NULL,
- INDEX (s1), INDEX (s2), INDEX (s3), INDEX (s4),
- FOREIGN KEY (s1) REFERENCES t1 (s2),
- FOREIGN KEY (s2) REFERENCES t1 (s3),
- FOREIGN KEY (s3) REFERENCES t1 (s4));
-DROP TABLE t1;
-
-# .. but only if there are no other refs
-CREATE TABLE t1 (s1 INT DEFAULT NULL, s2 INT DEFAULT NULL, s3 INT DEFAULT NULL, s4 INT DEFAULT NULL,
- INDEX (s1), INDEX (s2), INDEX (s3), INDEX (s4),
- FOREIGN KEY (s1) REFERENCES t1 (s2),
- FOREIGN KEY (s2) REFERENCES t1 (s3),
- FOREIGN KEY (s3) REFERENCES t1 (s4));
-CREATE TABLE t2 (s1 INT DEFAULT NULL, FOREIGN KEY (s1) REFERENCES t1 (s1));
---error 1217
-DROP TABLE t1;
-DROP TABLE t2;
-DROP TABLE t1;
-
-CREATE TABLE t2 (s1 INT, INDEX (s1));
-
-# this test is temporary disabled because the server error message includes temporary file name
-# and thus differs every time, so it's impossible to get fixed text output
-
-#set foreign_key_checks = 1;
-#--error 1005
-#ALTER TABLE t2 ADD FOREIGN KEY (s1) REFERENCES t1 (s1);
-
-set foreign_key_checks = 0;
-ALTER TABLE t2 ADD FOREIGN KEY (s1) REFERENCES t1 (s1);
-
---disable_warnings
-DROP TABLE IF EXISTS t2, t1;
---enable_warnings
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-set foreign_key_checks = 1;
-
diff --git a/mysql-test/suite/pbxt/t/pbxt_transactions.test b/mysql-test/suite/pbxt/t/pbxt_transactions.test
deleted file mode 100644
index 65a008ff7eb..00000000000
--- a/mysql-test/suite/pbxt/t/pbxt_transactions.test
+++ /dev/null
@@ -1,540 +0,0 @@
-# We cannot run mysqldump against embedded server.
--- source include/not_embedded.inc
-
---disable_warnings
-drop table if exists t1, t2, t3;
---enable_warnings
-
-create table `t1` (`id` int( 11 ) not null ,primary key ( `id` )) engine = pbxt;
-insert into `t1`values ( 1 ) ;
-create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) engine = pbxt;
-insert into `t2`values ( 1 ) ;
-create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) engine = pbxt;
-insert into `t3`values ( 1 ) ;
-
-select * from t1;
-select * from t2;
-select * from t3;
-
---error 1451
-update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
-
-select * from t1;
-select * from t2;
-select * from t3;
-
---error 1451
-delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
-
-select * from t1;
-select * from t2;
-select * from t3;
-
---disable_warnings
-drop table if exists t3, t2, t1;
---enable_warnings
-
-create table t1 (id int primary key) engine = pbxt;
-create table t2 (id int) engine = pbxt;
-
-insert into t1 values ( 1 ) ;
-insert into t1 values ( 2 ) ;
-insert into t2 values ( 1 ) ;
-insert into t2 values ( 2 ) ;
-
-select * from t1;
-select * from t2;
-
-# This statement is returns an error calls ha_autocommit_or_rollback():
---error ER_DUP_ENTRY
-update t1 set t1.id=1 where t1.id=2;
-
-select * from t1;
-select * from t2;
-
-# This statement is returns no error and calls ha_autocommit_or_rollback():
-update t1,t2 set t1.id=3, t2.id=3 where t1.id=2 and t2.id = t1.id;
-
-select * from t1;
-select * from t2;
-
-# But this statement returns an error and does not call ha_autocommit_or_rollback():
---error ER_DUP_ENTRY
-update t1,t2 set t1.id=1, t2.id=1 where t1.id=3 and t2.id = t1.id;
-
-select * from t1;
-select * from t2;
-
---error ER_DUP_ENTRY
-update t1 set t1.id=1 where t1.id=3;
-
-select * from t1;
-select * from t2;
-
-# rename will generate an error if MySQL thinks a transaction is
-# still running.
-
---disable_warnings
-drop table if exists t1, t2, t3;
---enable_warnings
-
-create table t1 (c1 int);
-insert t1 values (1);
-select * from t1;
-rename table t1 to t2;
-
-# The select below will not include the data if the INSERT statement
-# is not committed on time. By doing a SELECT FOR UPDATE, we
-# make sure the SELECT transaction waits (I think)!
-
-create table t1 (a text character set utf8, b text character set latin1);
-insert t1 values (0x4F736E616272C3BC636B, 0x4BF66C6E);
-select * from t1;
---exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ test
---exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/t1.sql
---exec $MYSQL_IMPORT test $MYSQLTEST_VARDIR/tmp/t1.txt
-select * from t1 for update;
-
-# Test nested start_stmt() calls
-
---disable_warnings
-drop table if exists t1,t3;
---enable_warnings
-create table t1 (
- id char(16) not null default '',
- data int not null
-);
-
-delimiter |;
-
-insert into t1 values ("foo", 3), ("bar", 2), ("zip", 5), ("zap", 1)|
-
-create table t3 (
- v char(16) not null primary key,
- c int unsigned not null
-)|
-
-create function getcount(s char(16)) returns int
-begin
- declare x int;
-
- select count(*) into x from t3 where v = s;
- if x = 0 then
- insert into t3 values (s, 1);
- else
- update t3 set c = c+1 where v = s;
- end if;
- return x;
-end|
-
-select * from t1|
-select * from t3|
-
-select * from t1 where data = getcount("bar")|
-
-select * from t1|
-select * from t3|
-
-drop table t1,t3|
-
-delimiter ;|
-
-drop function getcount;
-
-# This test forces a begin transaction in start_stmt()
-
-drop tables if exists t1;
-create table t1 (id int);
-lock tables t1 write;
-insert t1 values (1);
-insert t1 values (2);
-select id from t1;
-unlock tables;
-select id from t1;
-
-# This demonstratrates the behavior of locked tables
-
-DROP TABLE if exists t1;
-create table t1 (id int primary key);
-insert t1 values (100);
-LOCK TABLES t1 WRITE;
-insert t1 values (98);
---error ER_DUP_ENTRY
-insert into t1 values (99),(100);
-select id from t1;
-UNLOCK TABLES;
-select id from t1;
-
-# And this is how it goes with a transaction:
-
-DROP TABLE if exists t1;
-create table t1 (id int primary key);
-insert t1 values (100);
-begin;
-insert t1 values (98);
---error ER_DUP_ENTRY
-insert into t1 values (99),(100);
-select id from t1;
-rollback;
-select id from t1;
-
-
-# And this without lock or transaction:
-
-DROP TABLE if exists t1;
-create table t1 (id int primary key);
-insert t1 values (100);
-insert t1 values (98);
---error ER_DUP_ENTRY
-insert into t1 values (99),(100);
-select id from t1;
-
-# And with multiple tables
-
-DROP TABLE if exists t1, t2;
-create table t1 (id int primary key);
-insert t1 values (100);
-create table t2 (id int primary key);
-insert t2 values (100);
-
-
-LOCK TABLES t1 WRITE, t2 READ;
-insert t1 values (98);
-select * from t1, t2 where t1.id = t2.id;
-insert t1 values (97);
---error ER_DUP_ENTRY
-insert into t1 values (99),(100);
-select id from t1;
-UNLOCK TABLES;
-select id from t1;
-
-DROP TABLE t1;
-
-# Test ALTER TABLE and UPDATE together
-
---disable_warnings
-drop table if exists t1, t2, t3;
---enable_warnings
-create table t1 (a int, b int);
-insert into t1 values (1, 2), (2, 3), (3, 4);
-create table t2 (a int);
-insert into t2 values (10), (20), (30);
-create view v1 as select a as b, a/10 as a from t2;
-
-connect (locker,localhost,root,,test);
-connection locker;
-lock table t1 write;
-
-connect (changer,localhost,root,,test);
-connection changer;
-send alter table t1 add column c int default 100 after a;
-
-connect (updater,localhost,root,,test);
-connection updater;
-sleep 2;
-send update t1, v1 set t1.b=t1.a+t1.b+v1.b where t1.a=v1.a;
-
-connection locker;
-sleep 2;
-unlock tables;
-
-connection changer;
-reap;
-
-connection updater;
-reap;
-select * from t1;
-select * from t2;
-drop view v1;
-drop table t1, t2;
-
-# It is possible that the sweeper gets stuck because
-#it has no dictionary information!
-# As in the example below.
-
---disable_warnings
-drop table if exists t1, t4;
---enable_warnings
-
-create table t1 (
- a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(64) default ' '
-) engine=pbxt;
-
-insert t1 values ("a1", "a2", "b", "c", "d", "dummy");
-
-create table t4 (
- pk_col int auto_increment primary key, a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(64) default ' '
-) engine=pbxt;
-
-insert into t4 (a1, a2, b, c, d, dummy) select * from t1;
-
-create index idx12672_0 on t4 (a1);
-create index idx12672_1 on t4 (a1,a2,b,c);
-create index idx12672_2 on t4 (a1,a2,b);
-analyze table t1;
-
-# Rename between different databases if triggers exist should fail
-use test;
---disable_warnings
-drop table if exists t1;
-drop database if exists mysqltest;
---enable_warnings
-
-create database mysqltest;
-use mysqltest;
-create table t1 (id int);
-create trigger t1_bi before insert on t1 for each row set @a:=new.id;
-insert into t1 values (101);
---error ER_TRG_IN_WRONG_SCHEMA, 1005
-alter table t1 rename to test.t1, add column val int default 0;
-
-drop database mysqltest;
-use test;
-
-# Various update/statement boundary tests
-
-create table t9 (id int primary key auto_increment, fk int, index (fk)) engine=pbxt;
-insert into t9 (id) values (null),(null),(null),(null),(null);
-update t9 set fk=69 where fk is null order by id limit 1;
-SELECT * from t9;
-drop table t9;
-
-create table t9 (id int primary key auto_increment, fk int, index (fk)) engine=pbxt;
-lock tables t9 write;
-insert into t9 (id) values (null),(null),(null),(null),(null);
-update t9 set fk=69 where fk is null order by id limit 1;
-SELECT * from t9 order by id;
-unlock tables;
-SELECT * from t9 order by id;
-drop table t9;
-
-create table t9 (id int primary key auto_increment, fk int, index (fk)) engine=pbxt;
-
-delimiter |;
-
-create procedure auto_test()
-begin
-insert into t9 (id) values (null),(null),(null),(null),(null);
-update t9 set fk=69 where fk is null order by id limit 1;
-SELECT * from t9;
-end|
-
-delimiter ;|
-
-call auto_test();
-SELECT * from t9;
-
-drop procedure auto_test;
-drop table t9;
-
-SET AUTOCOMMIT=0;
-
-create table t9 (id int primary key auto_increment, fk int, index (fk)) engine=pbxt;
-insert into t9 (id) values (null),(null),(null),(null),(null);
-update t9 set fk=69 where fk is null order by id limit 1;
-SELECT * from t9;
-drop table t9;
-
-create table t9 (id int primary key auto_increment, fk int, index (fk)) engine=pbxt;
-lock tables t9 write;
-insert into t9 (id) values (null),(null),(null),(null),(null);
-update t9 set fk=69 where fk is null order by id limit 1;
-SELECT * from t9;
-unlock tables;
-SELECT * from t9;
-drop table t9;
-
-create table t9 (id int primary key auto_increment, fk int, index (fk)) engine=pbxt;
-
-delimiter |;
-
-create procedure auto_test()
-begin
-insert into t9 (id) values (null),(null),(null),(null),(null);
-update t9 set fk=69 where fk is null order by id limit 1;
-SELECT * from t9;
-end|
-
-delimiter ;|
-
-call auto_test();
-SELECT * from t9;
-
-drop procedure auto_test;
-drop table t9;
-
-SET AUTOCOMMIT=1;
-
-SET AUTOCOMMIT=0;
-
-create table t9 (id int primary key auto_increment, fk int, index (fk)) engine=pbxt;
-insert into t9 (id) values (null),(null),(null),(null),(null);
-update t9 set fk=69 where fk is null order by id limit 1;
-SELECT * from t9;
-commit;
-SELECT * from t9;
-drop table t9;
-
-create table t9 (id int primary key auto_increment, fk int, index (fk)) engine=pbxt;
-lock tables t9 write;
-insert into t9 (id) values (null),(null),(null),(null),(null);
-update t9 set fk=69 where fk is null order by id limit 1;
-SELECT * from t9;
-unlock tables;
-SELECT * from t9;
-commit;
-SELECT * from t9;
-drop table t9;
-
-create table t9 (id int primary key auto_increment, fk int, index (fk)) engine=pbxt;
-
-delimiter |;
-
-create procedure auto_test()
-begin
-insert into t9 (id) values (null),(null),(null),(null),(null);
-update t9 set fk=69 where fk is null order by id limit 1;
-SELECT * from t9;
-end|
-
-delimiter ;|
-
-call auto_test();
-SELECT * from t9;
-commit;
-SELECT * from t9;
-
-drop procedure auto_test;
-drop table t9;
-
-SET AUTOCOMMIT=1;
-
-# Create table involving a procedure
-# This tests the handling of transactions an statements
-
-delimiter |;
-
---disable_warnings
-drop table if exists t1,t3|
---enable_warnings
-
-create table t1 (
- id char(16) not null default '',
- data int not null
-)|
-insert t1 value ("one", 1), ("two", 2)|
-
---disable_warnings
-drop function if exists bug12472|
---enable_warnings
-create function bug12472() returns int
-begin
-declare a int;
-declare b int;
-set a = (select count(*) from t1);
-set b = (select count(*) from t1);
-return (a + b);
-end|
-# Check case when function is used directly
-create table t3 as select bug12472() as i|
-show create table t3|
-select * from t3|
-drop table t3|
-# Check case when function is used indirectly through view
-create view v1 as select bug12472() as j|
-create table t3 as select * from v1|
-show create table t3|
-select * from t3|
-drop table t3|
-drop view v1|
-drop function bug12472|
-
-drop table t1|
-
-# Test procedures and transactions
-
---disable_warnings
-drop table if exists t1, t3|
-drop procedure if exists t3_update|
-drop function if exists t3_update|
---enable_warnings
-
-create table t3 (a smallint primary key) engine=pbxt|
-
-insert into t3 (a) values (1)|
-
-create procedure t3_update()
- deterministic
-begin
- declare continue handler for 1062 -- ER_DUP_ENTRY
- select 'Outer (bad)' as 't3_update';
-
- begin
- declare continue handler for 1062 -- ER_DUP_ENTRY
- select 'Inner (good)' as 't3_update';
-
- insert into t3 values (1);
- end;
-end|
-
-call t3_update()|
-
-begin|
-call t3_update()|
-commit|
-
---disable_warnings
-drop table if exists t3|
-drop procedure if exists t3_update|
-drop function if exists t3_update|
---enable_warnings
-
-create table t3 (a smallint primary key) engine=pbxt|
-insert into t3 (a) values (40)|
-insert into t3 (a) values (50)|
-
-create function t3_update() returns int
-begin
- insert into t3 values (10);
- insert into t3 values (40);
- insert into t3 values (500);
- return 100;
-end|
-
-select * from t3|
-
-connect (conn1,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK)|
-connect (conn2,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK)|
-
-connection conn1|
-
-begin|
-insert into t3 values (10)|
-
-connection conn2|
-# This will hang (so use send - reap later)
-send select t3_update()|
-
-connection conn1|
-# This should stop the hanger:
-rollback|
-
-connection conn2|
--- error 1062
-reap|
-select * from t3|
-
---disable_warnings
-drop function t3_update|
-drop table if exists t1, t2, t3, t4|
---enable_warnings
-
---disable_query_log
-drop database pbxt|
---enable_query_log
-
-disconnect conn1|
-disconnect conn2|
-
-delimiter ;|
-
diff --git a/mysql-test/suite/pbxt/t/pbxt_updates.test b/mysql-test/suite/pbxt/t/pbxt_updates.test
deleted file mode 100644
index 4183d148fcc..00000000000
--- a/mysql-test/suite/pbxt/t/pbxt_updates.test
+++ /dev/null
@@ -1,111 +0,0 @@
-# Test in-place updates
-
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
-
-CREATE TABLE t1
-(
- id INT PRIMARY KEY,
- number INT,
- string VARCHAR(20),
- UNIQUE INDEX (number)
-) ENGINE=pbxt;
-
-truncate table t1;
-insert t1 values (1, 1, 'abc');
-
-begin;
-update t1 set string = 'def' where id = 1;
-update t1 set string = 'HIJ' where id = 1;
-select * from t1 where id = 1;
-select * from t1 where number = 1;
-update t1 set string = '123', number=2 where id = 1;
-select * from t1 where id = 1;
-select * from t1 where number = 2;
-commit;
-
--- error 1062
-insert t1 values (2, 2, 'abc');
-insert t1 values (2, 3, 'abc');
-select * from t1 order by id;
-
-begin;
-update t1 set number = 1 where id = 1;
-select * from t1 order by id;
-
--- error 1062
-update t1 set number = 3 where id = 1;
-
-select * from t1 where id = 1;
-select * from t1 where id = 2;
-select * from t1 where number = 1;
-select * from t1 where number = 3;
-select * from t1 order by id;
-
-commit;
-select * from t1 order by id;
-
-drop table t1;
-
-CREATE TABLE t1
-(
- id INT PRIMARY KEY,
- number INT,
- string VARCHAR(300),
- UNIQUE INDEX (number)
-) ENGINE=pbxt;
-
-truncate table t1;
-insert t1 values (1, 1, 'abc01234567890123456789012345678901234567890123456789$$$');
-
-begin;
-update t1 set string = 'def01234567890123456789012345678901234567890123456789---' where id = 1;
-update t1 set string = 'HIJ01234567890123456789012345678901234567890123456789***' where id = 1;
-select * from t1 where id = 1;
-select * from t1 where number = 1;
-update t1 set string = '12301234567890123456789012345678901234567890123456789+++', number=2 where id = 1;
-select * from t1 where id = 1;
-select * from t1 where number = 2;
-commit;
-
--- error 1062
-insert t1 values (2, 2, 'abc01234567890123456789012345678901234567890123456789===');
-insert t1 values (2, 3, 'abc01234567890123456789012345678901234567890123456789+++');
-select * from t1 order by id;
-
-begin;
-update t1 set number = 1 where id = 1;
-select * from t1 order by id;
-
--- error 1062
-update t1 set number = 3 where id = 1;
-
-select * from t1 where id = 1;
-select * from t1 where id = 2;
-select * from t1 where number = 1;
-select * from t1 where number = 3;
-select * from t1 order by id;
-
-rollback;
-select * from t1 order by id;
-
-drop table t1;
-
-# insert + update in the same trx that changed record type caused a problem
-
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 ( id int, name varchar(300)) engine=pbxt;
-
-begin;
-insert t1(id, name) values(1, "aaa");
-update t1 set name=REPEAT('A', 300) where id = 1;
-commit;
-select * from t1;
-
-drop table t1;
-
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/pbxt_xa.test b/mysql-test/suite/pbxt/t/pbxt_xa.test
deleted file mode 100644
index a9d1c5c38e8..00000000000
--- a/mysql-test/suite/pbxt/t/pbxt_xa.test
+++ /dev/null
@@ -1,23 +0,0 @@
--- source include/have_innodb.inc
-
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
-
-#
-# bug lp:544173, xa crash with two 2pc-capable storage engines without binlog
-#
-
-CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
-CREATE TABLE t2 (b INT PRIMARY KEY) ENGINE=pbxt;
-BEGIN;
-# verify that binlog is off
-SELECT @@log_bin;
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (2);
-COMMIT;
-select * from t1;
-select * from t2;
-drop table t1, t2;
-drop database pbxt;
-
diff --git a/mysql-test/suite/pbxt/t/pbxt_xa_binlog.test b/mysql-test/suite/pbxt/t/pbxt_xa_binlog.test
deleted file mode 100644
index 4a4578a5595..00000000000
--- a/mysql-test/suite/pbxt/t/pbxt_xa_binlog.test
+++ /dev/null
@@ -1,32 +0,0 @@
---source include/have_innodb.inc
---source include/have_log_bin.inc
-
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
-
-SET binlog_format = 'mixed';
-
-CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
-CREATE TABLE t2 (b INT PRIMARY KEY) ENGINE=pbxt;
-BEGIN;
-# verify that binlog is on
-SELECT @@log_bin;
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (2);
-COMMIT;
-select * from t1;
-select * from t2;
-
-# Test 2-phase commit when we disable binlogging.
-SET sql_log_bin = 0;
-BEGIN;
-INSERT INTO t1 VALUES (3);
-INSERT INTO t2 VALUES (4);
-COMMIT;
-select * from t1 order by a;
-select * from t2 order by b;
-
-drop table t1, t2;
-drop database pbxt;
-
diff --git a/mysql-test/suite/pbxt/t/perror.test b/mysql-test/suite/pbxt/t/perror.test
deleted file mode 100644
index a4b99d8aa22..00000000000
--- a/mysql-test/suite/pbxt/t/perror.test
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Check if the variable MY_PERROR is set
-#
---require r/have_perror.require
-disable_query_log;
-eval select LENGTH("$MY_PERROR") > 0 as "have_perror";
-enable_query_log;
-
---exec $MY_PERROR 150 > /dev/null
---exec $MY_PERROR --silent 120 > /dev/null
-
-#
-# Bug#16561 Unknown ERROR msg "ERROR 1186 (HY000): Binlog closed" by perror
-#
-
-# Test with error code 10000 as it's a common "unknown error"
-# As there is no error code defined for 10000, expect error
---error 1
---exec $MY_PERROR 10000 2>&1
diff --git a/mysql-test/suite/pbxt/t/preload.test b/mysql-test/suite/pbxt/t/preload.test
deleted file mode 100644
index 8404346cc7a..00000000000
--- a/mysql-test/suite/pbxt/t/preload.test
+++ /dev/null
@@ -1,105 +0,0 @@
-#
-# Testing of PRELOAD
-#
-
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
-
-
-create table t1 (
- a int not null auto_increment,
- b char(16) not null,
- primary key (a),
- key (b)
-);
-
-create table t2(
- a int not null auto_increment,
- b char(16) not null,
- primary key (a),
- key (b)
-);
-
-insert into t1(b) values
- ('test0'),
- ('test1'),
- ('test2'),
- ('test3'),
- ('test4'),
- ('test5'),
- ('test6'),
- ('test7');
-
-insert into t2(b) select b from t1;
-insert into t1(b) select b from t2;
-insert into t2(b) select b from t1;
-insert into t1(b) select b from t2;
-insert into t2(b) select b from t1;
-insert into t1(b) select b from t2;
-insert into t2(b) select b from t1;
-insert into t1(b) select b from t2;
-insert into t2(b) select b from t1;
-insert into t1(b) select b from t2;
-insert into t2(b) select b from t1;
-insert into t1(b) select b from t2;
-insert into t2(b) select b from t1;
-insert into t1(b) select b from t2;
-insert into t2(b) select b from t1;
-insert into t1(b) select b from t2;
-insert into t2(b) select b from t1;
-insert into t1(b) select b from t2;
-
-select count(*) from t1;
-select count(*) from t2;
-
-flush tables; flush status;
-show status like "key_read%";
-
-select count(*) from t1 where b = 'test1';
-show status like "key_read%";
-select count(*) from t1 where b = 'test1';
-show status like "key_read%";
-
-flush tables; flush status;
-select @@preload_buffer_size;
-load index into cache t1;
-show status like "key_read%";
-select count(*) from t1 where b = 'test1';
-show status like "key_read%";
-
-flush tables; flush status;
-show status like "key_read%";
-set session preload_buffer_size=256*1024;
-select @@preload_buffer_size;
-load index into cache t1 ignore leaves;
-show status like "key_read%";
-select count(*) from t1 where b = 'test1';
-show status like "key_read%";
-
-flush tables; flush status;
-show status like "key_read%";
-set session preload_buffer_size=1*1024;
-select @@preload_buffer_size;
-load index into cache t1, t2 key (primary,b) ignore leaves;
-show status like "key_read%";
-select count(*) from t1 where b = 'test1';
-select count(*) from t2 where b = 'test1';
-show status like "key_read%";
-
-flush tables; flush status;
-show status like "key_read%";
-load index into cache t3, t2 key (primary,b) ;
-show status like "key_read%";
-
-flush tables; flush status;
-show status like "key_read%";
-load index into cache t3 key (b), t2 key (c) ;
-show status like "key_read%";
-
-drop table t1, t2;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/ps_10nestset.test b/mysql-test/suite/pbxt/t/ps_10nestset.test
deleted file mode 100644
index 67be17d448c..00000000000
--- a/mysql-test/suite/pbxt/t/ps_10nestset.test
+++ /dev/null
@@ -1,76 +0,0 @@
-###############################################
-# #
-# Prepared Statements test on #
-# "nested sets" representing hierarchies #
-# #
-###############################################
-
-# Source: http://kris.koehntopp.de/artikel/sql-self-references (dated 1999)
-# Source: http://dbmsmag.com/9603d06.html (dated 1996)
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-# "Nested Set": This table represents an employee list with a hierarchy tree.
-# The tree is not modeled by "parent" links but rather by showing the "left"
-# and "right" border of any person's "region". By convention, "l" < "r".
-# As it is a tree, these "regions" of two persons A and B are either disjoint,
-# or A's region is completely contained in B's (B.l < A.l < A.r < B.r:
-# B is A's boss), or vice versa.
-# Any other overlaps violate the model. See the references for more info.
-
-create table t1 (
- id INTEGER AUTO_INCREMENT PRIMARY KEY,
- emp CHAR(10) NOT NULL,
- salary DECIMAL(6,2) NOT NULL,
- l INTEGER NOT NULL,
- r INTEGER NOT NULL);
-
-prepare st_ins from 'insert into t1 set emp = ?, salary = ?, l = ?, r = ?';
-
-# Initial employee list:
-# Jerry ( Bert () Chuck ( Donna () Eddie () Fred () ) )
-set @arg_nam= 'Jerry'; set @arg_sal= 1000; set @arg_l= 1; set @arg_r= 12;
-execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ;
-set @arg_nam= 'Bert'; set @arg_sal= 900; set @arg_l= 2; set @arg_r= 3;
-execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ;
-set @arg_nam= 'Chuck'; set @arg_sal= 900; set @arg_l= 4; set @arg_r= 11;
-execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ;
-set @arg_nam= 'Donna'; set @arg_sal= 800; set @arg_l= 5; set @arg_r= 6;
-execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ;
-set @arg_nam= 'Eddie'; set @arg_sal= 700; set @arg_l= 7; set @arg_r= 8;
-execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ;
-set @arg_nam= 'Fred'; set @arg_sal= 600; set @arg_l= 9; set @arg_r= 10;
-execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ;
-
-select * from t1;
-
-# Three successive raises, each one is 100 units for managers, 10 percent for others.
-prepare st_raise_base from 'update t1 set salary = salary * ( 1 + ? ) where r - l = 1';
-prepare st_raise_mgr from 'update t1 set salary = salary + ? where r - l > 1';
-let $1= 3;
-set @arg_percent= .10;
-set @arg_amount= 100;
-while ($1)
-{
- execute st_raise_base using @arg_percent;
- execute st_raise_mgr using @arg_amount;
- dec $1;
-}
-
-select * from t1 order by id; # PBXT: Require for consistent result
-
-# Now, increase salary to a multiple of 50 (checks for bug#6138)
-prepare st_round from 'update t1 set salary = salary + ? - ( salary MOD ? )';
-set @arg_round= 50;
-execute st_round using @arg_round, @arg_round;
-
-select * from t1 order by id; # PBXT: Require for consistent result
-
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/ps_11bugs.test b/mysql-test/suite/pbxt/t/ps_11bugs.test
deleted file mode 100644
index 1f27d24b8cd..00000000000
--- a/mysql-test/suite/pbxt/t/ps_11bugs.test
+++ /dev/null
@@ -1,183 +0,0 @@
-###############################################
-# #
-# Prepared Statements #
-# re-testing bug DB entries #
-# #
-# The bugs are reported as "closed". #
-# Command sequences taken from bug report. #
-# No other test contains the bug# as comment. #
-# #
-# Tests drop/create tables 't1', 't2', ... #
-# #
-###############################################
-
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
-
-# bug#1180: optimized away part of WHERE clause cause incorect prepared satatement results
-
-CREATE TABLE t1(session_id char(9) NOT NULL);
-INSERT INTO t1 VALUES ("abc");
-SELECT * FROM t1;
-
-prepare st_1180 from 'SELECT * FROM t1 WHERE ?="1111" and session_id = "abc"';
-
-# Must not find a row
-set @arg1= 'abc';
-execute st_1180 using @arg1;
-
-# Now, it should find one row
-set @arg1= '1111';
-execute st_1180 using @arg1;
-
-# Back to non-matching
-set @arg1= 'abc';
-execute st_1180 using @arg1;
-
-drop table t1;
-
-# end of bug#1180
-
-
-# bug#1644: Insertion of more than 3 NULL columns with parameter binding fails
-
-# Using prepared statements, insertion of more than three columns with NULL
-# values fails to insert additional NULLS. After the third column NULLS will
-# be inserted into the database as zeros.
-# First insert four columns of a value (i.e. 22) to verify binding is working
-# correctly. Then Bind to each columns bind parameter an is_null value of 1.
-# Then insert four more columns of integers, just for sanity.
-# A subsequent select on the server will result in this:
-# mysql> select * from foo_dfr;
-# +------+------+------+------+
-# | col1 | col2 | col3 | col4 |
-# +------+------+------+------+
-# | 22 | 22 | 22 | 22 |
-# | NULL | NULL | NULL | 0 |
-# | 88 | 88 | 88 | 88 |
-# +------+------+------+------+
-
-# Test is extended to more columns - code stores bit vector in bytes.
-
-create table t1 (
- c_01 char(6), c_02 integer, c_03 real, c_04 int(3), c_05 varchar(20),
- c_06 date, c_07 char(1), c_08 real, c_09 int(11), c_10 time,
- c_11 char(6), c_12 integer, c_13 real, c_14 int(3), c_15 varchar(20),
- c_16 date, c_17 char(1), c_18 real, c_19 int(11), c_20 text);
-# Do not use "timestamp" type, because it has a non-NULL default as of 4.1.2
-
-prepare st_1644 from 'insert into t1 values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
-
-set @arg01= 'row_1'; set @arg02= 1; set @arg03= 1.1; set @arg04= 111; set @arg05= 'row_one';
-set @arg06= '2004-10-12'; set @arg07= '1'; set @arg08= 1.1; set @arg09= '100100100'; set @arg10= '12:34:56';
-set @arg11= 'row_1'; set @arg12= 1; set @arg13= 1.1; set @arg14= 111; set @arg15= 'row_one';
-set @arg16= '2004-10-12'; set @arg17= '1'; set @arg18= 1.1; set @arg19= '100100100'; set @arg20= '12:34:56';
-execute st_1644 using @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09, @arg10,
- @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, @arg17, @arg18, @arg19, @arg20;
-
-set @arg01= NULL; set @arg02= NULL; set @arg03= NULL; set @arg04= NULL; set @arg05= NULL;
-set @arg06= NULL; set @arg07= NULL; set @arg08= NULL; set @arg09= NULL; set @arg10= NULL;
-set @arg11= NULL; set @arg12= NULL; set @arg13= NULL; set @arg14= NULL; set @arg15= NULL;
-set @arg16= NULL; set @arg17= NULL; set @arg18= NULL; set @arg19= NULL; set @arg20= NULL;
-execute st_1644 using @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09, @arg10,
- @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, @arg17, @arg18, @arg19, @arg20;
-
-set @arg01= 'row_3'; set @arg02= 3; set @arg03= 3.3; set @arg04= 333; set @arg05= 'row_three';
-set @arg06= '2004-10-12'; set @arg07= '3'; set @arg08= 3.3; set @arg09= '300300300'; set @arg10= '12:34:56';
-set @arg11= 'row_3'; set @arg12= 3; set @arg13= 3.3; set @arg14= 333; set @arg15= 'row_three';
-set @arg16= '2004-10-12'; set @arg17= '3'; set @arg18= 3.3; set @arg19= '300300300'; set @arg20= '12:34:56';
-execute st_1644 using @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09, @arg10,
- @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, @arg17, @arg18, @arg19, @arg20;
-
-select * from t1;
-
-drop table t1;
-
-# end of bug#1644
-
-
-# bug#1676: Prepared statement two-table join returns no rows when one is expected
-
-create table t1(
- cola varchar(50) not null,
- colb varchar(8) not null,
- colc varchar(12) not null,
- cold varchar(2) not null,
- primary key (cola, colb, cold));
-
-create table t2(
- cola varchar(50) not null,
- colb varchar(8) not null,
- colc varchar(2) not null,
- cold float,
- primary key (cold));
-
-insert into t1 values ('aaaa', 'yyyy', 'yyyy-dd-mm', 'R');
-
-insert into t2 values ('aaaa', 'yyyy', 'R', 203), ('bbbb', 'zzzz', 'C', 201);
-
-prepare st_1676 from 'select a.cola, a.colb, a.cold from t1 a, t2 b where a.cola = ? and a.colb = ? and a.cold = ? and b.cola = a.cola and b.colb = a.colb and b.colc = a.cold';
-
-set @arg0= "aaaa";
-set @arg1= "yyyy";
-set @arg2= "R";
-
-execute st_1676 using @arg0, @arg1, @arg2;
-
-drop table t1, t2;
-
-# end of bug#1676
-
-# End of 4.1 tests
-
-# bug#18492: mysqld reports ER_ILLEGAL_REFERENCE in --ps-protocol
-
-create table t1 (a int primary key);
-insert into t1 values (1);
-
-explain select * from t1 where 3 in (select (1+1) union select 1);
-
-select * from t1 where 3 in (select (1+1) union select 1);
-
-prepare st_18492 from 'select * from t1 where 3 in (select (1+1) union select 1)';
-execute st_18492;
-
-drop table t1;
-
-#
-# Bug#19356: Assertion failure with undefined @uservar in prepared statement execution
-#
-create table t1 (a int, b varchar(4));
-create table t2 (a int, b varchar(4), primary key(a));
-
-prepare stmt1 from 'insert into t1 (a, b) values (?, ?)';
-prepare stmt2 from 'insert into t2 (a, b) values (?, ?)';
-
-set @intarg= 11;
-set @varchararg= '2222';
-execute stmt1 using @intarg, @varchararg;
-execute stmt2 using @intarg, @varchararg;
-set @intarg= 12;
-execute stmt1 using @intarg, @UNDEFINED;
-execute stmt2 using @intarg, @UNDEFINED;
-set @intarg= 13;
-execute stmt1 using @UNDEFINED, @varchararg;
---error 1048
-execute stmt2 using @UNDEFINED, @varchararg;
-set @intarg= 14;
-set @nullarg= Null;
-execute stmt1 using @UNDEFINED, @nullarg;
---error 1048
-execute stmt2 using @nullarg, @varchararg;
-
-select * from t1;
-select * from t2;
-
-drop table t1;
-drop table t2;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
---echo End of 5.0 tests.
diff --git a/mysql-test/suite/pbxt/t/ps_1general.test b/mysql-test/suite/pbxt/t/ps_1general.test
deleted file mode 100644
index 95a65c58ec3..00000000000
--- a/mysql-test/suite/pbxt/t/ps_1general.test
+++ /dev/null
@@ -1,931 +0,0 @@
-###################### ps_general.test #######################
-# #
-# basic and miscellaneous tests for prepared statements #
-# #
-##############################################################
-
-#
-# NOTE: PLEASE SEE THE DETAILED DESCRIPTION AT THE BOTTOM OF THIS FILE
-# BEFORE ADDING NEW TEST CASES HERE !!!
-
---disable_warnings
-drop table if exists t5, t6, t7, t8;
-drop database if exists mysqltest ;
-
-# Cleanup from other tests
-drop database if exists client_test_db;
-drop database if exists testtets;
-drop table if exists t1Aa,t2Aa,v1Aa,v2Aa;
-drop view if exists t1Aa,t2Aa,v1Aa,v2Aa;
---enable_warnings
-
---disable_query_log
-select '------ basic tests ------' as test_sequence ;
---enable_query_log
-
-let $type= 'MYISAM' ;
-# create the tables (t1 and t9) used in many tests
---source include/ps_create.inc
-# insert data into these tables
---source include/ps_renew.inc
-
-
-################ The basic functions ################
-
-# 1. PREPARE stmt_name FROM <preparable statement>;
-# <preparable statement> ::=
-# 'literal_stmt' |
-# @variable_ref_stmt.
-# The statement may contain question marks as placeholders for parameters.
-#
-# Bind a statement name to a string containing a SQL statement and
-# send it to the server. The server will parse the statement and
-# reply with "Query Ok" or an error message.
-#
-PREPARE stmt FROM ' select * from t1 where a = ? ' ;
-
-# 2. EXECUTE stmt_name [USING @var [, @var ]];
-# Current values of supplied variables are used as parameters.
-#
-# Send the server the order to execute the statement and supply values
-# for the input parameters needed.
-# If no error occurs the server reply will be identical to the reply for
-# the query used in PREPARE with question marks replaced with values of
-# the input variables.
-#
-SET @var= 2 ;
-EXECUTE stmt USING @var ;
-# The non prepared statement with the same server reply would be:
-select * from t1 where a = @var ;
-
-# 3. DEALLOCATE PREPARE stmt_name;
-#
-# Send the server the order to drop the parse informations.
-# The server will reply with "Query Ok" or an error message.
-DEALLOCATE PREPARE stmt ;
-
-################ PREPARE ################
-# prepare without parameter
-prepare stmt1 from ' select 1 as my_col ' ;
-# prepare with parameter
-prepare stmt1 from ' select ? as my_col ' ;
-# prepare must fail (incomplete statements/wrong syntax)
---error ER_PARSE_ERROR
-prepare ;
---error ER_PARSE_ERROR
-prepare stmt1 ;
---error ER_PARSE_ERROR
-prepare stmt1 from ;
---error ER_PARSE_ERROR
-prepare_garbage stmt1 from ' select 1 ' ;
---error ER_PARSE_ERROR
-prepare stmt1 from_garbage ' select 1 ' ;
---error ER_PARSE_ERROR
-prepare stmt1 from ' select_garbage 1 ' ;
---error ER_PARSE_ERROR
-prepare from ' select 1 ' ;
---error ER_PARSE_ERROR
-prepare stmt1 ' select 1 ' ;
---error ER_PARSE_ERROR
-prepare ? from ' select ? as my_col ' ;
-# statement in variable
-set @arg00='select 1 as my_col';
-prepare stmt1 from @arg00;
-# prepare must fail (query variable is empty)
-set @arg00='';
---error ER_EMPTY_QUERY
-prepare stmt1 from @arg00;
-set @arg00=NULL;
-# prepare must fail (query variable is NULL)
---error ER_PARSE_ERROR
-prepare stmt1 from @arg01;
-
-prepare stmt1 from ' select * from t1 where a <= 2 ' ;
-# prepare must fail (column x does not exist)
---error ER_BAD_FIELD_ERROR
-prepare stmt1 from ' select * from t1 where x <= 2 ' ;
-# cases derived from client_test.c: test_null()
-# prepare must fail (column x does not exist)
---error ER_BAD_FIELD_ERROR
-prepare stmt1 from ' insert into t1(a,x) values(?,?) ' ;
---error ER_BAD_FIELD_ERROR
-prepare stmt1 from ' insert into t1(x,a) values(?,?) ' ;
---disable_warnings
-drop table if exists not_exist ;
---enable_warnings
-# prepare must fail (table does not exist)
---error ER_NO_SUCH_TABLE
-prepare stmt1 from ' select * from not_exist where a <= 2 ' ;
-
-# case derived from client_test.c: test_prepare_syntax()
-# prepare must fail (incomplete statement)
---error ER_PARSE_ERROR
-prepare stmt1 from ' insert into t1 values(? ' ;
---error ER_PARSE_ERROR
-prepare stmt1 from ' select a, b from t1
- where a=? and where ' ;
-
-################ EXECUTE ################
-# execute must fail (statement never_prepared never prepared)
---error ER_UNKNOWN_STMT_HANDLER
-execute never_prepared ;
-# execute must fail (prepare stmt1 just failed,
-# but there was a successful prepare of stmt1 before)
-prepare stmt1 from ' select * from t1 where a <= 2 ' ;
---error ER_NO_SUCH_TABLE
-prepare stmt1 from ' select * from not_exist where a <= 2 ' ;
---error ER_UNKNOWN_STMT_HANDLER
-execute stmt1 ;
-
-# drop the table between prepare and execute
-create table t5
-(
- a int primary key,
- b char(30),
- c int
-);
-insert into t5( a, b, c) values( 1, 'original table', 1);
-prepare stmt2 from ' select * from t5 ' ;
-execute stmt2 ;
-drop table t5 ;
-# execute must fail (table was dropped after prepare)
---error ER_NO_SUCH_TABLE
-execute stmt2 ;
-# cases derived from client_test.c: test_select_prepare()
-# 1. drop + create table (same column names/types/order)
-# between prepare and execute
-create table t5
-(
- a int primary key,
- b char(30),
- c int
-);
-insert into t5( a, b, c) values( 9, 'recreated table', 9);
-execute stmt2 ;
-drop table t5 ;
-# 2. drop + create table (same column names/types but different order)
-# between prepare and execute
-create table t5
-(
- a int primary key,
- c int,
- b char(30)
-);
-insert into t5( a, b, c) values( 9, 'recreated table', 9);
-execute stmt2 ;
-drop table t5 ;
-# 3. drop + create table (same column names/types/order+extra column)
-# between prepare and execute
-create table t5
-(
- a int primary key,
- b char(30),
- c int,
- d timestamp default '2008-02-23 09:23:45'
-);
-insert into t5( a, b, c) values( 9, 'recreated table', 9);
-execute stmt2 ;
-drop table t5 ;
-# 4. drop + create table (same column names/types, different order +
-# additional column) between prepare and execute
-create table t5
-(
- a int primary key,
- d timestamp default '2008-02-23 09:23:45',
- b char(30),
- c int
-);
-insert into t5( a, b, c) values( 9, 'recreated table', 9);
-execute stmt2 ;
-drop table t5 ;
-# 5. drop + create table (same column names/order, different types)
-# between prepare and execute
-create table t5
-(
- a timestamp default '2004-02-29 18:01:59',
- b char(30),
- c int
-);
-insert into t5( b, c) values( 'recreated table', 9);
-execute stmt2 ;
-drop table t5 ;
-# 6. drop + create table (same column types/order, different names)
-# between prepare and execute
-create table t5
-(
- f1 int primary key,
- f2 char(30),
- f3 int
-);
-insert into t5( f1, f2, f3) values( 9, 'recreated table', 9);
-execute stmt2 ;
-drop table t5 ;
-
-# execute without parameter
-prepare stmt1 from ' select * from t1 where a <= 2 ' ;
-execute stmt1 ;
-# execute with parameter
-set @arg00=1 ;
-set @arg01='two' ;
-prepare stmt1 from ' select * from t1 where a <= ? ' ;
-execute stmt1 using @arg00;
-# execute must fail (too small number of parameters)
---error ER_WRONG_ARGUMENTS
-execute stmt1 ;
-# execute must fail (too big number of parameters)
---error ER_WRONG_ARGUMENTS
-execute stmt1 using @arg00, @arg01;
-# execute must fail (parameter is not set)
-execute stmt1 using @not_set;
-
-################ DEALLOCATE ################
-# deallocate must fail (the statement 'never_prepared' was never prepared)
---error ER_UNKNOWN_STMT_HANDLER
-deallocate prepare never_prepared ;
-# deallocate must fail (prepare stmt1 just failed,
-# but there was a successful prepare before)
-prepare stmt1 from ' select * from t1 where a <= 2 ' ;
---error ER_NO_SUCH_TABLE
-prepare stmt1 from ' select * from not_exist where a <= 2 ' ;
---error ER_UNKNOWN_STMT_HANDLER
-deallocate prepare stmt1;
-create table t5
-(
- a int primary key,
- b char(10)
-);
-prepare stmt2 from ' select a,b from t5 where a <= 2 ' ;
-drop table t5 ;
-# deallocate prepared statement where the table was dropped after prepare
-deallocate prepare stmt2;
-
-## parallel use of more than one prepared statement handlers
-# switch between different queries
-prepare stmt1 from ' select a from t1 where a <= 2 ' ;
-prepare stmt2 from ' select b from t1 where a <= 2 ' ;
-execute stmt2 ;
-execute stmt1 ;
-# switch between statement handlers of the same query
-prepare stmt1 from ' select a from t1 where a <= 2 ' ;
-prepare stmt2 from ' select a from t1 where a <= 2 ' ;
-execute stmt2 ;
-execute stmt1 ;
-deallocate prepare stmt1 ;
-# Will the deallocate of stmt1 with the same query affect stmt2 ?
-execute stmt2 ;
-
---disable_query_log
-select '------ show and misc tests ------' as test_sequence ;
---enable_query_log
-
---disable_warnings
-drop table if exists t2;
---enable_warnings
-create table t2
-(
- a int primary key, b char(10)
-);
-
-################ SHOW COMMANDS ################
-prepare stmt4 from ' show databases ';
-execute stmt4;
-prepare stmt4 from ' show tables from test like ''t2%'' ';
-execute stmt4;
-prepare stmt4 from ' show columns from t2 where field in (select ?) ';
-SET @arg00="a";
-execute stmt4 using @arg00;
-SET @arg00="b";
-execute stmt4 using @arg00;
-SET @arg00=1;
-execute stmt4 using @arg00;
-
-prepare stmt4 from ' show columns from t2 from test like ''a%'' ';
-execute stmt4;
-create index t2_idx on t2(b);
-prepare stmt4 from ' show index from t2 from test ';
-execute stmt4;
-prepare stmt4 from ' show table status from test like ''t2%'' ';
-# egalize date and time values
---replace_column 8 # 12 # 13 # 14 #
-# Bug#4288 : prepared statement 'show table status ..', wrong output on execute
-execute stmt4;
-# try the same with the big table
-prepare stmt4 from ' show table status from test like ''t9%'' ';
-# egalize date and time values
---replace_column 8 # 12 # 13 # 14 #
-# Bug#4288
-execute stmt4;
-prepare stmt4 from ' show status like ''Threads_running'' ';
---replace_column 2 #
-execute stmt4;
-prepare stmt4 from ' show variables like ''sql_mode'' ';
-execute stmt4;
-prepare stmt4 from ' show engine myisam logs ';
-execute stmt4;
-prepare stmt4 from ' show grants for user ';
-prepare stmt4 from ' show create table t2 ';
-prepare stmt4 from ' show master status ';
-prepare stmt4 from ' show master logs ';
-prepare stmt4 from ' show slave status ';
-prepare stmt4 from ' show warnings limit 20 ';
-prepare stmt4 from ' show errors limit 20 ';
-prepare stmt4 from ' show storage engines ';
-# The output depends upon the precise order in which
-# storage engines are registered, so we switch off the output.
---disable_result_log
-execute stmt4;
---enable_result_log
-
-################ MISC STUFF ################
-## get a warning and an error
-# cases derived from client_test.c: test_warnings(), test_errors()
---disable_warnings
-drop table if exists t5;
---enable_warnings
-prepare stmt1 from ' drop table if exists t5 ' ;
-execute stmt1 ;
-prepare stmt1 from ' drop table t5 ' ;
---error ER_BAD_TABLE_ERROR
-execute stmt1 ;
-
-## SELECT @@version
-# cases derived from client_test.c: test_select_version()
-#
-# TODO: Metadata check is temporary disabled here, because metadata of
-# this statement also depends on @@version contents and you can't apply
-# replace_column and replace_result to it. It will be enabled again when
-# support of replace_column and replace_result on metadata will be
-# implemented.
-#
-#--enable_metadata
-prepare stmt1 from ' SELECT @@version ' ;
-# egalize the version
---replace_column 1 <version>
-execute stmt1 ;
-#--disable_metadata
-
-## do @var:= and set @var=
-# cases derived from client_test.c: test_do_set()
-prepare stmt_do from ' do @var:= (1 in (select a from t1)) ' ;
-prepare stmt_set from ' set @var= (1 in (select a from t1)) ' ;
-let $1= 3 ;
-while ($1)
-{
- execute stmt_do ;
- --disable_query_log
- select @var as 'content of @var is:' ;
- --enable_query_log
- execute stmt_set ;
- --disable_query_log
- select @var as 'content of @var is:' ;
- --enable_query_log
- dec $1 ;
-}
-# the same test with a table containing one column and 'select *'
---disable_warnings
-drop table if exists t5 ;
---enable_warnings
-create table t5 (a int) ;
-prepare stmt_do from ' do @var:= (1 in (select a from t5)) ' ;
-prepare stmt_set from ' set @var= (1 in (select a from t5)) ' ;
-let $1= 3 ;
-while ($1)
-{
- execute stmt_do ;
- --disable_query_log
- select @var as 'content of @var is:' ;
- --enable_query_log
- execute stmt_set ;
- --disable_query_log
- select @var as 'content of @var is:' ;
- --enable_query_log
- dec $1 ;
-}
-drop table t5 ;
-deallocate prepare stmt_do ;
-deallocate prepare stmt_set ;
-
-## nonsense like prepare of prepare,execute or deallocate
---error ER_UNSUPPORTED_PS
-prepare stmt1 from ' prepare stmt2 from '' select 1 '' ' ;
---error ER_UNSUPPORTED_PS
-prepare stmt1 from ' execute stmt2 ' ;
---error ER_UNSUPPORTED_PS
-prepare stmt1 from ' deallocate prepare never_prepared ' ;
-
-## We don't support alter view as prepared statements
---error ER_UNSUPPORTED_PS
-prepare stmt1 from 'alter view v1 as select 2';
-
-## switch the database connection
---error ER_UNSUPPORTED_PS
-prepare stmt4 from ' use test ' ;
-
-## create/drop database
-prepare stmt3 from ' create database mysqltest ';
-create database mysqltest ;
-prepare stmt3 from ' drop database mysqltest ';
-drop database mysqltest ;
-
-#### table related commands
-## describe
-prepare stmt3 from ' describe t2 ';
-execute stmt3;
-drop table t2 ;
---error ER_NO_SUCH_TABLE
-execute stmt3;
-## lock/unlock
---error ER_UNSUPPORTED_PS
-prepare stmt3 from ' lock tables t1 read ' ;
---error ER_UNSUPPORTED_PS
-prepare stmt3 from ' unlock tables ' ;
-## Load/Unload table contents
-
---let $datafile = $MYSQLTEST_VARDIR/tmp/data.txt
---error 0,1
---remove_file $datafile
-
---replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
---error ER_UNSUPPORTED_PS
-eval prepare stmt1 from ' load data infile ''$datafile''
- into table t1 fields terminated by ''\t'' ';
---replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
-eval prepare stmt1 from ' select * into outfile ''$datafile'' from t1 ';
- execute stmt1 ;
-##
-prepare stmt1 from ' optimize table t1 ' ;
-prepare stmt1 from ' analyze table t1 ' ;
-prepare stmt1 from ' checksum table t1 ' ;
-prepare stmt1 from ' repair table t1 ' ;
-
---remove_file $datafile
-
-## handler
---error ER_UNSUPPORTED_PS
-prepare stmt1 from ' handler t1 open ';
-
-
-## commit/rollback
-prepare stmt3 from ' commit ' ;
-prepare stmt3 from ' rollback ' ;
-
-
-## switch the sql_mode
-prepare stmt4 from ' SET sql_mode=ansi ';
-execute stmt4;
-# check if the sql_mode is now ansi
-select 'a' || 'b' ;
-prepare stmt4 from ' SET sql_mode="" ';
-execute stmt4;
-# check if the sql_mode is not ansi
-select '2' || '3' ;
-# Will a switch of the sqlmode affect the execution of already prepared
-# statements ?
-prepare stmt5 from ' select ''2'' || ''3'' ' ;
-execute stmt5;
-SET sql_mode=ansi;
-execute stmt5;
-SET sql_mode="";
-
-prepare stmt1 from ' flush local privileges ' ;
-prepare stmt1 from ' reset query cache ' ;
-prepare stmt1 from ' KILL 0 ';
-
-## simple explain
-# cases derived from client_test.c: test_explain_bug()
-prepare stmt1 from ' explain select a from t1 order by b ';
-# PS protocol gives slightly different metadata
---disable_ps_protocol
---enable_metadata
-execute stmt1;
---disable_metadata
-SET @arg00=1 ;
-prepare stmt1 from ' explain select a from t1 where a > ? order by b ';
---enable_metadata
-execute stmt1 using @arg00;
---disable_metadata
---enable_ps_protocol
-
-## parameters with probably problematic characters (quote, double quote)
-# cases derived from client_test.c: test_logs()
-# try if
---disable_warnings
-drop table if exists t2;
---enable_warnings
-create table t2 (id smallint, name varchar(20)) ;
-prepare stmt1 from ' insert into t2 values(?, ?) ' ;
-set @id= 9876 ;
-set @arg00= 'MySQL - Open Source Database' ;
-set @arg01= "'" ;
-set @arg02= '"' ;
-set @arg03= "my'sql'" ;
-set @arg04= 'my"sql"' ;
-insert into t2 values ( @id , @arg00 );
-insert into t2 values ( @id , @arg01 );
-insert into t2 values ( @id , @arg02 );
-insert into t2 values ( @id , @arg03 );
-insert into t2 values ( @id , @arg04 );
-prepare stmt1 from ' select * from t2 where id= ? and name= ? ';
-execute stmt1 using @id, @arg00 ;
-execute stmt1 using @id, @arg01 ;
-execute stmt1 using @id, @arg02 ;
-execute stmt1 using @id, @arg03 ;
-execute stmt1 using @id, @arg04 ;
-drop table t2;
-
-################ CREATE/DROP/ALTER/RENAME TESTS ################
---disable_query_log
-select '------ create/drop/alter/rename tests ------' as test_sequence ;
---enable_query_log
-
---disable_warnings
-drop table if exists t2, t3;
---enable_warnings
-
-## DROP TABLE
-prepare stmt_drop from ' drop table if exists t2 ' ;
---disable_warnings
-execute stmt_drop;
---enable_warnings
-
-## CREATE TABLE
-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;
-
-## CREATE TABLE .. SELECT
-set @arg00=1;
-prepare stmt3 from ' create table t3 (m int) select ? as m ' ;
-# Bug#4280 server hangs, prepared "create table .. as select ? .."
-execute stmt3 using @arg00;
-select m from t3;
-drop table t3;
-
-prepare stmt3 from ' create index t2_idx on t2(b) ';
-prepare stmt3 from ' drop index t2_idx on t2 ' ;
-prepare stmt3 from ' alter table t2 drop primary key ';
-
-## RENAME TABLE
---disable_warnings
-drop table if exists new_t2;
---enable_warnings
-prepare stmt3 from ' rename table t2 to new_t2 ';
-execute stmt3;
---error ER_TABLE_EXISTS_ERROR
-execute stmt3;
-rename table new_t2 to t2;
-drop table t2;
-## RENAME more than on TABLE within one statement
-# cases derived from client_test.c: test_rename()
-prepare stmt1 from ' rename table t5 to t6, t7 to t8 ' ;
-create table t5 (a int) ;
-# rename must fail, t7 does not exist
-# Clean up the filename here because embedded server reports whole path
---replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ '' t7.frm t7
---error ER_FILE_NOT_FOUND
-execute stmt1 ;
-create table t7 (a int) ;
-# rename, t5 -> t6 and t7 -> t8
-execute stmt1 ;
-# rename must fail, t5 and t7 does not exist t6 and t8 already exist
---error ER_TABLE_EXISTS_ERROR
-execute stmt1 ;
-rename table t6 to t5, t8 to t7 ;
-# rename, t5 -> t6 and t7 -> t8
-execute stmt1 ;
-drop table t6, t8 ;
-
-
-################ BIG STATEMENT TESTS ################
---disable_query_log
-select '------ big statement tests ------' as test_sequence ;
---enable_query_log
-# The following tests use huge numbers of lines, characters or parameters
-# per prepared statement.
-# I assume the server and also the client (mysqltest) are stressed.
-#
-# Attention: The limits used are NOT derived from the manual
-# or other sources.
-
-## many lines ( 50 )
-let $my_stmt= 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 ;
-eval ($my_stmt) ;
-eval prepare stmt1 from "$my_stmt" ;
-execute stmt1 ;
-execute stmt1 ;
-
-## many characters ( about 1400 )
-
-let $my_stmt= 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' ;
-eval ($my_stmt) ;
-eval prepare stmt1 from "$my_stmt" ;
-execute stmt1 ;
-execute stmt1 ;
-
-
-## many parameters ( 50 )
---disable_query_log
-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;
---enable_query_log
-
-select 'ABC' as my_const_col FROM t1 WHERE
-@arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and
-@arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and
-@arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and
-@arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and
-@arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and
-@arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and
-@arg00=@arg00 ;
-prepare stmt1 from ' select ''ABC'' as my_const_col FROM t1 WHERE
- ? = ? and ? = ? and ? = ? and ? = ? and
- ? = ? and ? = ? and ? = ? and ? = ? and
- ? = ? and ? = ? and ? = ? and ? = ? and
- ? = ? and ? = ? and ? = ? and ? = ? and
- ? = ? and ? = ? and ? = ? and ? = ? and
- ? = ? and ? = ? and ? = ? and ? = ? and
- ? = ? ' ;
-execute stmt1 using
-@arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00;
-execute stmt1 using
-@arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07,
-@arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, @arg17,
-@arg20, @arg21, @arg22, @arg23, @arg24, @arg25, @arg26, @arg27,
-@arg30, @arg31, @arg32, @arg33, @arg34, @arg35, @arg36, @arg37,
-@arg40, @arg41, @arg42, @arg43, @arg44, @arg45, @arg46, @arg47,
-@arg50, @arg51, @arg52, @arg53, @arg54, @arg55, @arg56, @arg57,
-@arg60, @arg61 ;
-
-# cases derived from client_test.c: test_mem_overun()
---disable_warnings
-drop table if exists t5 ;
---enable_warnings
-
-set @col_num= 1000 ;
-
---disable_query_log
-set @string= 'create table t5( ' ;
-let $1=`select @col_num - 1` ;
-while ($1)
-{
- eval set @string= concat(@string, 'c$1 int,') ;
- dec $1 ;
-}
-set @string= concat(@string, 'c0 int)' );
---enable_query_log
-select @string as "" ;
-prepare stmt1 from @string ;
-execute stmt1 ;
-
---disable_query_log
-set @string= 'insert into t5 values(' ;
-let $1=`select @col_num - 1` ;
-while ($1)
-{
- eval set @string= concat(@string, '1 ,') ;
- dec $1 ;
-}
-eval set @string= concat(@string, '1 )') ;
---enable_query_log
-select @string as "" ;
-prepare stmt1 from @string ;
-execute stmt1 ;
-
-prepare stmt1 from ' select * from t5 ' ;
---enable_metadata
-# prevent too long lines
---vertical_results
---disable_result_log
-execute stmt1 ;
---enable_result_log
---disable_metadata
---horizontal_results
-
-drop table t1, t5, t9;
-
-##### RULES OF THUMB TO PRESERVE THE SYSTEMATICS OF THE PS TEST CASES #####
-#
-# 0. You don't have the time to
-# - read and pay attention to these rules of thumb
-# - accept that QA may move your test case to a different place
-# (I will not change your code!!) .
-# Please append your test case to
-# t/ps.test
-#
-# 1. You have more time and want to get as much value from you test case as
-# possible. Please try to make the following decisions:
-#
-# Will the execution or result of the sub test case depend on the
-# properties of a storage engine ?
-#
-# NO --> alter t/ps_1general.test (Example: Command with syntax error)
-# If you need a table, please try to use
-# t1 - very simple table
-# t9 - table with nearly all available column types
-# whenever possible.
-#
-# The structure and the content of these tables can be found in
-# include/ps_create.inc CREATE TABLE ...
-# include/ps_renew.inc DELETE all rows and INSERT some rows
-#
-# Both tables are managed by the same storage engine.
-# The type of the storage engine is stored in the variable
-# '$type' . In ps_1general.test $type is set to 'MYISAM'.
-#
-# Please feel free to source ps_create.inc or ps_renew.inc
-# whenever you think it helps. But please restore the original
-# state of these tables after your tests, because the following
-# statements may depend on it.
-#
-# YES
-# |
-# |
-# Is it possible to apply the sub test case to all table types ?
-# YES --> alter include/ps_query.inc (for SELECTs)
-# include/ps_modify.inc (for INSERT/UPDATE/DELETE)
-# include/ps_modify1.inc (also for INSERT/UPDATE/DELETE,
-# but t/ps_5merge.test will not source that file)
-# Please try to find an appropriate place within the file.
-# It would be nice if we have some systematics in the
-# order of the sub test cases (if possible).
-#
-# Please be aware, that
-# include: ps_query.inc, ps_modify.inc, ps_modify1.inc
-# will be sourced by several test case files stored within the
-# subdirectory 't'. So every change here will affect several test
-# cases.
-#
-# NO
-# |
-# |
-# Append the sub test case to the appropriate
-# ps_<number><table type>.test .
-#
-# 2. The current structure of the PS tests
-#
-# t/ps_1general.test Check of basic PS features, SHOW commands and DDL
-# The tests should not depend on the table type.
-#
-# t/ps_2myisam Check of PS on tables of type MYISAM .
-# t/ps_3innodb Check of PS on tables of type InnoDB .
-# ...
-# t/ps_6bdb Check of PS on tables of type BDB .
-# All storage engine related tests use the variable $type to hold the
-# name of the storage engine.
-#
-# include/ps_query.inc test cases with SELECT/...
-# These test cases should not modify the content or
-# the structure (DROP/ALTER..) of the tables
-# 't1' and 't9'.
-# include/ps_modify.inc test cases with INSERT/UPDATE/...
-# These test cases should not modify the structure
-# (DROP/ALTER..) of the tables
-# 't1' and 't9'.
-# These two test sequences will be applied to all table types .
-#
-# include/ps_modify1.inc test cases with INSERT/UPDATE/...
-# This test sequences will be applied to all table types
-# except MERGE tables.
-#
-# include/ps_create.inc DROP and CREATE of the tables
-# 't1' and 't9' .
-# include/ps_renew.inc DELETE all rows and INSERT some rows, that means
-# recreate the original content of these tables.
-# Please do not alter the commands concerning these two tables.
-#
-# Please feel free and encouraged to exploit the current code sharing
-# mechanism of the 'ps_<number><table type>' test cases. It is an convenient
-# way to check all storage engines.
-#
-# Thank you for reading these rules of thumb.
-#
-# Matthias
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/ps_grant.test b/mysql-test/suite/pbxt/t/ps_grant.test
deleted file mode 100644
index 5258a39245e..00000000000
--- a/mysql-test/suite/pbxt/t/ps_grant.test
+++ /dev/null
@@ -1,130 +0,0 @@
-# Can't test grants with embedded server
--- source include/not_embedded.inc
-
-let $type= 'MYISAM' ;
-
-################ GRANT/REVOKE/DROP affecting a parallel session ################
---disable_query_log
-select '------ grant/revoke/drop affects a parallel session test ------'
- as test_sequence ;
---enable_query_log
-
-#---------------------------------------------------------------------#
-# Here we test that:
-# 1. A new GRANT will be visible within another sessions. #
-# #
-# Let's assume there is a parallel session with an already prepared #
-# statement for a table. #
-# A DROP TABLE will affect the EXECUTE properties. #
-# A REVOKE will affect the EXECUTE properties. #
-#---------------------------------------------------------------------#
-
-# Who am I ?
-# this is different across different systems:
-# select current_user(), user() ;
-
-#### create a new user account ####
-## There should be no grants for that non existing user
---error 1141
-show grants for second_user@localhost ;
-## create a new user account by using GRANT statements on t9
-create database mysqltest;
-# create the tables (t1 and t9) used in many tests
-use mysqltest;
---disable_query_log
---source include/ps_create.inc
---source include/ps_renew.inc
---enable_query_log
-use test;
-grant usage on mysqltest.* to second_user@localhost
-identified by 'looser' ;
-grant select on mysqltest.t9 to second_user@localhost
-identified by 'looser' ;
-show grants for second_user@localhost ;
-
-
-#### establish a second session to the new user account
-connect (con3,localhost,second_user,looser,mysqltest);
-## switch to the second session
-connection con3;
-# Who am I ?
-select current_user();
-## check the access rights
-show grants for current_user();
-prepare s_t9 from 'select c1 as my_col
- from t9 where c1= 1' ;
-execute s_t9 ;
-# check that we cannot do a SELECT on the table t1;
---error 1142
-select a as my_col from t1;
-
-
-#### give access rights to t1 and drop table t9
-## switch back to the first session
-connection default;
-grant select on mysqltest.t1 to second_user@localhost
-identified by 'looser' ;
---sorted_result
-show grants for second_user@localhost ;
-drop table mysqltest.t9 ;
---sorted_result
-show grants for second_user@localhost ;
-
-
-#### check the access as new user
-## switch to the second session
-connection con3;
-######## Question 1: The table t1 should be now accessible. ########
---sorted_result
-show grants for second_user@localhost ;
-prepare s_t1 from 'select a as my_col from t1' ;
-execute s_t1 ;
-######## Question 2: The table t9 does not exist. ########
---error 1146
-execute s_t9 ;
-deallocate prepare s_t9;
-
-
-#### revoke the access rights to t1
-## switch back to the first session
-connection default;
-revoke all privileges on mysqltest.t1 from second_user@localhost;
-show grants for second_user@localhost ;
-
-#### check the access as new user
-## switch to the second session
-connection con3;
-show grants for second_user@localhost ;
-######## Question 2: The table t1 should be now not accessible. ########
---error 1142
-execute s_t1 ;
-
-## cleanup
-## switch back to the first session
-connection default;
-## disconnect the second session
-disconnect con3 ;
-## remove all rights of second_user@localhost
-revoke all privileges, grant option from second_user@localhost ;
-show grants for second_user@localhost ;
-drop user second_user@localhost ;
-commit ;
---error 1141
-show grants for second_user@localhost ;
-
-drop database mysqltest;
-
-# End of 4.1 tests
-
-#
-# grant/revoke + drop user
-#
-prepare stmt3 from ' grant all on test.t1 to drop_user@localhost
-identified by ''looser'' ';
-grant all on test.t1 to drop_user@localhost
-identified by 'looser' ;
-prepare stmt3 from ' revoke all privileges on test.t1 from
-drop_user@localhost ';
-revoke all privileges on test.t1 from drop_user@localhost ;
-prepare stmt3 from ' drop user drop_user@localhost ';
-drop user drop_user@localhost;
diff --git a/mysql-test/suite/pbxt/t/range.test b/mysql-test/suite/pbxt/t/range.test
deleted file mode 100644
index 4eea4228136..00000000000
--- a/mysql-test/suite/pbxt/t/range.test
+++ /dev/null
@@ -1,778 +0,0 @@
-#
-# Problem with range optimizer
-#
-
---disable_warnings
-drop table if exists t1, t2, t3;
---enable_warnings
-
-CREATE TABLE t1 (
- event_date date DEFAULT '0000-00-00' NOT NULL,
- type int(11) DEFAULT '0' NOT NULL,
- event_id int(11) DEFAULT '0' NOT NULL,
- PRIMARY KEY (event_date,type,event_id)
-);
-
-INSERT INTO t1 VALUES ('1999-07-10',100100,24), ('1999-07-11',100100,25),
-('1999-07-13',100600,0), ('1999-07-13',100600,4), ('1999-07-13',100600,26),
-('1999-07-14',100600,10), ('1999-07-15',100600,16), ('1999-07-15',100800,45),
-('1999-07-15',101000,47), ('1999-07-16',100800,46), ('1999-07-20',100600,5),
-('1999-07-20',100600,27), ('1999-07-21',100600,11), ('1999-07-22',100600,17),
-('1999-07-23',100100,39), ('1999-07-24',100100,39), ('1999-07-24',100500,40),
-('1999-07-25',100100,39), ('1999-07-27',100600,1), ('1999-07-27',100600,6),
-('1999-07-27',100600,28), ('1999-07-28',100600,12), ('1999-07-29',100500,41),
-('1999-07-29',100600,18), ('1999-07-30',100500,41), ('1999-07-31',100500,41),
-('1999-08-01',100700,34), ('1999-08-03',100600,7), ('1999-08-03',100600,29),
-('1999-08-04',100600,13), ('1999-08-05',100500,42), ('1999-08-05',100600,19),
-('1999-08-06',100500,42), ('1999-08-07',100500,42), ('1999-08-08',100500,42),
-('1999-08-10',100600,2), ('1999-08-10',100600,9), ('1999-08-10',100600,30),
-('1999-08-11',100600,14), ('1999-08-12',100600,20), ('1999-08-17',100500,8),
-('1999-08-17',100600,31), ('1999-08-18',100600,15), ('1999-08-19',100600,22),
-('1999-08-24',100600,3), ('1999-08-24',100600,32), ('1999-08-27',100500,43),
-('1999-08-31',100600,33), ('1999-09-17',100100,37), ('1999-09-18',100100,37),
-('1999-09-19',100100,37), ('2000-12-18',100700,38);
-
-select event_date,type,event_id from t1 WHERE event_date >= "1999-07-01" AND event_date < "1999-07-15" AND (type=100600 OR type=100100) ORDER BY event_date;
-explain select event_date,type,event_id from t1 WHERE type = 100601 and event_date >= "1999-07-01" AND event_date < "1999-07-15" AND (type=100600 OR type=100100) ORDER BY event_date;
-select event_date,type,event_id from t1 WHERE event_date >= "1999-07-01" AND event_date <= "1999-07-15" AND (type=100600 OR type=100100) or event_date >= "1999-07-01" AND event_date <= "1999-07-15" AND type=100099;
-drop table t1;
-
-CREATE TABLE t1 (
- PAPER_ID smallint(6) DEFAULT '0' NOT NULL,
- YEAR smallint(6) DEFAULT '0' NOT NULL,
- ISSUE smallint(6) DEFAULT '0' NOT NULL,
- CLOSED tinyint(4) DEFAULT '0' NOT NULL,
- ISS_DATE date DEFAULT '0000-00-00' NOT NULL,
- PRIMARY KEY (PAPER_ID,YEAR,ISSUE)
-);
-INSERT INTO t1 VALUES (3,1999,34,0,'1999-07-12'), (1,1999,111,0,'1999-03-23'),
- (1,1999,222,0,'1999-03-23'), (3,1999,33,0,'1999-07-12'),
- (3,1999,32,0,'1999-07-12'), (3,1999,31,0,'1999-07-12'),
- (3,1999,30,0,'1999-07-12'), (3,1999,29,0,'1999-07-12'),
- (3,1999,28,0,'1999-07-12'), (1,1999,40,1,'1999-05-01'),
- (1,1999,41,1,'1999-05-01'), (1,1999,42,1,'1999-05-01'),
- (1,1999,46,1,'1999-05-01'), (1,1999,47,1,'1999-05-01'),
- (1,1999,48,1,'1999-05-01'), (1,1999,49,1,'1999-05-01'),
- (1,1999,50,0,'1999-05-01'), (1,1999,51,0,'1999-05-01'),
- (1,1999,200,0,'1999-06-28'), (1,1999,52,0,'1999-06-28'),
- (1,1999,53,0,'1999-06-28'), (1,1999,54,0,'1999-06-28'),
- (1,1999,55,0,'1999-06-28'), (1,1999,56,0,'1999-07-01'),
- (1,1999,57,0,'1999-07-01'), (1,1999,58,0,'1999-07-01'),
- (1,1999,59,0,'1999-07-01'), (1,1999,60,0,'1999-07-01'),
- (3,1999,35,0,'1999-07-12');
-select YEAR,ISSUE from t1 where PAPER_ID=3 and (YEAR>1999 or (YEAR=1999 and ISSUE>28)) order by YEAR,ISSUE;
-check table t1;
-repair table t1;
-drop table t1;
-
-CREATE TABLE t1 (
- id int(11) NOT NULL auto_increment,
- parent_id int(11) DEFAULT '0' NOT NULL,
- level tinyint(4) DEFAULT '0' NOT NULL,
- PRIMARY KEY (id),
- KEY parent_id (parent_id),
- KEY level (level)
-);
-INSERT INTO t1 VALUES (1,0,0), (3,1,1), (4,1,1), (8,2,2), (9,2,2), (17,3,2),
-(22,4,2), (24,4,2), (28,5,2), (29,5,2), (30,5,2), (31,6,2), (32,6,2), (33,6,2),
-(203,7,2), (202,7,2), (20,3,2), (157,0,0), (193,5,2), (40,7,2), (2,1,1),
-(15,2,2), (6,1,1), (34,6,2), (35,6,2), (16,3,2), (7,1,1), (36,7,2), (18,3,2),
-(26,5,2), (27,5,2), (183,4,2), (38,7,2), (25,5,2), (37,7,2), (21,4,2),
-(19,3,2), (5,1,1), (179,5,2);
-SELECT * FROM t1 WHERE level = 1 AND parent_id = 1;
-# The following select returned 0 rows in 3.23.8
-SELECT * FROM t1 WHERE level = 1 AND parent_id = 1 order by id;
-drop table t1;
-
-#
-# Testing of bug in range optimizer with many key parts and > and <
-#
-
-create table t1(
- Satellite varchar(25) not null,
- SensorMode varchar(25) not null,
- FullImageCornersUpperLeftLongitude double not null,
- FullImageCornersUpperRightLongitude double not null,
- FullImageCornersUpperRightLatitude double not null,
- FullImageCornersLowerRightLatitude double not null,
- index two (Satellite, SensorMode, FullImageCornersUpperLeftLongitude, FullImageCornersUpperRightLongitude, FullImageCornersUpperRightLatitude, FullImageCornersLowerRightLatitude));
-
-insert into t1 values("OV-3","PAN1",91,-92,40,50);
-insert into t1 values("OV-4","PAN1",91,-92,40,50);
-
-select * from t1 where t1.Satellite = "OV-3" and t1.SensorMode = "PAN1" and t1.FullImageCornersUpperLeftLongitude > -90.000000 and t1.FullImageCornersUpperRightLongitude < -82.000000;
-drop table t1;
-
-create table t1 ( aString char(100) not null default "", key aString (aString(10)) );
-insert t1 (aString) values ( "believe in myself" ), ( "believe" ), ("baaa" ), ( "believe in love");
-select * from t1 where aString < "believe in myself" order by aString;
-select * from t1 where aString > "believe in love" order by aString;
-alter table t1 drop key aString;
-select * from t1 where aString < "believe in myself" order by aString;
-select * from t1 where aString > "believe in love" order by aString;
-drop table t1;
-
-#
-# Problem with binary strings
-#
-
-CREATE TABLE t1 (
- t1ID int(10) unsigned NOT NULL auto_increment,
- art binary(1) NOT NULL default '',
- KNR char(5) NOT NULL default '',
- RECHNR char(6) NOT NULL default '',
- POSNR char(2) NOT NULL default '',
- ARTNR char(10) NOT NULL default '',
- TEX char(70) NOT NULL default '',
- PRIMARY KEY (t1ID),
- KEY IdxArt (art),
- KEY IdxKnr (KNR),
- KEY IdxArtnr (ARTNR)
-) ENGINE=MyISAM;
-
-INSERT INTO t1 (art) VALUES ('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
-('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),
-('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),
-('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),
-('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),
-('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),
-('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),
-('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),
-('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),
-('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),
-('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),
-('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j');
-select count(*) from t1 where upper(art) = 'J';
-select count(*) from t1 where art = 'J' or art = 'j';
-select count(*) from t1 where art = 'j' or art = 'J';
-select count(*) from t1 where art = 'j';
-select count(*) from t1 where art = 'J';
-drop table t1;
-#
-# BETWEEN problems
-#
-create table t1 (x int, y int, index(x), index(y));
-insert into t1 (x) values (1),(2),(3),(4),(5),(6),(7),(8),(9);
-update t1 set y=x;
-# between with only one end fixed
-explain select * from t1, t1 t2 where t1.y = 8 and t2.x between 7 and t1.y+0;
-explain select * from t1, t1 t2 where t1.y = 8 and t2.x >= 7 and t2.x <= t1.y+0;
-# between with both expressions on both ends
-explain select * from t1, t1 t2 where t1.y = 2 and t2.x between t1.y-1 and t1.y+1;
-explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= t1.y-1 and t2.x <= t1.y+1;
-# equation propagation
-explain select * from t1, t1 t2 where t1.y = 2 and t2.x between 0 and t1.y;
-explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 0 and t2.x <= t1.y;
-# testing IN
-explain select count(*) from t1 where x in (1);
-explain select count(*) from t1 where x in (1,2);
-drop table t1;
-
-#
-# bug #1172: "Force index" option caused server crash
-#
-CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1));
-INSERT INTO t1 VALUES (0),(0),(0),(0),(0),(1),(1);
-CREATE TABLE t2 (keya int(11) NOT NULL default '0', KEY j1 (keya));
-INSERT INTO t2 VALUES (0),(0),(1),(1),(2),(2);
-explain select * from t1, t2 where (t1.key1 <t2.keya + 1) and t2.keya=3;
-explain select * from t1 force index(i1), t2 force index(j1) where
- (t1.key1 <t2.keya + 1) and t2.keya=3;
-DROP TABLE t1,t2;
-
-#
-# bug #1724: use RANGE on more selective column instead of REF on less
-# selective
-
-CREATE TABLE t1 (
- a int(11) default NULL,
- b int(11) default NULL,
- KEY a (a),
- KEY b (b)
-) ENGINE=MyISAM;
-
-
-INSERT INTO t1 VALUES
-(1,1),(2,1),(3,1),(4,1),(5,1),(6,1),(7,1),(8,1),(9,1),(10,2),(10,2),
-(13,2),(14,2),(15,2),(16,2),(17,3),(17,3),(16,3),(17,3),(19,3),(20,3),
-(21,4),(22,5),(23,5),(24,5),(25,5),(26,5),(30,5),(31,5),(32,5),(33,5),
-(33,5),(33,5),(33,5),(33,5),(34,5),(35,5);
-
-# we expect that optimizer will choose index on A
-EXPLAIN SELECT * FROM t1 WHERE a IN(1,2) AND b=5;
-SELECT * FROM t1 WHERE a IN(1,2) AND b=5;
-DROP TABLE t1;
-
-#
-# Test problem with range optimzer and sub ranges
-#
-
-CREATE TABLE t1 (a int, b int, c int, INDEX (c,a,b));
-INSERT INTO t1 VALUES (1,0,0),(1,0,0),(1,0,0);
-INSERT INTO t1 VALUES (0,1,0),(0,1,0),(0,1,0);
-# -- First reports 3; second reports 6
-SELECT COUNT(*) FROM t1 WHERE (c=0 and a=1) or (c=0 and b=1);
-SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1);
-DROP TABLE t1;
-
-#
-# Test problem with range optimization over overlapping ranges (#2448)
-#
-
-CREATE TABLE t1 ( a int not null, b int not null, INDEX ab(a,b) );
-INSERT INTO t1 VALUES (47,1), (70,1), (15,1), (15, 4);
-SELECT * FROM t1
-WHERE
-(
- ( b =1 AND a BETWEEN 14 AND 21 ) OR
- ( b =2 AND a BETWEEN 16 AND 18 ) OR
- ( b =3 AND a BETWEEN 15 AND 19 ) OR
- (a BETWEEN 19 AND 47)
-);
-DROP TABLE t1;
-
-#
-# Test of problem with IN on many different keyparts. (Bug #4157)
-#
-
-CREATE TABLE t1 (
-id int( 11 ) unsigned NOT NULL AUTO_INCREMENT ,
-line int( 5 ) unsigned NOT NULL default '0',
-columnid int( 3 ) unsigned NOT NULL default '0',
-owner int( 3 ) unsigned NOT NULL default '0',
-ordinal int( 3 ) unsigned NOT NULL default '0',
-showid smallint( 6 ) unsigned NOT NULL default '1',
-tableid int( 1 ) unsigned NOT NULL default '1',
-content int( 5 ) unsigned NOT NULL default '188',
-PRIMARY KEY ( owner, id ) ,
-KEY menu( owner, showid, columnid ) ,
-KEY `COLUMN` ( owner, columnid, line ) ,
-KEY `LINES` ( owner, tableid, content, id ) ,
-KEY recount( owner, line )
-) ENGINE = MYISAM;
-
-INSERT into t1 (owner,id,columnid,line) values (11,15,15,1),(11,13,13,5);
-
-SELECT id, columnid, tableid, content, showid, line, ordinal FROM t1 WHERE owner=11 AND ((columnid IN ( 15, 13, 14 ) AND line IN ( 1, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 31 )) OR (columnid IN ( 13, 14 ) AND line IN ( 15 ))) LIMIT 0 , 30;
-drop table t1;
-
-#
-# test for a bug with in() and unique key
-#
-
-create table t1 (id int(10) primary key);
-insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9);
-
-select id from t1 where id in (2,5,9) ;
-select id from t1 where id=2 or id=5 or id=9 ;
-drop table t1;
-create table t1 ( id1 int not null, id2 int not null, idnull int null, c char(20), primary key (id1,id2));
-insert into t1 values (0,1,NULL,"aaa"), (1,1,NULL,"aaa"), (2,1,NULL,"aaa"),
- (3,1,NULL,"aaa"), (4,1,NULL,"aaa"), (5,1,NULL,"aaa"),
- (6,1,NULL,"aaa"), (7,1,NULL,"aaa"), (8,1,NULL,"aaa"),
- (9,1,NULL,"aaa"), (10,1,NULL,"aaa"), (11,1,NULL,"aaa"),
- (12,1,NULL,"aaa"), (13,1,NULL,"aaa"), (14,1,NULL,"aaa"),
- (15,1,NULL,"aaa"), (16,1,NULL,"aaa"), (17,1,NULL,"aaa"),
- (18,1,NULL,"aaa"), (19,1,NULL,"aaa"), (20,1,NULL,"aaa");
-select a.id1, b.idnull from t1 as a, t1 as b where a.id2=1 and a.id1=1 and b.id1=a.idnull order by b.id2 desc limit 1;
-drop table t1;
-
-
-#
-# Problem with optimizing !=
-#
-
-create table t1 (
- id int not null auto_increment,
- name char(1) not null,
- uid int not null,
- primary key (id),
- index uid_index (uid));
-
-create table t2 (
- id int not null auto_increment,
- name char(1) not null,
- uid int not null,
- primary key (id),
- index uid_index (uid));
-
-begin;
-insert into t1(id, uid, name) values(1, 0, ' ');
-insert into t1(uid, name) values(0, ' ');
-
-insert into t2(uid, name) select uid, name from t1;
-insert into t1(uid, name) select uid, name from t2;
-insert into t2(uid, name) select uid, name from t1;
-insert into t1(uid, name) select uid, name from t2;
-insert into t2(uid, name) select uid, name from t1;
-insert into t1(uid, name) select uid, name from t2;
-insert into t2(uid, name) select uid, name from t1;
-insert into t1(uid, name) select uid, name from t2;
-insert into t2(uid, name) select uid, name from t1;
-insert into t1(uid, name) select uid, name from t2;
-insert into t2(uid, name) select uid, name from t1;
-insert into t2(uid, name) select uid, name from t1;
-insert into t2(uid, name) select uid, name from t1;
-insert into t2(uid, name) select uid, name from t1;
-insert into t1(uid, name) select uid, name from t2;
-
-delete from t2;
-insert into t2(uid, name) values
- (1, CHAR(64+1)),
- (2, CHAR(64+2)),
- (3, CHAR(64+3)),
- (4, CHAR(64+4)),
- (5, CHAR(64+5)),
- (6, CHAR(64+6)),
- (7, CHAR(64+7)),
- (8, CHAR(64+8)),
- (9, CHAR(64+9)),
- (10, CHAR(64+10)),
- (11, CHAR(64+11)),
- (12, CHAR(64+12)),
- (13, CHAR(64+13)),
- (14, CHAR(64+14)),
- (15, CHAR(64+15)),
- (16, CHAR(64+16)),
- (17, CHAR(64+17)),
- (18, CHAR(64+18)),
- (19, CHAR(64+19)),
- (20, CHAR(64+20)),
- (21, CHAR(64+21)),
- (22, CHAR(64+22)),
- (23, CHAR(64+23)),
- (24, CHAR(64+24)),
- (25, CHAR(64+25)),
- (26, CHAR(64+26));
-
-insert into t1(uid, name) select uid, name from t2 order by uid;
-
-delete from t2;
-insert into t2(id, uid, name) select id, uid, name from t1;
-
-commit;
-
-select count(*) from t1;
-select count(*) from t2;
-
-select * from t1, t2 where t1.uid=t2.uid AND t1.uid > 0;
-select * from t1, t2 where t1.uid=t2.uid AND t1.uid != 0;
-
-drop table t1,t2;
-
-# Fix for bug#4488
-#
-create table t1 (x bigint unsigned not null);
-insert into t1(x) values (0xfffffffffffffff0);
-insert into t1(x) values (0xfffffffffffffff1);
-select * from t1;
-select count(*) from t1 where x>0;
-select count(*) from t1 where x=0;
-select count(*) from t1 where x<0;
-select count(*) from t1 where x < -16;
-select count(*) from t1 where x = -16;
-select count(*) from t1 where x > -16;
-select count(*) from t1 where x = 18446744073709551601;
-
-
-create table t2 (x bigint not null);
-insert into t2(x) values (-16);
-insert into t2(x) values (-15);
-select * from t2;
-select count(*) from t2 where x>0;
-select count(*) from t2 where x=0;
-select count(*) from t2 where x<0;
-select count(*) from t2 where x < -16;
-select count(*) from t2 where x = -16;
-select count(*) from t2 where x > -16;
-select count(*) from t2 where x = 18446744073709551601;
-drop table t1,t2;
-
---disable_warnings
-create table t1 (x bigint unsigned not null primary key) engine=innodb;
---enable_warnings
-insert into t1(x) values (0xfffffffffffffff0);
-insert into t1(x) values (0xfffffffffffffff1);
-select * from t1;
-select count(*) from t1 where x>0;
-select count(*) from t1 where x=0;
-select count(*) from t1 where x<0;
-select count(*) from t1 where x < -16;
-select count(*) from t1 where x = -16;
-select count(*) from t1 where x > -16;
-select count(*) from t1 where x = 18446744073709551601;
-
-drop table t1;
-
-#
-# Bug #11185 incorrect comparison of unsigned int to signed constant
-#
-create table t1 (a bigint unsigned);
-create index t1i on t1(a);
-insert into t1 select 18446744073709551615;
-insert into t1 select 18446744073709551614;
-
-explain select * from t1 where a <> -1;
-select * from t1 where a <> -1;
-explain select * from t1 where a > -1 or a < -1;
-select * from t1 where a > -1 or a < -1;
-explain select * from t1 where a > -1;
-select * from t1 where a > -1;
-explain select * from t1 where a < -1;
-select * from t1 where a < -1;
-
-drop table t1;
-
-#
-# Bug #6045: Binary Comparison regression in MySQL 4.1
-# Binary searches didn't use a case insensitive index.
-#
-set names latin1;
-create table t1 (a char(10), b text, key (a)) character set latin1;
-INSERT INTO t1 (a) VALUES
-('111'),('222'),('222'),('222'),('222'),('444'),('aaa'),('AAA'),('bbb');
-# all these three can be optimized
-explain select * from t1 where a='aaa';
-explain select * from t1 where a=binary 'aaa';
-explain select * from t1 where a='aaa' collate latin1_bin;
-# this one cannot:
-explain select * from t1 where a='aaa' collate latin1_german1_ci;
-drop table t1;
-
-# Test for BUG#9348 "result for WHERE A AND (B OR C) differs from WHERE a AND (C OR B)"
---disable_warnings
-CREATE TABLE t1 (
- `CLIENT` char(3) character set latin1 collate latin1_bin NOT NULL default '000',
- `ARG1` char(3) character set latin1 collate latin1_bin NOT NULL default '',
- `ARG2` char(3) character set latin1 collate latin1_bin NOT NULL default '',
- `FUNCTION` varchar(10) character set latin1 collate latin1_bin NOT NULL default '',
- `FUNCTINT` int(11) NOT NULL default '0',
- KEY `VERI_CLNT~2` (`ARG1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
---enable_warnings
-
-INSERT INTO t1 VALUES ('000',' 0',' 0','Text 001',0), ('000',' 0',' 1','Text 002',0),
- ('000',' 1',' 2','Text 003',0), ('000',' 2',' 3','Text 004',0),
- ('001',' 3',' 0','Text 017',0);
-
-SELECT count(*) FROM t1 WHERE CLIENT='000' AND (ARG1 != ' 1' OR ARG1 != ' 2');
-
-SELECT count(*) FROM t1 WHERE CLIENT='000' AND (ARG1 != ' 2' OR ARG1 != ' 1');
-drop table t1;
-
-# BUG#16168: Wrong range optimizer results, "Use_count: Wrong count ..."
-# warnings in server stderr.
-create table t1 (a int);
-insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-
-CREATE TABLE t2 (
- pk1 int(11) NOT NULL,
- pk2 int(11) NOT NULL,
- pk3 int(11) NOT NULL,
- pk4 int(11) NOT NULL,
- filler char(82),
- PRIMARY KEY (pk1,pk2,pk3,pk4)
-) DEFAULT CHARSET=latin1;
-
-insert into t2 select 1, A.a+10*B.a, 432, 44, 'fillerZ' from t1 A, t1 B;
-INSERT INTO t2 VALUES (2621, 2635, 0, 0,'filler'), (2621, 2635, 1, 0,'filler'),
- (2621, 2635, 10, 0,'filler'), (2621, 2635, 11, 0,'filler'),
- (2621, 2635, 14, 0,'filler'), (2621, 2635, 1000015, 0,'filler');
-
-SELECT * FROM t2
-WHERE ((((pk4 =0) AND (pk1 =2621) AND (pk2 =2635)))
-OR ((pk4 =1) AND (((pk1 IN ( 7, 2, 1 ))) OR (pk1 =522)) AND ((pk2 IN ( 0, 2635))))
-) AND (pk3 >=1000000);
-drop table t1, t2;
-
-#
-# Bug #20732: Partial index and long sjis search with '>' fails sometimes
-#
-
-create table t1(a char(2), key(a(1)));
-insert into t1 values ('x'), ('xx');
-explain select a from t1 where a > 'x';
-select a from t1 where a > 'x';
-drop table t1;
-
---echo End of 4.1 tests
-
-#
-# Test for optimization request #10561: to use keys for
-# NOT IN (c1,...,cn) and NOT BETWEEN c1 AND c2
-#
-
-CREATE TABLE t1 (
- id int(11) NOT NULL auto_increment,
- status varchar(20),
- PRIMARY KEY (id),
- KEY (status)
-);
-
-INSERT INTO t1 VALUES
-(1,'B'), (2,'B'), (3,'B'), (4,'B'), (5,'B'), (6,'B'),
-(7,'B'), (8,'B'), (9,'B'), (10,'B'), (11,'B'), (12,'B'),
-(13,'B'), (14,'B'), (15,'B'), (16,'B'), (17,'B'), (18,'B'),
-(19,'B'), (20,'B'), (21,'B'), (22,'B'), (23,'B'), (24,'B'),
-(25,'A'), (26,'A'), (27,'A'), (28,'A'), (29,'A'), (30,'A'),
-(31,'A'), (32,'A'), (33,'A'), (34,'A'), (35,'A'), (36,'A'),
-(37,'A'), (38,'A'), (39,'A'), (40,'A'), (41,'A'), (42,'A'),
-(43,'A'), (44,'A'), (45,'A'), (46,'A'), (47,'A'), (48,'A'),
-(49,'A'), (50,'A'), (51,'A'), (52,'A'), (53,'C'), (54,'C'),
-(55,'C'), (56,'C'), (57,'C'), (58,'C'), (59,'C'), (60,'C');
-
-EXPLAIN SELECT * FROM t1 WHERE status <> 'A' AND status <> 'B';
-EXPLAIN SELECT * FROM t1 WHERE status NOT IN ('A','B');
-
-SELECT * FROM t1 WHERE status <> 'A' AND status <> 'B';
-SELECT * FROM t1 WHERE status NOT IN ('A','B');
-
-EXPLAIN SELECT status FROM t1 WHERE status <> 'A' AND status <> 'B';
-EXPLAIN SELECT status FROM t1 WHERE status NOT IN ('A','B');
-
-EXPLAIN SELECT * FROM t1 WHERE status NOT BETWEEN 'A' AND 'B';
-EXPLAIN SELECT * FROM t1 WHERE status < 'A' OR status > 'B';
-
-SELECT * FROM t1 WHERE status NOT BETWEEN 'A' AND 'B';
-SELECT * FROM t1 WHERE status < 'A' OR status > 'B';
-
-DROP TABLE t1;
-
-#
-# Test for bug #10031: range to be used over a view
-#
-
-CREATE TABLE t1 (a int, b int, primary key(a,b));
-
-INSERT INTO t1 VALUES
- (1,1),(1,2),(1,3),(2,1),(2,2),(2,3),(3,1),(3,2),(3,3),(4,1),(4,2),(4,3);
-
-CREATE VIEW v1 as SELECT a,b FROM t1 WHERE b=3;
-
-EXPLAIN SELECT a,b FROM t1 WHERE a < 2 and b=3;
-EXPLAIN SELECT a,b FROM v1 WHERE a < 2 and b=3;
-
-EXPLAIN SELECT a,b FROM t1 WHERE a < 2;
-EXPLAIN SELECT a,b FROM v1 WHERE a < 2;
-
-SELECT a,b FROM t1 WHERE a < 2 and b=3;
-SELECT a,b FROM v1 WHERE a < 2 and b=3;
-
-DROP VIEW v1;
-DROP TABLE t1;
-
-#
-# Bug #11853: DELETE statement with a NOT (LIKE/<=>) where condition
-# for an indexed attribute
-#
-
-CREATE TABLE t1 (name varchar(15) NOT NULL, KEY idx(name));
-INSERT INTO t1 VALUES ('Betty'), ('Anna');
-
-SELECT * FROM t1;
-DELETE FROM t1 WHERE name NOT LIKE 'A%a';
-SELECT * FROM t1;
-
-DROP TABLE t1;
-
-CREATE TABLE t1 (a int, KEY idx(a));
-INSERT INTO t1 VALUES (NULL), (1), (2), (3);
-
-SELECT * FROM t1;
-DELETE FROM t1 WHERE NOT(a <=> 2);
-SELECT * FROM t1;
-
-DROP TABLE t1;
-
-#
-# BUG#13317: range optimization doesn't work for IN over VIEW.
-#
-create table t1 (a int, b int, primary key(a,b));
-create view v1 as select a, b from t1;
-
-INSERT INTO `t1` VALUES
-(0,0),(1,0),(2,0),(3,0),(4,0),(5,1),(6,1),(7,1),(8,1),(9,1),(10,2),(11,2),(12,2)
-,(13,2),(14,2),(15,3),(16,3),(17,3),(18,3),(19,3);
-
---replace_column 9 #
-explain select * from t1 where a in (3,4) and b in (1,2,3);
---replace_column 9 #
-explain select * from v1 where a in (3,4) and b in (1,2,3);
---replace_column 9 #
-explain select * from t1 where a between 3 and 4 and b between 1 and 2;
---replace_column 9 #
-explain select * from v1 where a between 3 and 4 and b between 1 and 2;
-
-drop view v1;
-drop table t1;
-
-# BUG#13455:
-create table t3 (a int);
-insert into t3 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-
-create table t1 (a varchar(10), filler char(200), key(a)) charset=binary;
-insert into t1 values ('a','');
-insert into t1 values ('a ','');
-insert into t1 values ('a ', '');
-insert into t1 select concat('a', 1000 + A.a + 10 * (B.a + 10 * C.a)), ''
- from t3 A, t3 B, t3 C;
-
-create table t2 (a varchar(10), filler char(200), key(a));
-insert into t2 select * from t1;
-
---replace_column 9 #
-explain select * from t1 where a between 'a' and 'a ';
---replace_column 9 #
-explain select * from t1 where a = 'a' or a='a ';
-
---replace_column 9 #
-explain select * from t2 where a between 'a' and 'a ';
---replace_column 9 #
-explain select * from t2 where a = 'a' or a='a ';
-
-update t1 set a='b' where a<>'a';
---replace_column 9 #
-explain select * from t1 where a not between 'b' and 'b';
-select a, hex(filler) from t1 where a not between 'b' and 'b';
-
-drop table t1,t2,t3;
-
-#
-# BUG#21282
-#
-create table t1 (a int);
-insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-create table t2 (a int, key(a));
-insert into t2 select 2*(A.a + 10*(B.a + 10*C.a)) from t1 A, t1 B, t1 C;
-
-set @a="select * from t2 force index (a) where a NOT IN(0";
-select count(*) from (select @a:=concat(@a, ',', a) from t2 ) Z;
-set @a=concat(@a, ')');
-
-insert into t2 values (11),(13),(15);
-
-set @b= concat("explain ", @a);
-
-prepare stmt1 from @b;
-execute stmt1;
-
-prepare stmt1 from @a;
-execute stmt1;
-
-drop table t1, t2;
-
-#
-# Bug #18165: range access for BETWEEN with a constant for the first argument
-#
-
-CREATE TABLE t1 (
- id int NOT NULL DEFAULT '0',
- b int NOT NULL DEFAULT '0',
- c int NOT NULL DEFAULT '0',
- INDEX idx1(b,c), INDEX idx2(c));
-
-INSERT INTO t1(id) VALUES (1), (2), (3), (4), (5), (6), (7), (8);
-
-INSERT INTO t1(b,c) VALUES (3,4), (3,4);
-
-SELECT * FROM t1 WHERE b<=3 AND 3<=c;
-SELECT * FROM t1 WHERE 3 BETWEEN b AND c;
-
-EXPLAIN SELECT * FROM t1 WHERE b<=3 AND 3<=c;
-EXPLAIN SELECT * FROM t1 WHERE 3 BETWEEN b AND c;
-
-SELECT * FROM t1 WHERE 0 < b OR 0 > c;
-SELECT * FROM t1 WHERE 0 NOT BETWEEN b AND c;
-
-EXPLAIN SELECT * FROM t1 WHERE 0 < b OR 0 > c;
-EXPLAIN SELECT * FROM t1 WHERE 0 NOT BETWEEN b AND c;
-
-DROP TABLE t1;
-
-#
-# Bug #16249: different results for a range with an without index
-# when a range condition use an invalid datetime constant
-#
-
-CREATE TABLE t1 (
- item char(20) NOT NULL default '',
- started datetime NOT NULL default '0000-00-00 00:00:00',
- price decimal(16,3) NOT NULL default '0.000',
- PRIMARY KEY (item,started)
-) ENGINE=MyISAM;
-
-INSERT INTO t1 VALUES
-('A1','2005-11-01 08:00:00',1000),
-('A1','2005-11-15 00:00:00',2000),
-('A1','2005-12-12 08:00:00',3000),
-('A2','2005-12-01 08:00:00',1000);
-
-EXPLAIN SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00';
-SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00';
-SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-02 00:00:00';
-
-DROP INDEX `PRIMARY` ON t1;
-
-EXPLAIN SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00';
-SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00';
-SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-02 00:00:00';
-
-DROP TABLE t1;
-
-# End of 5.0 tests
-
-# BUG#22393 fix: Adjust 'ref' estimate if we have 'range' estimate for
-# a smaller scan interval
-create table t1 (a int);
-insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-
-create table t2 (a int, b int, filler char(100));
-insert into t2 select A.a + 10 * (B.a + 10 * C.a), 10, 'filler' from t1 A,
-t1 B, t1 C where A.a < 5;
-
-insert into t2 select 1000, b, 'filler' from t2;
-alter table t2 add index (a,b);
-# t2 values
-# ( 1 , 10, 'filler')
-# ( 2 , 10, 'filler')
-# ( 3 , 10, 'filler')
-# (... , 10, 'filler')
-# ...
-# (1000, 10, 'filler') - 500 times
-
-# 500 rows, 1 row
-
-select 'In following EXPLAIN the access method should be ref, #rows~=500 (and not 2)' Z;
-explain select * from t2 where a=1000 and b<11;
-
-drop table t1, t2;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/read_only.test b/mysql-test/suite/pbxt/t/read_only.test
deleted file mode 100644
index 92d9b295cd6..00000000000
--- a/mysql-test/suite/pbxt/t/read_only.test
+++ /dev/null
@@ -1,231 +0,0 @@
-# Test of the READ_ONLY global variable:
-# check that it blocks updates unless they are only on temporary tables.
-
-# should work with embedded server after mysqltest is fixed
--- source include/not_embedded.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1,t2,t3;
---enable_warnings
-
-# READ_ONLY does nothing to SUPER users
-# so we use a non-SUPER one:
-
-grant CREATE, SELECT, DROP on *.* to test@localhost;
-
-connect (con1,localhost,test,,test);
-
-connection default;
-
-set global read_only=0;
-
-connection con1;
-
-create table t1 (a int);
-
-insert into t1 values(1);
-
-create table t2 select * from t1;
-
-connection default;
-
-set global read_only=1;
-
-# We check that SUPER can:
-
-create table t3 (a int);
-drop table t3;
-
-connection con1;
-
-select @@global.read_only;
-
---error 1290
-create table t3 (a int);
-
---error 1290
-insert into t1 values(1);
-
-# if a statement, after parse stage, looks like it will update a
-# non-temp table, it will be rejected, even if at execution it would
-# have turned out that 0 rows would be updated
---error 1290
-update t1 set a=1 where 1=0;
-
-# multi-update is special (see sql_parse.cc) so we test it
---error 1290
-update t1,t2 set t1.a=t2.a+1 where t1.a=t2.a;
-
-# check multi-delete to be sure
---error 1290
-delete t1,t2 from t1,t2 where t1.a=t2.a;
-
-# With temp tables updates should be accepted:
-
-create temporary table t3 (a int) engine=myisam; # PBXT: Used in multi-table update
-
-create temporary table t4 (a int) engine=myisam select * from t3; # PBXT: Server complains about read-only
-
-insert into t3 values(1);
-
-insert into t4 select * from t3;
-
-# a non-temp table updated:
---error 1290
-update t1,t3 set t1.a=t3.a+1 where t1.a=t3.a;
-
-# no non-temp table updated (just swapped):
-update t1,t3 set t3.a=t1.a+1 where t1.a=t3.a;
-
-update t4,t3 set t4.a=t3.a+1 where t4.a=t3.a;
-
---error 1290
-delete t1 from t1,t3 where t1.a=t3.a;
-
-delete t3 from t1,t3 where t1.a=t3.a;
-
-delete t4 from t3,t4 where t4.a=t3.a;
-
-# and even homonymous ones
-
-create temporary table t1 (a int) engine=myisam; # PBXT: Server complains about read-only
-
-insert into t1 values(1);
-
-update t1,t3 set t1.a=t3.a+1 where t1.a=t3.a;
-
-delete t1 from t1,t3 where t1.a=t3.a;
-
-drop table t1;
-
---error 1290
-insert into t1 values(1);
-
-#
-# BUG#11733: COMMITs should not happen if read-only is set
-#
-
-# LOCK TABLE ... WRITE / READ_ONLY
-# - is an error in the same connection
-# - is ok in a different connection
-
-connection default;
-set global read_only=0;
-lock table t1 write;
-
-connection con1;
-lock table t2 write;
-
-connection default;
---error ER_LOCK_OR_ACTIVE_TRANSACTION
-set global read_only=1;
-unlock tables ;
-# The following call blocks until con1 releases the write lock.
-# Blocking is expected.
-send set global read_only=1;
-
-connection con1;
---sleep 1
-select @@global.read_only;
-unlock tables ;
---sleep 1
-select @@global.read_only;
-
-connection default;
-reap;
-
-# LOCK TABLE ... READ / READ_ONLY
-# - is an error in the same connection
-# - is ok in a different connection
-
-connection default;
-set global read_only=0;
-lock table t1 read;
-
-connection con1;
-lock table t2 read;
-
-connection default;
---error ER_LOCK_OR_ACTIVE_TRANSACTION
-set global read_only=1;
-unlock tables ;
-# The following call blocks until con1 releases the read lock.
-# Blocking is a limitation, and could be improved.
-send set global read_only=1;
-
-connection con1;
---sleep 1
-select @@global.read_only;
-unlock tables ;
---sleep 1
-select @@global.read_only;
-
-connection default;
-reap;
-
-# pending transaction / READ_ONLY
-# - is an error in the same connection
-# - is ok in a different connection
-
-connection default;
-set global read_only=0;
-BEGIN;
-
-connection con1;
-BEGIN;
-
-connection default;
---error ER_LOCK_OR_ACTIVE_TRANSACTION
-set global read_only=1;
-ROLLBACK;
-set global read_only=1;
-
-connection con1;
-select @@global.read_only;
-ROLLBACK;
-
-# Verify that FLUSH TABLES WITH READ LOCK do not block READ_ONLY
-# - in the same SUPER connection
-# - in another SUPER connection
-
-connection default;
-set global read_only=0;
-flush tables with read lock;
-set global read_only=1;
-unlock tables;
-
-connect (root2,localhost,root,,test);
-
-connection default;
-set global read_only=0;
-flush tables with read lock;
-
-connection root2;
-set global read_only=1;
-
-connection default;
-select @@global.read_only;
-unlock tables;
-
-# BUG #22077 "DROP TEMPORARY TABLE fails with wrong error if read_only is set"
-#
-# check if DROP TEMPORARY on a non-existing temporary table returns the right
-# error
-
---error ER_BAD_TABLE_ERROR
-drop temporary table ttt;
-
-# check if DROP TEMPORARY TABLE IF EXISTS produces a warning with read_only set
-drop temporary table if exists ttt;
-
-#
-# Cleanup
-#
-connection default;
-set global read_only=0;
-drop table t1,t2;
-drop user test@localhost;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/rename.test b/mysql-test/suite/pbxt/t/rename.test
deleted file mode 100644
index 911579a26f2..00000000000
--- a/mysql-test/suite/pbxt/t/rename.test
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# Test of rename table
-#
-
---source include/count_sessions.inc
-
---disable_warnings
-drop table if exists t0,t1,t2,t3,t4;
-# Clear up from other tests (to ensure that SHOW TABLES below is right)
-drop table if exists t0,t5,t6,t7,t8,t9,t1_1,t1_2,t9_1,t9_2;
---enable_warnings
-
-create table t0 SELECT 1,"table 1";
-create table t2 SELECT 2,"table 2";
-create table t3 SELECT 3,"table 3";
-rename table t0 to t1;
-rename table t3 to t4, t2 to t3, t1 to t2, t4 to t1;
-select * from t1;
-rename table t3 to t4, t2 to t3, t1 to t2, t4 to t1;
-rename table t3 to t4, t2 to t3, t1 to t2, t4 to t1;
-select * from t1;
-
-# The following should give errors
---error ER_TABLE_EXISTS_ERROR,ER_TABLE_EXISTS_ERROR
-rename table t1 to t2;
---error ER_TABLE_EXISTS_ERROR,ER_TABLE_EXISTS_ERROR
-rename table t1 to t1;
---error ER_TABLE_EXISTS_ERROR,ER_TABLE_EXISTS_ERROR
-rename table t3 to t4, t2 to t3, t1 to t2, t4 to t2;
-show tables like "t_";
---error ER_TABLE_EXISTS_ERROR,ER_TABLE_EXISTS_ERROR
-rename table t3 to t1, t2 to t3, t1 to t2, t4 to t1;
---error ER_FILE_NOT_FOUND,ER_FILE_NOT_FOUND
-rename table t3 to t4, t5 to t3, t1 to t2, t4 to t1;
-
-select * from t1;
-select * from t2;
-select * from t3;
-
-# This should give a warning for t4
-drop table if exists t1,t2,t3,t4;
-
-#
-# Bug #2397 RENAME TABLES is not blocked by
-# FLUSH TABLES WITH READ LOCK
-#
-
-connect (con1,localhost,root,,);
-connect (con2,localhost,root,,);
-
-connection con1;
-CREATE TABLE t1 (a int);
-CREATE TABLE t3 (a int);
-connection con2;
-FLUSH TABLES WITH READ LOCK;
-connection con1;
-send RENAME TABLE t1 TO t2, t3 to t4;
-connection con2;
-show tables;
-UNLOCK TABLES;
-connection con1;
-reap;
-connection con2;
-
-# Wait for the the tables to be renamed
-# i.e the query below succeds
-let $query= select * from t2, t4;
-source include/wait_for_query_to_succeed.inc;
-
-show tables;
-
-drop table t2, t4;
-
-disconnect con2;
-disconnect con1;
-connection default;
-
-
---echo End of 4.1 tests
-
-
---echo #
---echo # Bug#14959: "ALTER TABLE isn't able to rename a view"
---echo # Bug#53976: "ALTER TABLE RENAME is allowed on views
---echo # (not documented, broken)"
---echo #
-create table t1(f1 int);
-create view v1 as select * from t1;
---error ER_WRONG_OBJECT
-alter table v1 rename to v2;
-drop view v1;
-drop table t1;
-
---echo End of 5.0 tests
-
---source include/wait_until_count_sessions.inc
-drop database pbxt;
diff --git a/mysql-test/suite/pbxt/t/renamedb.test b/mysql-test/suite/pbxt/t/renamedb.test
deleted file mode 100644
index 71d0c127058..00000000000
--- a/mysql-test/suite/pbxt/t/renamedb.test
+++ /dev/null
@@ -1,53 +0,0 @@
-
-# TODO: enable these tests when RENAME DATABASE is implemented.
-#
-# --disable_warnings
-# drop database if exists testdb1;
-# --enable_warnings
-#
-# create database testdb1 default character set latin2;
-# use testdb1;
-# create table t1 (a int);
-# insert into t1 values (1),(2),(3);
-# show create database testdb1;
-# show tables;
-# rename database testdb1 to testdb2;
-# --error 1049
-# show create database testdb1;
-# show create database testdb2;
-# select database();
-# show tables;
-# select a from t1 order by a;
-# drop database testdb2;
-#
-#
-# Bug#19392 Rename Database: Crash if case change
-#
-# create database testdb1;
-# --error 1007
-# rename database testdb1 to testdb1;
-# drop database testdb1;
-
-#
-# WL#4030 (Deprecate RENAME DATABASE: replace with ALTER DATABASE <name> UPGRADE)
-#
-
---error ER_PARSE_ERROR
-rename database testdb1 to testdb2;
-
---error ER_WRONG_USAGE
-ALTER DATABASE wrong UPGRADE DATA DIRECTORY NAME;
-
---error ER_WRONG_USAGE
-ALTER DATABASE `#mysql41#not-supported` UPGRADE DATA DIRECTORY NAME;
-
---error ER_WRONG_USAGE
-ALTER DATABASE `#mysql51#not-yet` UPGRADE DATA DIRECTORY NAME;
-
---error ER_WRONG_DB_NAME
-ALTER DATABASE `#mysql50#` UPGRADE DATA DIRECTORY NAME;
-
---error ER_BAD_DB_ERROR
-ALTER DATABASE `#mysql50#upgrade-me` UPGRADE DATA DIRECTORY NAME;
-
-
diff --git a/mysql-test/suite/pbxt/t/replace.test b/mysql-test/suite/pbxt/t/replace.test
deleted file mode 100644
index 7b2a409b16f..00000000000
--- a/mysql-test/suite/pbxt/t/replace.test
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# Test of REPLACE with MyISAM and HEAP
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-CREATE TABLE t1 (
- gesuchnr int(11) DEFAULT '0' NOT NULL,
- benutzer_id int(11) DEFAULT '0' NOT NULL,
- PRIMARY KEY (gesuchnr,benutzer_id)
-);
-
-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);
-alter table t1 engine=heap;
-replace into t1 (gesuchnr,benutzer_id) values (1,1);
-drop table t1;
-
-#
-# Test when using replace on a key that has used up it's whole range
-#
-
-create table t1 (a tinyint not null auto_increment primary key, b char(20) default "default_value");
-insert into t1 values (126,"first"),(63, "middle"),(0,"last");
---error 1467
-insert into t1 values (0,"error");
---error 1467
-replace into t1 values (0,"error");
-replace into t1 values (126,"first updated");
-replace into t1 values (63,default);
-select * from t1 order by a; # PBXT requires order
-drop table t1;
-
-# End of 4.1 tests
-
-#
-# Bug#19789: REPLACE was allowed for a VIEW with CHECK OPTION enabled.
-#
-CREATE TABLE t1 (f1 INT);
-CREATE VIEW v1 AS SELECT f1 FROM t1 WHERE f1 = 0 WITH CHECK OPTION;
---error 1369
-REPLACE INTO v1 (f1) VALUES (1);
-DROP TABLE t1;
-DROP VIEW v1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/rollback.test b/mysql-test/suite/pbxt/t/rollback.test
deleted file mode 100644
index 3b8ad901907..00000000000
--- a/mysql-test/suite/pbxt/t/rollback.test
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# This test should fail as MyISAM doesn't have rollback
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-# PS doesn't work with BEGIN ... ROLLBACK
---disable_ps_protocol
-
-create table t1 (n int not null primary key) engine=myisam;
-begin work;
-insert into t1 values (4);
-insert into t1 values (5);
-rollback;
-select @@warning_count;
-select @@error_count;
-show warnings;
-show errors;
-select * from t1;
-select @@warning_count;
-show warnings;
-drop table t1;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/schema.test b/mysql-test/suite/pbxt/t/schema.test
deleted file mode 100644
index 41e5231f690..00000000000
--- a/mysql-test/suite/pbxt/t/schema.test
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# Just a couple of tests to make sure that schema works.
-#
-# Drop mysqltest1 database, as it can left from the previous tests.
-#
-
---disable_warnings
-drop database if exists mysqltest1;
---enable_warnings
-
-create schema foo;
-show create schema foo;
-# force PBXT schema to be created
-create table t1 (id int) engine=pbxt;
-show schemas;
-drop schema foo;
-
---disable_query_log
-drop table if exists t1;
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/select.test b/mysql-test/suite/pbxt/t/select.test
deleted file mode 100644
index ff455e6e90b..00000000000
--- a/mysql-test/suite/pbxt/t/select.test
+++ /dev/null
@@ -1,3146 +0,0 @@
-#
-# Find string "NOTE NOTE NOTE" in order to find some 'unsure' tests
-#
-
-#
-# Simple select test
-#
-
---disable_warnings
-drop table if exists t1,t2,t3,t4,t11;
-# The following may be left from older tests
-drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa;
-drop view if exists v1;
---enable_warnings
-
-SET @save_optimizer_switch=@@optimizer_switch;
-SET optimizer_switch='outer_join_with_cache=off';
-
-CREATE TABLE t1 (
- Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
- Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
-);
-
-INSERT INTO t1 VALUES (9410,9412);
-
-select period from t1;
-select * from t1;
-select t1.* from t1;
-
-#
-# Create test table
-#
-
-CREATE TABLE t2 (
- auto int not null auto_increment,
- 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,
- UNIQUE fld1 (fld1),
- KEY fld3 (fld3),
- PRIMARY KEY (auto)
-);
-
-#
-# Populate table
-#
-
---disable_query_log
-INSERT INTO t2 VALUES (1,000001,00,'Omaha','teethe','neat','');
-INSERT INTO t2 VALUES (2,011401,37,'breaking','dreaded','Steinberg','W');
-INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring','');
-INSERT INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
-INSERT INTO t2 VALUES (5,011501,37,'bewilderingly','wallet','balled','');
-INSERT INTO t2 VALUES (6,011701,37,'astound','parters','persist','W');
-INSERT INTO t2 VALUES (7,011702,37,'admonishing','eschew','attainments','');
-INSERT INTO t2 VALUES (8,011703,37,'sumac','quitter','fanatic','');
-INSERT INTO t2 VALUES (9,012001,37,'flanking','neat','measures','FAS');
-INSERT INTO t2 VALUES (10,012003,37,'combed','Steinberg','rightfulness','');
-INSERT INTO t2 VALUES (11,012004,37,'subjective','jarring','capably','');
-INSERT INTO t2 VALUES (12,012005,37,'scatterbrain','tinily','impulsive','');
-INSERT INTO t2 VALUES (13,012301,37,'Eulerian','balled','starlet','');
-INSERT INTO t2 VALUES (14,012302,36,'dubbed','persist','terminators','');
-INSERT INTO t2 VALUES (15,012303,37,'Kane','attainments','untying','');
-INSERT INTO t2 VALUES (16,012304,37,'overlay','fanatic','announces','FAS');
-INSERT INTO t2 VALUES (17,012305,37,'perturb','measures','featherweight','FAS');
-INSERT INTO t2 VALUES (18,012306,37,'goblins','rightfulness','pessimist','FAS');
-INSERT INTO t2 VALUES (19,012501,37,'annihilates','capably','daughter','');
-INSERT INTO t2 VALUES (20,012602,37,'Wotan','impulsive','decliner','FAS');
-INSERT INTO t2 VALUES (21,012603,37,'snatching','starlet','lawgiver','');
-INSERT INTO t2 VALUES (22,012604,37,'concludes','terminators','stated','');
-INSERT INTO t2 VALUES (23,012605,37,'laterally','untying','readable','');
-INSERT INTO t2 VALUES (24,012606,37,'yelped','announces','attrition','');
-INSERT INTO t2 VALUES (25,012701,37,'grazing','featherweight','cascade','FAS');
-INSERT INTO t2 VALUES (26,012702,37,'Baird','pessimist','motors','FAS');
-INSERT INTO t2 VALUES (27,012703,37,'celery','daughter','interrogate','');
-INSERT INTO t2 VALUES (28,012704,37,'misunderstander','decliner','pests','W');
-INSERT INTO t2 VALUES (29,013601,37,'handgun','lawgiver','stairway','');
-INSERT INTO t2 VALUES (30,013602,37,'foldout','stated','dopers','FAS');
-INSERT INTO t2 VALUES (31,013603,37,'mystic','readable','testicle','W');
-INSERT INTO t2 VALUES (32,013604,37,'succumbed','attrition','Parsifal','W');
-INSERT INTO t2 VALUES (33,013605,37,'Nabisco','cascade','leavings','');
-INSERT INTO t2 VALUES (34,013606,37,'fingerings','motors','postulation','W');
-INSERT INTO t2 VALUES (35,013607,37,'aging','interrogate','squeaking','');
-INSERT INTO t2 VALUES (36,013608,37,'afield','pests','contrasted','');
-INSERT INTO t2 VALUES (37,013609,37,'ammonium','stairway','leftover','');
-INSERT INTO t2 VALUES (38,013610,37,'boat','dopers','whiteners','');
-INSERT INTO t2 VALUES (39,013801,37,'intelligibility','testicle','erases','W');
-INSERT INTO t2 VALUES (40,013802,37,'Augustine','Parsifal','Punjab','W');
-INSERT INTO t2 VALUES (41,013803,37,'teethe','leavings','Merritt','');
-INSERT INTO t2 VALUES (42,013804,37,'dreaded','postulation','Quixotism','');
-INSERT INTO t2 VALUES (43,013901,37,'scholastics','squeaking','sweetish','FAS');
-INSERT INTO t2 VALUES (44,016001,37,'audiology','contrasted','dogging','FAS');
-INSERT INTO t2 VALUES (45,016201,37,'wallet','leftover','scornfully','FAS');
-INSERT INTO t2 VALUES (46,016202,37,'parters','whiteners','bellow','');
-INSERT INTO t2 VALUES (47,016301,37,'eschew','erases','bills','');
-INSERT INTO t2 VALUES (48,016302,37,'quitter','Punjab','cupboard','FAS');
-INSERT INTO t2 VALUES (49,016303,37,'neat','Merritt','sureties','FAS');
-INSERT INTO t2 VALUES (50,016304,37,'Steinberg','Quixotism','puddings','');
-INSERT INTO t2 VALUES (51,018001,37,'jarring','sweetish','tapestry','');
-INSERT INTO t2 VALUES (52,018002,37,'tinily','dogging','fetters','');
-INSERT INTO t2 VALUES (53,018003,37,'balled','scornfully','bivalves','');
-INSERT INTO t2 VALUES (54,018004,37,'persist','bellow','incurring','');
-INSERT INTO t2 VALUES (55,018005,37,'attainments','bills','Adolph','');
-INSERT INTO t2 VALUES (56,018007,37,'fanatic','cupboard','pithed','');
-INSERT INTO t2 VALUES (57,018008,37,'measures','sureties','emergency','');
-INSERT INTO t2 VALUES (58,018009,37,'rightfulness','puddings','Miles','');
-INSERT INTO t2 VALUES (59,018010,37,'capably','tapestry','trimmings','');
-INSERT INTO t2 VALUES (60,018012,37,'impulsive','fetters','tragedies','W');
-INSERT INTO t2 VALUES (61,018013,37,'starlet','bivalves','skulking','W');
-INSERT INTO t2 VALUES (62,018014,37,'terminators','incurring','flint','');
-INSERT INTO t2 VALUES (63,018015,37,'untying','Adolph','flopping','W');
-INSERT INTO t2 VALUES (64,018016,37,'announces','pithed','relaxing','FAS');
-INSERT INTO t2 VALUES (65,018017,37,'featherweight','emergency','offload','FAS');
-INSERT INTO t2 VALUES (66,018018,37,'pessimist','Miles','suites','W');
-INSERT INTO t2 VALUES (67,018019,37,'daughter','trimmings','lists','FAS');
-INSERT INTO t2 VALUES (68,018020,37,'decliner','tragedies','animized','FAS');
-INSERT INTO t2 VALUES (69,018021,37,'lawgiver','skulking','multilayer','W');
-INSERT INTO t2 VALUES (70,018022,37,'stated','flint','standardizes','FAS');
-INSERT INTO t2 VALUES (71,018023,37,'readable','flopping','Judas','');
-INSERT INTO t2 VALUES (72,018024,37,'attrition','relaxing','vacuuming','W');
-INSERT INTO t2 VALUES (73,018025,37,'cascade','offload','dentally','W');
-INSERT INTO t2 VALUES (74,018026,37,'motors','suites','humanness','W');
-INSERT INTO t2 VALUES (75,018027,37,'interrogate','lists','inch','W');
-INSERT INTO t2 VALUES (76,018028,37,'pests','animized','Weissmuller','W');
-INSERT INTO t2 VALUES (77,018029,37,'stairway','multilayer','irresponsibly','W');
-INSERT INTO t2 VALUES (78,018030,37,'dopers','standardizes','luckily','FAS');
-INSERT INTO t2 VALUES (79,018032,37,'testicle','Judas','culled','W');
-INSERT INTO t2 VALUES (80,018033,37,'Parsifal','vacuuming','medical','FAS');
-INSERT INTO t2 VALUES (81,018034,37,'leavings','dentally','bloodbath','FAS');
-INSERT INTO t2 VALUES (82,018035,37,'postulation','humanness','subschema','W');
-INSERT INTO t2 VALUES (83,018036,37,'squeaking','inch','animals','W');
-INSERT INTO t2 VALUES (84,018037,37,'contrasted','Weissmuller','Micronesia','');
-INSERT INTO t2 VALUES (85,018038,37,'leftover','irresponsibly','repetitions','');
-INSERT INTO t2 VALUES (86,018039,37,'whiteners','luckily','Antares','');
-INSERT INTO t2 VALUES (87,018040,37,'erases','culled','ventilate','W');
-INSERT INTO t2 VALUES (88,018041,37,'Punjab','medical','pityingly','');
-INSERT INTO t2 VALUES (89,018042,37,'Merritt','bloodbath','interdependent','');
-INSERT INTO t2 VALUES (90,018043,37,'Quixotism','subschema','Graves','FAS');
-INSERT INTO t2 VALUES (91,018044,37,'sweetish','animals','neonatal','');
-INSERT INTO t2 VALUES (92,018045,37,'dogging','Micronesia','scribbled','FAS');
-INSERT INTO t2 VALUES (93,018046,37,'scornfully','repetitions','chafe','W');
-INSERT INTO t2 VALUES (94,018048,37,'bellow','Antares','honoring','');
-INSERT INTO t2 VALUES (95,018049,37,'bills','ventilate','realtor','');
-INSERT INTO t2 VALUES (96,018050,37,'cupboard','pityingly','elite','');
-INSERT INTO t2 VALUES (97,018051,37,'sureties','interdependent','funereal','');
-INSERT INTO t2 VALUES (98,018052,37,'puddings','Graves','abrogating','');
-INSERT INTO t2 VALUES (99,018053,50,'tapestry','neonatal','sorters','');
-INSERT INTO t2 VALUES (100,018054,37,'fetters','scribbled','Conley','');
-INSERT INTO t2 VALUES (101,018055,37,'bivalves','chafe','lectured','');
-INSERT INTO t2 VALUES (102,018056,37,'incurring','honoring','Abraham','');
-INSERT INTO t2 VALUES (103,018057,37,'Adolph','realtor','Hawaii','W');
-INSERT INTO t2 VALUES (104,018058,37,'pithed','elite','cage','');
-INSERT INTO t2 VALUES (105,018059,36,'emergency','funereal','hushes','');
-INSERT INTO t2 VALUES (106,018060,37,'Miles','abrogating','Simla','');
-INSERT INTO t2 VALUES (107,018061,37,'trimmings','sorters','reporters','');
-INSERT INTO t2 VALUES (108,018101,37,'tragedies','Conley','Dutchman','FAS');
-INSERT INTO t2 VALUES (109,018102,37,'skulking','lectured','descendants','FAS');
-INSERT INTO t2 VALUES (110,018103,37,'flint','Abraham','groupings','FAS');
-INSERT INTO t2 VALUES (111,018104,37,'flopping','Hawaii','dissociate','');
-INSERT INTO t2 VALUES (112,018201,37,'relaxing','cage','coexist','W');
-INSERT INTO t2 VALUES (113,018202,37,'offload','hushes','Beebe','');
-INSERT INTO t2 VALUES (114,018402,37,'suites','Simla','Taoism','');
-INSERT INTO t2 VALUES (115,018403,37,'lists','reporters','Connally','');
-INSERT INTO t2 VALUES (116,018404,37,'animized','Dutchman','fetched','FAS');
-INSERT INTO t2 VALUES (117,018405,37,'multilayer','descendants','checkpoints','FAS');
-INSERT INTO t2 VALUES (118,018406,37,'standardizes','groupings','rusting','');
-INSERT INTO t2 VALUES (119,018409,37,'Judas','dissociate','galling','');
-INSERT INTO t2 VALUES (120,018601,37,'vacuuming','coexist','obliterates','');
-INSERT INTO t2 VALUES (121,018602,37,'dentally','Beebe','traitor','');
-INSERT INTO t2 VALUES (122,018603,37,'humanness','Taoism','resumes','FAS');
-INSERT INTO t2 VALUES (123,018801,37,'inch','Connally','analyzable','FAS');
-INSERT INTO t2 VALUES (124,018802,37,'Weissmuller','fetched','terminator','FAS');
-INSERT INTO t2 VALUES (125,018803,37,'irresponsibly','checkpoints','gritty','FAS');
-INSERT INTO t2 VALUES (126,018804,37,'luckily','rusting','firearm','W');
-INSERT INTO t2 VALUES (127,018805,37,'culled','galling','minima','');
-INSERT INTO t2 VALUES (128,018806,37,'medical','obliterates','Selfridge','');
-INSERT INTO t2 VALUES (129,018807,37,'bloodbath','traitor','disable','');
-INSERT INTO t2 VALUES (130,018808,37,'subschema','resumes','witchcraft','W');
-INSERT INTO t2 VALUES (131,018809,37,'animals','analyzable','betroth','W');
-INSERT INTO t2 VALUES (132,018810,37,'Micronesia','terminator','Manhattanize','');
-INSERT INTO t2 VALUES (133,018811,37,'repetitions','gritty','imprint','');
-INSERT INTO t2 VALUES (134,018812,37,'Antares','firearm','peeked','');
-INSERT INTO t2 VALUES (135,019101,37,'ventilate','minima','swelling','');
-INSERT INTO t2 VALUES (136,019102,37,'pityingly','Selfridge','interrelationships','W');
-INSERT INTO t2 VALUES (137,019103,37,'interdependent','disable','riser','');
-INSERT INTO t2 VALUES (138,019201,37,'Graves','witchcraft','Gandhian','W');
-INSERT INTO t2 VALUES (139,030501,37,'neonatal','betroth','peacock','A');
-INSERT INTO t2 VALUES (140,030502,50,'scribbled','Manhattanize','bee','A');
-INSERT INTO t2 VALUES (141,030503,37,'chafe','imprint','kanji','');
-INSERT INTO t2 VALUES (142,030504,37,'honoring','peeked','dental','');
-INSERT INTO t2 VALUES (143,031901,37,'realtor','swelling','scarf','FAS');
-INSERT INTO t2 VALUES (144,036001,37,'elite','interrelationships','chasm','A');
-INSERT INTO t2 VALUES (145,036002,37,'funereal','riser','insolence','A');
-INSERT INTO t2 VALUES (146,036004,37,'abrogating','Gandhian','syndicate','');
-INSERT INTO t2 VALUES (147,036005,37,'sorters','peacock','alike','');
-INSERT INTO t2 VALUES (148,038001,37,'Conley','bee','imperial','A');
-INSERT INTO t2 VALUES (149,038002,37,'lectured','kanji','convulsion','A');
-INSERT INTO t2 VALUES (150,038003,37,'Abraham','dental','railway','A');
-INSERT INTO t2 VALUES (151,038004,37,'Hawaii','scarf','validate','A');
-INSERT INTO t2 VALUES (152,038005,37,'cage','chasm','normalizes','A');
-INSERT INTO t2 VALUES (153,038006,37,'hushes','insolence','comprehensive','');
-INSERT INTO t2 VALUES (154,038007,37,'Simla','syndicate','chewing','');
-INSERT INTO t2 VALUES (155,038008,37,'reporters','alike','denizen','');
-INSERT INTO t2 VALUES (156,038009,37,'Dutchman','imperial','schemer','');
-INSERT INTO t2 VALUES (157,038010,37,'descendants','convulsion','chronicle','');
-INSERT INTO t2 VALUES (158,038011,37,'groupings','railway','Kline','');
-INSERT INTO t2 VALUES (159,038012,37,'dissociate','validate','Anatole','');
-INSERT INTO t2 VALUES (160,038013,37,'coexist','normalizes','partridges','');
-INSERT INTO t2 VALUES (161,038014,37,'Beebe','comprehensive','brunch','');
-INSERT INTO t2 VALUES (162,038015,37,'Taoism','chewing','recruited','');
-INSERT INTO t2 VALUES (163,038016,37,'Connally','denizen','dimensions','W');
-INSERT INTO t2 VALUES (164,038017,37,'fetched','schemer','Chicana','W');
-INSERT INTO t2 VALUES (165,038018,37,'checkpoints','chronicle','announced','');
-INSERT INTO t2 VALUES (166,038101,37,'rusting','Kline','praised','FAS');
-INSERT INTO t2 VALUES (167,038102,37,'galling','Anatole','employing','');
-INSERT INTO t2 VALUES (168,038103,37,'obliterates','partridges','linear','');
-INSERT INTO t2 VALUES (169,038104,37,'traitor','brunch','quagmire','');
-INSERT INTO t2 VALUES (170,038201,37,'resumes','recruited','western','A');
-INSERT INTO t2 VALUES (171,038202,37,'analyzable','dimensions','relishing','');
-INSERT INTO t2 VALUES (172,038203,37,'terminator','Chicana','serving','A');
-INSERT INTO t2 VALUES (173,038204,37,'gritty','announced','scheduling','');
-INSERT INTO t2 VALUES (174,038205,37,'firearm','praised','lore','');
-INSERT INTO t2 VALUES (175,038206,37,'minima','employing','eventful','');
-INSERT INTO t2 VALUES (176,038208,37,'Selfridge','linear','arteriole','A');
-INSERT INTO t2 VALUES (177,042801,37,'disable','quagmire','disentangle','');
-INSERT INTO t2 VALUES (178,042802,37,'witchcraft','western','cured','A');
-INSERT INTO t2 VALUES (179,046101,37,'betroth','relishing','Fenton','W');
-INSERT INTO t2 VALUES (180,048001,37,'Manhattanize','serving','avoidable','A');
-INSERT INTO t2 VALUES (181,048002,37,'imprint','scheduling','drains','A');
-INSERT INTO t2 VALUES (182,048003,37,'peeked','lore','detectably','FAS');
-INSERT INTO t2 VALUES (183,048004,37,'swelling','eventful','husky','');
-INSERT INTO t2 VALUES (184,048005,37,'interrelationships','arteriole','impelling','');
-INSERT INTO t2 VALUES (185,048006,37,'riser','disentangle','undoes','');
-INSERT INTO t2 VALUES (186,048007,37,'Gandhian','cured','evened','');
-INSERT INTO t2 VALUES (187,048008,37,'peacock','Fenton','squeezes','');
-INSERT INTO t2 VALUES (188,048101,37,'bee','avoidable','destroyer','FAS');
-INSERT INTO t2 VALUES (189,048102,37,'kanji','drains','rudeness','');
-INSERT INTO t2 VALUES (190,048201,37,'dental','detectably','beaner','FAS');
-INSERT INTO t2 VALUES (191,048202,37,'scarf','husky','boorish','');
-INSERT INTO t2 VALUES (192,048203,37,'chasm','impelling','Everhart','');
-INSERT INTO t2 VALUES (193,048204,37,'insolence','undoes','encompass','A');
-INSERT INTO t2 VALUES (194,048205,37,'syndicate','evened','mushrooms','');
-INSERT INTO t2 VALUES (195,048301,37,'alike','squeezes','Alison','A');
-INSERT INTO t2 VALUES (196,048302,37,'imperial','destroyer','externally','FAS');
-INSERT INTO t2 VALUES (197,048303,37,'convulsion','rudeness','pellagra','');
-INSERT INTO t2 VALUES (198,048304,37,'railway','beaner','cult','');
-INSERT INTO t2 VALUES (199,048305,37,'validate','boorish','creek','A');
-INSERT INTO t2 VALUES (200,048401,37,'normalizes','Everhart','Huffman','');
-INSERT INTO t2 VALUES (201,048402,37,'comprehensive','encompass','Majorca','FAS');
-INSERT INTO t2 VALUES (202,048403,37,'chewing','mushrooms','governing','A');
-INSERT INTO t2 VALUES (203,048404,37,'denizen','Alison','gadfly','FAS');
-INSERT INTO t2 VALUES (204,048405,37,'schemer','externally','reassigned','FAS');
-INSERT INTO t2 VALUES (205,048406,37,'chronicle','pellagra','intentness','W');
-INSERT INTO t2 VALUES (206,048407,37,'Kline','cult','craziness','');
-INSERT INTO t2 VALUES (207,048408,37,'Anatole','creek','psychic','');
-INSERT INTO t2 VALUES (208,048409,37,'partridges','Huffman','squabbled','');
-INSERT INTO t2 VALUES (209,048410,37,'brunch','Majorca','burlesque','');
-INSERT INTO t2 VALUES (210,048411,37,'recruited','governing','capped','');
-INSERT INTO t2 VALUES (211,048412,37,'dimensions','gadfly','extracted','A');
-INSERT INTO t2 VALUES (212,048413,37,'Chicana','reassigned','DiMaggio','');
-INSERT INTO t2 VALUES (213,048601,37,'announced','intentness','exclamation','FAS');
-INSERT INTO t2 VALUES (214,048602,37,'praised','craziness','subdirectory','');
-INSERT INTO t2 VALUES (215,048603,37,'employing','psychic','fangs','');
-INSERT INTO t2 VALUES (216,048604,37,'linear','squabbled','buyer','A');
-INSERT INTO t2 VALUES (217,048801,37,'quagmire','burlesque','pithing','A');
-INSERT INTO t2 VALUES (218,050901,37,'western','capped','transistorizing','A');
-INSERT INTO t2 VALUES (219,051201,37,'relishing','extracted','nonbiodegradable','');
-INSERT INTO t2 VALUES (220,056002,37,'serving','DiMaggio','dislocate','');
-INSERT INTO t2 VALUES (221,056003,37,'scheduling','exclamation','monochromatic','FAS');
-INSERT INTO t2 VALUES (222,056004,37,'lore','subdirectory','batting','');
-INSERT INTO t2 VALUES (223,056102,37,'eventful','fangs','postcondition','A');
-INSERT INTO t2 VALUES (224,056203,37,'arteriole','buyer','catalog','FAS');
-INSERT INTO t2 VALUES (225,056204,37,'disentangle','pithing','Remus','');
-INSERT INTO t2 VALUES (226,058003,37,'cured','transistorizing','devices','A');
-INSERT INTO t2 VALUES (227,058004,37,'Fenton','nonbiodegradable','bike','A');
-INSERT INTO t2 VALUES (228,058005,37,'avoidable','dislocate','qualify','');
-INSERT INTO t2 VALUES (229,058006,37,'drains','monochromatic','detained','');
-INSERT INTO t2 VALUES (230,058007,37,'detectably','batting','commended','');
-INSERT INTO t2 VALUES (231,058101,37,'husky','postcondition','civilize','');
-INSERT INTO t2 VALUES (232,058102,37,'impelling','catalog','Elmhurst','');
-INSERT INTO t2 VALUES (233,058103,37,'undoes','Remus','anesthetizing','');
-INSERT INTO t2 VALUES (234,058105,37,'evened','devices','deaf','');
-INSERT INTO t2 VALUES (235,058111,37,'squeezes','bike','Brigham','');
-INSERT INTO t2 VALUES (236,058112,37,'destroyer','qualify','title','');
-INSERT INTO t2 VALUES (237,058113,37,'rudeness','detained','coarse','');
-INSERT INTO t2 VALUES (238,058114,37,'beaner','commended','combinations','');
-INSERT INTO t2 VALUES (239,058115,37,'boorish','civilize','grayness','');
-INSERT INTO t2 VALUES (240,058116,37,'Everhart','Elmhurst','innumerable','FAS');
-INSERT INTO t2 VALUES (241,058117,37,'encompass','anesthetizing','Caroline','A');
-INSERT INTO t2 VALUES (242,058118,37,'mushrooms','deaf','fatty','FAS');
-INSERT INTO t2 VALUES (243,058119,37,'Alison','Brigham','eastbound','');
-INSERT INTO t2 VALUES (244,058120,37,'externally','title','inexperienced','');
-INSERT INTO t2 VALUES (245,058121,37,'pellagra','coarse','hoarder','A');
-INSERT INTO t2 VALUES (246,058122,37,'cult','combinations','scotch','W');
-INSERT INTO t2 VALUES (247,058123,37,'creek','grayness','passport','A');
-INSERT INTO t2 VALUES (248,058124,37,'Huffman','innumerable','strategic','FAS');
-INSERT INTO t2 VALUES (249,058125,37,'Majorca','Caroline','gated','');
-INSERT INTO t2 VALUES (250,058126,37,'governing','fatty','flog','');
-INSERT INTO t2 VALUES (251,058127,37,'gadfly','eastbound','Pipestone','');
-INSERT INTO t2 VALUES (252,058128,37,'reassigned','inexperienced','Dar','');
-INSERT INTO t2 VALUES (253,058201,37,'intentness','hoarder','Corcoran','');
-INSERT INTO t2 VALUES (254,058202,37,'craziness','scotch','flyers','A');
-INSERT INTO t2 VALUES (255,058303,37,'psychic','passport','competitions','W');
-INSERT INTO t2 VALUES (256,058304,37,'squabbled','strategic','suppliers','FAS');
-INSERT INTO t2 VALUES (257,058602,37,'burlesque','gated','skips','');
-INSERT INTO t2 VALUES (258,058603,37,'capped','flog','institutes','');
-INSERT INTO t2 VALUES (259,058604,37,'extracted','Pipestone','troop','A');
-INSERT INTO t2 VALUES (260,058605,37,'DiMaggio','Dar','connective','W');
-INSERT INTO t2 VALUES (261,058606,37,'exclamation','Corcoran','denies','');
-INSERT INTO t2 VALUES (262,058607,37,'subdirectory','flyers','polka','');
-INSERT INTO t2 VALUES (263,060401,36,'fangs','competitions','observations','FAS');
-INSERT INTO t2 VALUES (264,061701,36,'buyer','suppliers','askers','');
-INSERT INTO t2 VALUES (265,066201,36,'pithing','skips','homeless','FAS');
-INSERT INTO t2 VALUES (266,066501,36,'transistorizing','institutes','Anna','');
-INSERT INTO t2 VALUES (267,068001,36,'nonbiodegradable','troop','subdirectories','W');
-INSERT INTO t2 VALUES (268,068002,36,'dislocate','connective','decaying','FAS');
-INSERT INTO t2 VALUES (269,068005,36,'monochromatic','denies','outwitting','W');
-INSERT INTO t2 VALUES (270,068006,36,'batting','polka','Harpy','W');
-INSERT INTO t2 VALUES (271,068007,36,'postcondition','observations','crazed','');
-INSERT INTO t2 VALUES (272,068008,36,'catalog','askers','suffocate','');
-INSERT INTO t2 VALUES (273,068009,36,'Remus','homeless','provers','FAS');
-INSERT INTO t2 VALUES (274,068010,36,'devices','Anna','technically','');
-INSERT INTO t2 VALUES (275,068011,36,'bike','subdirectories','Franklinizations','');
-INSERT INTO t2 VALUES (276,068202,36,'qualify','decaying','considered','');
-INSERT INTO t2 VALUES (277,068302,36,'detained','outwitting','tinnily','');
-INSERT INTO t2 VALUES (278,068303,36,'commended','Harpy','uninterruptedly','');
-INSERT INTO t2 VALUES (279,068401,36,'civilize','crazed','whistled','A');
-INSERT INTO t2 VALUES (280,068501,36,'Elmhurst','suffocate','automate','');
-INSERT INTO t2 VALUES (281,068502,36,'anesthetizing','provers','gutting','W');
-INSERT INTO t2 VALUES (282,068503,36,'deaf','technically','surreptitious','');
-INSERT INTO t2 VALUES (283,068602,36,'Brigham','Franklinizations','Choctaw','');
-INSERT INTO t2 VALUES (284,068603,36,'title','considered','cooks','');
-INSERT INTO t2 VALUES (285,068701,36,'coarse','tinnily','millivolt','FAS');
-INSERT INTO t2 VALUES (286,068702,36,'combinations','uninterruptedly','counterpoise','');
-INSERT INTO t2 VALUES (287,068703,36,'grayness','whistled','Gothicism','');
-INSERT INTO t2 VALUES (288,076001,36,'innumerable','automate','feminine','');
-INSERT INTO t2 VALUES (289,076002,36,'Caroline','gutting','metaphysically','W');
-INSERT INTO t2 VALUES (290,076101,36,'fatty','surreptitious','sanding','A');
-INSERT INTO t2 VALUES (291,076102,36,'eastbound','Choctaw','contributorily','');
-INSERT INTO t2 VALUES (292,076103,36,'inexperienced','cooks','receivers','FAS');
-INSERT INTO t2 VALUES (293,076302,36,'hoarder','millivolt','adjourn','');
-INSERT INTO t2 VALUES (294,076303,36,'scotch','counterpoise','straggled','A');
-INSERT INTO t2 VALUES (295,076304,36,'passport','Gothicism','druggists','');
-INSERT INTO t2 VALUES (296,076305,36,'strategic','feminine','thanking','FAS');
-INSERT INTO t2 VALUES (297,076306,36,'gated','metaphysically','ostrich','');
-INSERT INTO t2 VALUES (298,076307,36,'flog','sanding','hopelessness','FAS');
-INSERT INTO t2 VALUES (299,076402,36,'Pipestone','contributorily','Eurydice','');
-INSERT INTO t2 VALUES (300,076501,36,'Dar','receivers','excitation','W');
-INSERT INTO t2 VALUES (301,076502,36,'Corcoran','adjourn','presumes','FAS');
-INSERT INTO t2 VALUES (302,076701,36,'flyers','straggled','imaginable','FAS');
-INSERT INTO t2 VALUES (303,078001,36,'competitions','druggists','concoct','W');
-INSERT INTO t2 VALUES (304,078002,36,'suppliers','thanking','peering','W');
-INSERT INTO t2 VALUES (305,078003,36,'skips','ostrich','Phelps','FAS');
-INSERT INTO t2 VALUES (306,078004,36,'institutes','hopelessness','ferociousness','FAS');
-INSERT INTO t2 VALUES (307,078005,36,'troop','Eurydice','sentences','');
-INSERT INTO t2 VALUES (308,078006,36,'connective','excitation','unlocks','');
-INSERT INTO t2 VALUES (309,078007,36,'denies','presumes','engrossing','W');
-INSERT INTO t2 VALUES (310,078008,36,'polka','imaginable','Ruth','');
-INSERT INTO t2 VALUES (311,078101,36,'observations','concoct','tying','');
-INSERT INTO t2 VALUES (312,078103,36,'askers','peering','exclaimers','');
-INSERT INTO t2 VALUES (313,078104,36,'homeless','Phelps','synergy','');
-INSERT INTO t2 VALUES (314,078105,36,'Anna','ferociousness','Huey','W');
-INSERT INTO t2 VALUES (315,082101,36,'subdirectories','sentences','merging','');
-INSERT INTO t2 VALUES (316,083401,36,'decaying','unlocks','judges','A');
-INSERT INTO t2 VALUES (317,084001,36,'outwitting','engrossing','Shylock','W');
-INSERT INTO t2 VALUES (318,084002,36,'Harpy','Ruth','Miltonism','');
-INSERT INTO t2 VALUES (319,086001,36,'crazed','tying','hen','W');
-INSERT INTO t2 VALUES (320,086102,36,'suffocate','exclaimers','honeybee','FAS');
-INSERT INTO t2 VALUES (321,086201,36,'provers','synergy','towers','');
-INSERT INTO t2 VALUES (322,088001,36,'technically','Huey','dilutes','W');
-INSERT INTO t2 VALUES (323,088002,36,'Franklinizations','merging','numerals','FAS');
-INSERT INTO t2 VALUES (324,088003,36,'considered','judges','democracy','FAS');
-INSERT INTO t2 VALUES (325,088004,36,'tinnily','Shylock','Ibero-','');
-INSERT INTO t2 VALUES (326,088101,36,'uninterruptedly','Miltonism','invalids','');
-INSERT INTO t2 VALUES (327,088102,36,'whistled','hen','behavior','');
-INSERT INTO t2 VALUES (328,088103,36,'automate','honeybee','accruing','');
-INSERT INTO t2 VALUES (329,088104,36,'gutting','towers','relics','A');
-INSERT INTO t2 VALUES (330,088105,36,'surreptitious','dilutes','rackets','');
-INSERT INTO t2 VALUES (331,088106,36,'Choctaw','numerals','Fischbein','W');
-INSERT INTO t2 VALUES (332,088201,36,'cooks','democracy','phony','W');
-INSERT INTO t2 VALUES (333,088203,36,'millivolt','Ibero-','cross','FAS');
-INSERT INTO t2 VALUES (334,088204,36,'counterpoise','invalids','cleanup','');
-INSERT INTO t2 VALUES (335,088302,37,'Gothicism','behavior','conspirator','');
-INSERT INTO t2 VALUES (336,088303,37,'feminine','accruing','label','FAS');
-INSERT INTO t2 VALUES (337,088305,37,'metaphysically','relics','university','');
-INSERT INTO t2 VALUES (338,088402,37,'sanding','rackets','cleansed','FAS');
-INSERT INTO t2 VALUES (339,088501,36,'contributorily','Fischbein','ballgown','');
-INSERT INTO t2 VALUES (340,088502,36,'receivers','phony','starlet','');
-INSERT INTO t2 VALUES (341,088503,36,'adjourn','cross','aqueous','');
-INSERT INTO t2 VALUES (342,098001,58,'straggled','cleanup','portrayal','A');
-INSERT INTO t2 VALUES (343,098002,58,'druggists','conspirator','despising','W');
-INSERT INTO t2 VALUES (344,098003,58,'thanking','label','distort','W');
-INSERT INTO t2 VALUES (345,098004,58,'ostrich','university','palmed','');
-INSERT INTO t2 VALUES (346,098005,58,'hopelessness','cleansed','faced','');
-INSERT INTO t2 VALUES (347,098006,58,'Eurydice','ballgown','silverware','');
-INSERT INTO t2 VALUES (348,141903,29,'excitation','starlet','assessor','');
-INSERT INTO t2 VALUES (349,098008,58,'presumes','aqueous','spiders','');
-INSERT INTO t2 VALUES (350,098009,58,'imaginable','portrayal','artificially','');
-INSERT INTO t2 VALUES (351,098010,58,'concoct','despising','reminiscence','');
-INSERT INTO t2 VALUES (352,098011,58,'peering','distort','Mexican','');
-INSERT INTO t2 VALUES (353,098012,58,'Phelps','palmed','obnoxious','');
-INSERT INTO t2 VALUES (354,098013,58,'ferociousness','faced','fragile','');
-INSERT INTO t2 VALUES (355,098014,58,'sentences','silverware','apprehensible','');
-INSERT INTO t2 VALUES (356,098015,58,'unlocks','assessor','births','');
-INSERT INTO t2 VALUES (357,098016,58,'engrossing','spiders','garages','');
-INSERT INTO t2 VALUES (358,098017,58,'Ruth','artificially','panty','');
-INSERT INTO t2 VALUES (359,098018,58,'tying','reminiscence','anteater','');
-INSERT INTO t2 VALUES (360,098019,58,'exclaimers','Mexican','displacement','A');
-INSERT INTO t2 VALUES (361,098020,58,'synergy','obnoxious','drovers','A');
-INSERT INTO t2 VALUES (362,098021,58,'Huey','fragile','patenting','A');
-INSERT INTO t2 VALUES (363,098022,58,'merging','apprehensible','far','A');
-INSERT INTO t2 VALUES (364,098023,58,'judges','births','shrieks','');
-INSERT INTO t2 VALUES (365,098024,58,'Shylock','garages','aligning','W');
-INSERT INTO t2 VALUES (366,098025,37,'Miltonism','panty','pragmatism','');
-INSERT INTO t2 VALUES (367,106001,36,'hen','anteater','fevers','W');
-INSERT INTO t2 VALUES (368,108001,36,'honeybee','displacement','reexamines','A');
-INSERT INTO t2 VALUES (369,108002,36,'towers','drovers','occupancies','');
-INSERT INTO t2 VALUES (370,108003,36,'dilutes','patenting','sweats','FAS');
-INSERT INTO t2 VALUES (371,108004,36,'numerals','far','modulators','');
-INSERT INTO t2 VALUES (372,108005,36,'democracy','shrieks','demand','W');
-INSERT INTO t2 VALUES (373,108007,36,'Ibero-','aligning','Madeira','');
-INSERT INTO t2 VALUES (374,108008,36,'invalids','pragmatism','Viennese','W');
-INSERT INTO t2 VALUES (375,108009,36,'behavior','fevers','chillier','W');
-INSERT INTO t2 VALUES (376,108010,36,'accruing','reexamines','wildcats','FAS');
-INSERT INTO t2 VALUES (377,108011,36,'relics','occupancies','gentle','');
-INSERT INTO t2 VALUES (378,108012,36,'rackets','sweats','Angles','W');
-INSERT INTO t2 VALUES (379,108101,36,'Fischbein','modulators','accuracies','');
-INSERT INTO t2 VALUES (380,108102,36,'phony','demand','toggle','');
-INSERT INTO t2 VALUES (381,108103,36,'cross','Madeira','Mendelssohn','W');
-INSERT INTO t2 VALUES (382,108111,50,'cleanup','Viennese','behaviorally','');
-INSERT INTO t2 VALUES (383,108105,36,'conspirator','chillier','Rochford','');
-INSERT INTO t2 VALUES (384,108106,36,'label','wildcats','mirror','W');
-INSERT INTO t2 VALUES (385,108107,36,'university','gentle','Modula','');
-INSERT INTO t2 VALUES (386,108108,50,'cleansed','Angles','clobbering','');
-INSERT INTO t2 VALUES (387,108109,36,'ballgown','accuracies','chronography','');
-INSERT INTO t2 VALUES (388,108110,36,'starlet','toggle','Eskimoizeds','');
-INSERT INTO t2 VALUES (389,108201,36,'aqueous','Mendelssohn','British','W');
-INSERT INTO t2 VALUES (390,108202,36,'portrayal','behaviorally','pitfalls','');
-INSERT INTO t2 VALUES (391,108203,36,'despising','Rochford','verify','W');
-INSERT INTO t2 VALUES (392,108204,36,'distort','mirror','scatter','FAS');
-INSERT INTO t2 VALUES (393,108205,36,'palmed','Modula','Aztecan','');
-INSERT INTO t2 VALUES (394,108301,36,'faced','clobbering','acuity','W');
-INSERT INTO t2 VALUES (395,108302,36,'silverware','chronography','sinking','W');
-INSERT INTO t2 VALUES (396,112101,36,'assessor','Eskimoizeds','beasts','FAS');
-INSERT INTO t2 VALUES (397,112102,36,'spiders','British','Witt','W');
-INSERT INTO t2 VALUES (398,113701,36,'artificially','pitfalls','physicists','FAS');
-INSERT INTO t2 VALUES (399,116001,36,'reminiscence','verify','folksong','A');
-INSERT INTO t2 VALUES (400,116201,36,'Mexican','scatter','strokes','FAS');
-INSERT INTO t2 VALUES (401,116301,36,'obnoxious','Aztecan','crowder','');
-INSERT INTO t2 VALUES (402,116302,36,'fragile','acuity','merry','');
-INSERT INTO t2 VALUES (403,116601,36,'apprehensible','sinking','cadenced','');
-INSERT INTO t2 VALUES (404,116602,36,'births','beasts','alimony','A');
-INSERT INTO t2 VALUES (405,116603,36,'garages','Witt','principled','A');
-INSERT INTO t2 VALUES (406,116701,36,'panty','physicists','golfing','');
-INSERT INTO t2 VALUES (407,116702,36,'anteater','folksong','undiscovered','');
-INSERT INTO t2 VALUES (408,118001,36,'displacement','strokes','irritates','');
-INSERT INTO t2 VALUES (409,118002,36,'drovers','crowder','patriots','A');
-INSERT INTO t2 VALUES (410,118003,36,'patenting','merry','rooms','FAS');
-INSERT INTO t2 VALUES (411,118004,36,'far','cadenced','towering','W');
-INSERT INTO t2 VALUES (412,118005,36,'shrieks','alimony','displease','');
-INSERT INTO t2 VALUES (413,118006,36,'aligning','principled','photosensitive','');
-INSERT INTO t2 VALUES (414,118007,36,'pragmatism','golfing','inking','');
-INSERT INTO t2 VALUES (415,118008,36,'fevers','undiscovered','gainers','');
-INSERT INTO t2 VALUES (416,118101,36,'reexamines','irritates','leaning','A');
-INSERT INTO t2 VALUES (417,118102,36,'occupancies','patriots','hydrant','A');
-INSERT INTO t2 VALUES (418,118103,36,'sweats','rooms','preserve','');
-INSERT INTO t2 VALUES (419,118202,36,'modulators','towering','blinded','A');
-INSERT INTO t2 VALUES (420,118203,36,'demand','displease','interactions','A');
-INSERT INTO t2 VALUES (421,118204,36,'Madeira','photosensitive','Barry','');
-INSERT INTO t2 VALUES (422,118302,36,'Viennese','inking','whiteness','A');
-INSERT INTO t2 VALUES (423,118304,36,'chillier','gainers','pastimes','W');
-INSERT INTO t2 VALUES (424,118305,36,'wildcats','leaning','Edenization','');
-INSERT INTO t2 VALUES (425,118306,36,'gentle','hydrant','Muscat','');
-INSERT INTO t2 VALUES (426,118307,36,'Angles','preserve','assassinated','');
-INSERT INTO t2 VALUES (427,123101,36,'accuracies','blinded','labeled','');
-INSERT INTO t2 VALUES (428,123102,36,'toggle','interactions','glacial','A');
-INSERT INTO t2 VALUES (429,123301,36,'Mendelssohn','Barry','implied','W');
-INSERT INTO t2 VALUES (430,126001,36,'behaviorally','whiteness','bibliographies','W');
-INSERT INTO t2 VALUES (431,126002,36,'Rochford','pastimes','Buchanan','');
-INSERT INTO t2 VALUES (432,126003,36,'mirror','Edenization','forgivably','FAS');
-INSERT INTO t2 VALUES (433,126101,36,'Modula','Muscat','innuendo','A');
-INSERT INTO t2 VALUES (434,126301,36,'clobbering','assassinated','den','FAS');
-INSERT INTO t2 VALUES (435,126302,36,'chronography','labeled','submarines','W');
-INSERT INTO t2 VALUES (436,126402,36,'Eskimoizeds','glacial','mouthful','A');
-INSERT INTO t2 VALUES (437,126601,36,'British','implied','expiring','');
-INSERT INTO t2 VALUES (438,126602,36,'pitfalls','bibliographies','unfulfilled','FAS');
-INSERT INTO t2 VALUES (439,126702,36,'verify','Buchanan','precession','');
-INSERT INTO t2 VALUES (440,128001,36,'scatter','forgivably','nullified','');
-INSERT INTO t2 VALUES (441,128002,36,'Aztecan','innuendo','affects','');
-INSERT INTO t2 VALUES (442,128003,36,'acuity','den','Cynthia','');
-INSERT INTO t2 VALUES (443,128004,36,'sinking','submarines','Chablis','A');
-INSERT INTO t2 VALUES (444,128005,36,'beasts','mouthful','betterments','FAS');
-INSERT INTO t2 VALUES (445,128007,36,'Witt','expiring','advertising','');
-INSERT INTO t2 VALUES (446,128008,36,'physicists','unfulfilled','rubies','A');
-INSERT INTO t2 VALUES (447,128009,36,'folksong','precession','southwest','FAS');
-INSERT INTO t2 VALUES (448,128010,36,'strokes','nullified','superstitious','A');
-INSERT INTO t2 VALUES (449,128011,36,'crowder','affects','tabernacle','W');
-INSERT INTO t2 VALUES (450,128012,36,'merry','Cynthia','silk','A');
-INSERT INTO t2 VALUES (451,128013,36,'cadenced','Chablis','handsomest','A');
-INSERT INTO t2 VALUES (452,128014,36,'alimony','betterments','Persian','A');
-INSERT INTO t2 VALUES (453,128015,36,'principled','advertising','analog','W');
-INSERT INTO t2 VALUES (454,128016,36,'golfing','rubies','complex','W');
-INSERT INTO t2 VALUES (455,128017,36,'undiscovered','southwest','Taoist','');
-INSERT INTO t2 VALUES (456,128018,36,'irritates','superstitious','suspend','');
-INSERT INTO t2 VALUES (457,128019,36,'patriots','tabernacle','relegated','');
-INSERT INTO t2 VALUES (458,128020,36,'rooms','silk','awesome','W');
-INSERT INTO t2 VALUES (459,128021,36,'towering','handsomest','Bruxelles','');
-INSERT INTO t2 VALUES (460,128022,36,'displease','Persian','imprecisely','A');
-INSERT INTO t2 VALUES (461,128023,36,'photosensitive','analog','televise','');
-INSERT INTO t2 VALUES (462,128101,36,'inking','complex','braking','');
-INSERT INTO t2 VALUES (463,128102,36,'gainers','Taoist','true','FAS');
-INSERT INTO t2 VALUES (464,128103,36,'leaning','suspend','disappointing','FAS');
-INSERT INTO t2 VALUES (465,128104,36,'hydrant','relegated','navally','W');
-INSERT INTO t2 VALUES (466,128106,36,'preserve','awesome','circus','');
-INSERT INTO t2 VALUES (467,128107,36,'blinded','Bruxelles','beetles','');
-INSERT INTO t2 VALUES (468,128108,36,'interactions','imprecisely','trumps','');
-INSERT INTO t2 VALUES (469,128202,36,'Barry','televise','fourscore','W');
-INSERT INTO t2 VALUES (470,128203,36,'whiteness','braking','Blackfoots','');
-INSERT INTO t2 VALUES (471,128301,36,'pastimes','true','Grady','');
-INSERT INTO t2 VALUES (472,128302,36,'Edenization','disappointing','quiets','FAS');
-INSERT INTO t2 VALUES (473,128303,36,'Muscat','navally','floundered','FAS');
-INSERT INTO t2 VALUES (474,128304,36,'assassinated','circus','profundity','W');
-INSERT INTO t2 VALUES (475,128305,36,'labeled','beetles','Garrisonian','W');
-INSERT INTO t2 VALUES (476,128307,36,'glacial','trumps','Strauss','');
-INSERT INTO t2 VALUES (477,128401,36,'implied','fourscore','cemented','FAS');
-INSERT INTO t2 VALUES (478,128502,36,'bibliographies','Blackfoots','contrition','A');
-INSERT INTO t2 VALUES (479,128503,36,'Buchanan','Grady','mutations','');
-INSERT INTO t2 VALUES (480,128504,36,'forgivably','quiets','exhibits','W');
-INSERT INTO t2 VALUES (481,128505,36,'innuendo','floundered','tits','');
-INSERT INTO t2 VALUES (482,128601,36,'den','profundity','mate','A');
-INSERT INTO t2 VALUES (483,128603,36,'submarines','Garrisonian','arches','');
-INSERT INTO t2 VALUES (484,128604,36,'mouthful','Strauss','Moll','');
-INSERT INTO t2 VALUES (485,128702,36,'expiring','cemented','ropers','');
-INSERT INTO t2 VALUES (486,128703,36,'unfulfilled','contrition','bombast','');
-INSERT INTO t2 VALUES (487,128704,36,'precession','mutations','difficultly','A');
-INSERT INTO t2 VALUES (488,138001,36,'nullified','exhibits','adsorption','');
-INSERT INTO t2 VALUES (489,138002,36,'affects','tits','definiteness','FAS');
-INSERT INTO t2 VALUES (490,138003,36,'Cynthia','mate','cultivation','A');
-INSERT INTO t2 VALUES (491,138004,36,'Chablis','arches','heals','A');
-INSERT INTO t2 VALUES (492,138005,36,'betterments','Moll','Heusen','W');
-INSERT INTO t2 VALUES (493,138006,36,'advertising','ropers','target','FAS');
-INSERT INTO t2 VALUES (494,138007,36,'rubies','bombast','cited','A');
-INSERT INTO t2 VALUES (495,138008,36,'southwest','difficultly','congresswoman','W');
-INSERT INTO t2 VALUES (496,138009,36,'superstitious','adsorption','Katherine','');
-INSERT INTO t2 VALUES (497,138102,36,'tabernacle','definiteness','titter','A');
-INSERT INTO t2 VALUES (498,138103,36,'silk','cultivation','aspire','A');
-INSERT INTO t2 VALUES (499,138104,36,'handsomest','heals','Mardis','');
-INSERT INTO t2 VALUES (500,138105,36,'Persian','Heusen','Nadia','W');
-INSERT INTO t2 VALUES (501,138201,36,'analog','target','estimating','FAS');
-INSERT INTO t2 VALUES (502,138302,36,'complex','cited','stuck','A');
-INSERT INTO t2 VALUES (503,138303,36,'Taoist','congresswoman','fifteenth','A');
-INSERT INTO t2 VALUES (504,138304,36,'suspend','Katherine','Colombo','');
-INSERT INTO t2 VALUES (505,138401,29,'relegated','titter','survey','A');
-INSERT INTO t2 VALUES (506,140102,29,'awesome','aspire','staffing','');
-INSERT INTO t2 VALUES (507,140103,29,'Bruxelles','Mardis','obtain','');
-INSERT INTO t2 VALUES (508,140104,29,'imprecisely','Nadia','loaded','');
-INSERT INTO t2 VALUES (509,140105,29,'televise','estimating','slaughtered','');
-INSERT INTO t2 VALUES (510,140201,29,'braking','stuck','lights','A');
-INSERT INTO t2 VALUES (511,140701,29,'true','fifteenth','circumference','');
-INSERT INTO t2 VALUES (512,141501,29,'disappointing','Colombo','dull','A');
-INSERT INTO t2 VALUES (513,141502,29,'navally','survey','weekly','A');
-INSERT INTO t2 VALUES (514,141901,29,'circus','staffing','wetness','');
-INSERT INTO t2 VALUES (515,141902,29,'beetles','obtain','visualized','');
-INSERT INTO t2 VALUES (516,142101,29,'trumps','loaded','Tannenbaum','');
-INSERT INTO t2 VALUES (517,142102,29,'fourscore','slaughtered','moribund','');
-INSERT INTO t2 VALUES (518,142103,29,'Blackfoots','lights','demultiplex','');
-INSERT INTO t2 VALUES (519,142701,29,'Grady','circumference','lockings','');
-INSERT INTO t2 VALUES (520,143001,29,'quiets','dull','thugs','FAS');
-INSERT INTO t2 VALUES (521,143501,29,'floundered','weekly','unnerves','');
-INSERT INTO t2 VALUES (522,143502,29,'profundity','wetness','abut','');
-INSERT INTO t2 VALUES (523,148001,29,'Garrisonian','visualized','Chippewa','A');
-INSERT INTO t2 VALUES (524,148002,29,'Strauss','Tannenbaum','stratifications','A');
-INSERT INTO t2 VALUES (525,148003,29,'cemented','moribund','signaled','');
-INSERT INTO t2 VALUES (526,148004,29,'contrition','demultiplex','Italianizes','A');
-INSERT INTO t2 VALUES (527,148005,29,'mutations','lockings','algorithmic','A');
-INSERT INTO t2 VALUES (528,148006,29,'exhibits','thugs','paranoid','FAS');
-INSERT INTO t2 VALUES (529,148007,29,'tits','unnerves','camping','A');
-INSERT INTO t2 VALUES (530,148009,29,'mate','abut','signifying','A');
-INSERT INTO t2 VALUES (531,148010,29,'arches','Chippewa','Patrice','W');
-INSERT INTO t2 VALUES (532,148011,29,'Moll','stratifications','search','A');
-INSERT INTO t2 VALUES (533,148012,29,'ropers','signaled','Angeles','A');
-INSERT INTO t2 VALUES (534,148013,29,'bombast','Italianizes','semblance','');
-INSERT INTO t2 VALUES (535,148023,36,'difficultly','algorithmic','taxed','');
-INSERT INTO t2 VALUES (536,148015,29,'adsorption','paranoid','Beatrice','');
-INSERT INTO t2 VALUES (537,148016,29,'definiteness','camping','retrace','');
-INSERT INTO t2 VALUES (538,148017,29,'cultivation','signifying','lockout','');
-INSERT INTO t2 VALUES (539,148018,29,'heals','Patrice','grammatic','');
-INSERT INTO t2 VALUES (540,148019,29,'Heusen','search','helmsman','');
-INSERT INTO t2 VALUES (541,148020,29,'target','Angeles','uniform','W');
-INSERT INTO t2 VALUES (542,148021,29,'cited','semblance','hamming','');
-INSERT INTO t2 VALUES (543,148022,29,'congresswoman','taxed','disobedience','');
-INSERT INTO t2 VALUES (544,148101,29,'Katherine','Beatrice','captivated','A');
-INSERT INTO t2 VALUES (545,148102,29,'titter','retrace','transferals','A');
-INSERT INTO t2 VALUES (546,148201,29,'aspire','lockout','cartographer','A');
-INSERT INTO t2 VALUES (547,148401,29,'Mardis','grammatic','aims','FAS');
-INSERT INTO t2 VALUES (548,148402,29,'Nadia','helmsman','Pakistani','');
-INSERT INTO t2 VALUES (549,148501,29,'estimating','uniform','burglarized','FAS');
-INSERT INTO t2 VALUES (550,148502,29,'stuck','hamming','saucepans','A');
-INSERT INTO t2 VALUES (551,148503,29,'fifteenth','disobedience','lacerating','A');
-INSERT INTO t2 VALUES (552,148504,29,'Colombo','captivated','corny','');
-INSERT INTO t2 VALUES (553,148601,29,'survey','transferals','megabytes','FAS');
-INSERT INTO t2 VALUES (554,148602,29,'staffing','cartographer','chancellor','');
-INSERT INTO t2 VALUES (555,150701,29,'obtain','aims','bulk','A');
-INSERT INTO t2 VALUES (556,152101,29,'loaded','Pakistani','commits','A');
-INSERT INTO t2 VALUES (557,152102,29,'slaughtered','burglarized','meson','W');
-INSERT INTO t2 VALUES (558,155202,36,'lights','saucepans','deputies','');
-INSERT INTO t2 VALUES (559,155203,29,'circumference','lacerating','northeaster','A');
-INSERT INTO t2 VALUES (560,155204,29,'dull','corny','dipole','');
-INSERT INTO t2 VALUES (561,155205,29,'weekly','megabytes','machining','0');
-INSERT INTO t2 VALUES (562,156001,29,'wetness','chancellor','therefore','');
-INSERT INTO t2 VALUES (563,156002,29,'visualized','bulk','Telefunken','');
-INSERT INTO t2 VALUES (564,156102,29,'Tannenbaum','commits','salvaging','');
-INSERT INTO t2 VALUES (565,156301,29,'moribund','meson','Corinthianizes','A');
-INSERT INTO t2 VALUES (566,156302,29,'demultiplex','deputies','restlessly','A');
-INSERT INTO t2 VALUES (567,156303,29,'lockings','northeaster','bromides','');
-INSERT INTO t2 VALUES (568,156304,29,'thugs','dipole','generalized','A');
-INSERT INTO t2 VALUES (569,156305,29,'unnerves','machining','mishaps','');
-INSERT INTO t2 VALUES (570,156306,29,'abut','therefore','quelling','');
-INSERT INTO t2 VALUES (571,156501,29,'Chippewa','Telefunken','spiritual','A');
-INSERT INTO t2 VALUES (572,158001,29,'stratifications','salvaging','beguiles','FAS');
-INSERT INTO t2 VALUES (573,158002,29,'signaled','Corinthianizes','Trobriand','FAS');
-INSERT INTO t2 VALUES (574,158101,29,'Italianizes','restlessly','fleeing','A');
-INSERT INTO t2 VALUES (575,158102,29,'algorithmic','bromides','Armour','A');
-INSERT INTO t2 VALUES (576,158103,29,'paranoid','generalized','chin','A');
-INSERT INTO t2 VALUES (577,158201,29,'camping','mishaps','provers','A');
-INSERT INTO t2 VALUES (578,158202,29,'signifying','quelling','aeronautic','A');
-INSERT INTO t2 VALUES (579,158203,29,'Patrice','spiritual','voltage','W');
-INSERT INTO t2 VALUES (580,158204,29,'search','beguiles','sash','');
-INSERT INTO t2 VALUES (581,158301,29,'Angeles','Trobriand','anaerobic','A');
-INSERT INTO t2 VALUES (582,158302,29,'semblance','fleeing','simultaneous','A');
-INSERT INTO t2 VALUES (583,158303,29,'taxed','Armour','accumulating','A');
-INSERT INTO t2 VALUES (584,158304,29,'Beatrice','chin','Medusan','A');
-INSERT INTO t2 VALUES (585,158305,29,'retrace','provers','shouted','A');
-INSERT INTO t2 VALUES (586,158306,29,'lockout','aeronautic','freakish','');
-INSERT INTO t2 VALUES (587,158501,29,'grammatic','voltage','index','FAS');
-INSERT INTO t2 VALUES (588,160301,29,'helmsman','sash','commercially','');
-INSERT INTO t2 VALUES (589,166101,50,'uniform','anaerobic','mistiness','A');
-INSERT INTO t2 VALUES (590,166102,50,'hamming','simultaneous','endpoint','');
-INSERT INTO t2 VALUES (591,168001,29,'disobedience','accumulating','straight','A');
-INSERT INTO t2 VALUES (592,168002,29,'captivated','Medusan','flurried','');
-INSERT INTO t2 VALUES (593,168003,29,'transferals','shouted','denotative','A');
-INSERT INTO t2 VALUES (594,168101,29,'cartographer','freakish','coming','FAS');
-INSERT INTO t2 VALUES (595,168102,29,'aims','index','commencements','FAS');
-INSERT INTO t2 VALUES (596,168103,29,'Pakistani','commercially','gentleman','');
-INSERT INTO t2 VALUES (597,168104,29,'burglarized','mistiness','gifted','');
-INSERT INTO t2 VALUES (598,168202,29,'saucepans','endpoint','Shanghais','');
-INSERT INTO t2 VALUES (599,168301,29,'lacerating','straight','sportswriting','A');
-INSERT INTO t2 VALUES (600,168502,29,'corny','flurried','sloping','A');
-INSERT INTO t2 VALUES (601,168503,29,'megabytes','denotative','navies','');
-INSERT INTO t2 VALUES (602,168601,29,'chancellor','coming','leaflet','A');
-INSERT INTO t2 VALUES (603,173001,40,'bulk','commencements','shooter','');
-INSERT INTO t2 VALUES (604,173701,40,'commits','gentleman','Joplin','FAS');
-INSERT INTO t2 VALUES (605,173702,40,'meson','gifted','babies','');
-INSERT INTO t2 VALUES (606,176001,40,'deputies','Shanghais','subdivision','FAS');
-INSERT INTO t2 VALUES (607,176101,40,'northeaster','sportswriting','burstiness','W');
-INSERT INTO t2 VALUES (608,176201,40,'dipole','sloping','belted','FAS');
-INSERT INTO t2 VALUES (609,176401,40,'machining','navies','assails','FAS');
-INSERT INTO t2 VALUES (610,176501,40,'therefore','leaflet','admiring','W');
-INSERT INTO t2 VALUES (611,176601,40,'Telefunken','shooter','swaying','0');
-INSERT INTO t2 VALUES (612,176602,40,'salvaging','Joplin','Goldstine','FAS');
-INSERT INTO t2 VALUES (613,176603,40,'Corinthianizes','babies','fitting','');
-INSERT INTO t2 VALUES (614,178001,40,'restlessly','subdivision','Norwalk','W');
-INSERT INTO t2 VALUES (615,178002,40,'bromides','burstiness','weakening','W');
-INSERT INTO t2 VALUES (616,178003,40,'generalized','belted','analogy','FAS');
-INSERT INTO t2 VALUES (617,178004,40,'mishaps','assails','deludes','');
-INSERT INTO t2 VALUES (618,178005,40,'quelling','admiring','cokes','');
-INSERT INTO t2 VALUES (619,178006,40,'spiritual','swaying','Clayton','');
-INSERT INTO t2 VALUES (620,178007,40,'beguiles','Goldstine','exhausts','');
-INSERT INTO t2 VALUES (621,178008,40,'Trobriand','fitting','causality','');
-INSERT INTO t2 VALUES (622,178101,40,'fleeing','Norwalk','sating','FAS');
-INSERT INTO t2 VALUES (623,178102,40,'Armour','weakening','icon','');
-INSERT INTO t2 VALUES (624,178103,40,'chin','analogy','throttles','');
-INSERT INTO t2 VALUES (625,178201,40,'provers','deludes','communicants','FAS');
-INSERT INTO t2 VALUES (626,178202,40,'aeronautic','cokes','dehydrate','FAS');
-INSERT INTO t2 VALUES (627,178301,40,'voltage','Clayton','priceless','FAS');
-INSERT INTO t2 VALUES (628,178302,40,'sash','exhausts','publicly','');
-INSERT INTO t2 VALUES (629,178401,40,'anaerobic','causality','incidentals','FAS');
-INSERT INTO t2 VALUES (630,178402,40,'simultaneous','sating','commonplace','');
-INSERT INTO t2 VALUES (631,178403,40,'accumulating','icon','mumbles','');
-INSERT INTO t2 VALUES (632,178404,40,'Medusan','throttles','furthermore','W');
-INSERT INTO t2 VALUES (633,178501,40,'shouted','communicants','cautioned','W');
-INSERT INTO t2 VALUES (634,186002,37,'freakish','dehydrate','parametrized','A');
-INSERT INTO t2 VALUES (635,186102,37,'index','priceless','registration','A');
-INSERT INTO t2 VALUES (636,186201,40,'commercially','publicly','sadly','FAS');
-INSERT INTO t2 VALUES (637,186202,40,'mistiness','incidentals','positioning','');
-INSERT INTO t2 VALUES (638,186203,40,'endpoint','commonplace','babysitting','');
-INSERT INTO t2 VALUES (639,186302,37,'straight','mumbles','eternal','A');
-INSERT INTO t2 VALUES (640,188007,37,'flurried','furthermore','hoarder','');
-INSERT INTO t2 VALUES (641,188008,37,'denotative','cautioned','congregates','');
-INSERT INTO t2 VALUES (642,188009,37,'coming','parametrized','rains','');
-INSERT INTO t2 VALUES (643,188010,37,'commencements','registration','workers','W');
-INSERT INTO t2 VALUES (644,188011,37,'gentleman','sadly','sags','A');
-INSERT INTO t2 VALUES (645,188012,37,'gifted','positioning','unplug','W');
-INSERT INTO t2 VALUES (646,188013,37,'Shanghais','babysitting','garage','A');
-INSERT INTO t2 VALUES (647,188014,37,'sportswriting','eternal','boulder','A');
-INSERT INTO t2 VALUES (648,188015,37,'sloping','hoarder','hollowly','A');
-INSERT INTO t2 VALUES (649,188016,37,'navies','congregates','specifics','');
-INSERT INTO t2 VALUES (650,188017,37,'leaflet','rains','Teresa','');
-INSERT INTO t2 VALUES (651,188102,37,'shooter','workers','Winsett','');
-INSERT INTO t2 VALUES (652,188103,37,'Joplin','sags','convenient','A');
-INSERT INTO t2 VALUES (653,188202,37,'babies','unplug','buckboards','FAS');
-INSERT INTO t2 VALUES (654,188301,40,'subdivision','garage','amenities','');
-INSERT INTO t2 VALUES (655,188302,40,'burstiness','boulder','resplendent','FAS');
-INSERT INTO t2 VALUES (656,188303,40,'belted','hollowly','priding','FAS');
-INSERT INTO t2 VALUES (657,188401,37,'assails','specifics','configurations','');
-INSERT INTO t2 VALUES (658,188402,37,'admiring','Teresa','untidiness','A');
-INSERT INTO t2 VALUES (659,188503,37,'swaying','Winsett','Brice','W');
-INSERT INTO t2 VALUES (660,188504,37,'Goldstine','convenient','sews','FAS');
-INSERT INTO t2 VALUES (661,188505,37,'fitting','buckboards','participated','');
-INSERT INTO t2 VALUES (662,190701,37,'Norwalk','amenities','Simon','FAS');
-INSERT INTO t2 VALUES (663,190703,50,'weakening','resplendent','certificates','');
-INSERT INTO t2 VALUES (664,191701,37,'analogy','priding','Fitzpatrick','');
-INSERT INTO t2 VALUES (665,191702,37,'deludes','configurations','Evanston','A');
-INSERT INTO t2 VALUES (666,191703,37,'cokes','untidiness','misted','');
-INSERT INTO t2 VALUES (667,196001,37,'Clayton','Brice','textures','A');
-INSERT INTO t2 VALUES (668,196002,37,'exhausts','sews','save','');
-INSERT INTO t2 VALUES (669,196003,37,'causality','participated','count','');
-INSERT INTO t2 VALUES (670,196101,37,'sating','Simon','rightful','A');
-INSERT INTO t2 VALUES (671,196103,37,'icon','certificates','chaperone','');
-INSERT INTO t2 VALUES (672,196104,37,'throttles','Fitzpatrick','Lizzy','A');
-INSERT INTO t2 VALUES (673,196201,37,'communicants','Evanston','clenched','A');
-INSERT INTO t2 VALUES (674,196202,37,'dehydrate','misted','effortlessly','');
-INSERT INTO t2 VALUES (675,196203,37,'priceless','textures','accessed','');
-INSERT INTO t2 VALUES (676,198001,37,'publicly','save','beaters','A');
-INSERT INTO t2 VALUES (677,198003,37,'incidentals','count','Hornblower','FAS');
-INSERT INTO t2 VALUES (678,198004,37,'commonplace','rightful','vests','A');
-INSERT INTO t2 VALUES (679,198005,37,'mumbles','chaperone','indulgences','FAS');
-INSERT INTO t2 VALUES (680,198006,37,'furthermore','Lizzy','infallibly','A');
-INSERT INTO t2 VALUES (681,198007,37,'cautioned','clenched','unwilling','FAS');
-INSERT INTO t2 VALUES (682,198008,37,'parametrized','effortlessly','excrete','FAS');
-INSERT INTO t2 VALUES (683,198009,37,'registration','accessed','spools','A');
-INSERT INTO t2 VALUES (684,198010,37,'sadly','beaters','crunches','FAS');
-INSERT INTO t2 VALUES (685,198011,37,'positioning','Hornblower','overestimating','FAS');
-INSERT INTO t2 VALUES (686,198012,37,'babysitting','vests','ineffective','');
-INSERT INTO t2 VALUES (687,198013,37,'eternal','indulgences','humiliation','A');
-INSERT INTO t2 VALUES (688,198014,37,'hoarder','infallibly','sophomore','');
-INSERT INTO t2 VALUES (689,198015,37,'congregates','unwilling','star','');
-INSERT INTO t2 VALUES (690,198017,37,'rains','excrete','rifles','');
-INSERT INTO t2 VALUES (691,198018,37,'workers','spools','dialysis','');
-INSERT INTO t2 VALUES (692,198019,37,'sags','crunches','arriving','');
-INSERT INTO t2 VALUES (693,198020,37,'unplug','overestimating','indulge','');
-INSERT INTO t2 VALUES (694,198021,37,'garage','ineffective','clockers','');
-INSERT INTO t2 VALUES (695,198022,37,'boulder','humiliation','languages','');
-INSERT INTO t2 VALUES (696,198023,50,'hollowly','sophomore','Antarctica','A');
-INSERT INTO t2 VALUES (697,198024,37,'specifics','star','percentage','');
-INSERT INTO t2 VALUES (698,198101,37,'Teresa','rifles','ceiling','A');
-INSERT INTO t2 VALUES (699,198103,37,'Winsett','dialysis','specification','');
-INSERT INTO t2 VALUES (700,198105,37,'convenient','arriving','regimented','A');
-INSERT INTO t2 VALUES (701,198106,37,'buckboards','indulge','ciphers','');
-INSERT INTO t2 VALUES (702,198201,37,'amenities','clockers','pictures','A');
-INSERT INTO t2 VALUES (703,198204,37,'resplendent','languages','serpents','A');
-INSERT INTO t2 VALUES (704,198301,53,'priding','Antarctica','allot','A');
-INSERT INTO t2 VALUES (705,198302,53,'configurations','percentage','realized','A');
-INSERT INTO t2 VALUES (706,198303,53,'untidiness','ceiling','mayoral','A');
-INSERT INTO t2 VALUES (707,198304,53,'Brice','specification','opaquely','A');
-INSERT INTO t2 VALUES (708,198401,37,'sews','regimented','hostess','FAS');
-INSERT INTO t2 VALUES (709,198402,37,'participated','ciphers','fiftieth','');
-INSERT INTO t2 VALUES (710,198403,37,'Simon','pictures','incorrectly','');
-INSERT INTO t2 VALUES (711,202101,37,'certificates','serpents','decomposition','FAS');
-INSERT INTO t2 VALUES (712,202301,37,'Fitzpatrick','allot','stranglings','');
-INSERT INTO t2 VALUES (713,202302,37,'Evanston','realized','mixture','FAS');
-INSERT INTO t2 VALUES (714,202303,37,'misted','mayoral','electroencephalography','FAS');
-INSERT INTO t2 VALUES (715,202304,37,'textures','opaquely','similarities','FAS');
-INSERT INTO t2 VALUES (716,202305,37,'save','hostess','charges','W');
-INSERT INTO t2 VALUES (717,202601,37,'count','fiftieth','freest','FAS');
-INSERT INTO t2 VALUES (718,202602,37,'rightful','incorrectly','Greenberg','FAS');
-INSERT INTO t2 VALUES (719,202605,37,'chaperone','decomposition','tinting','');
-INSERT INTO t2 VALUES (720,202606,37,'Lizzy','stranglings','expelled','W');
-INSERT INTO t2 VALUES (721,202607,37,'clenched','mixture','warm','');
-INSERT INTO t2 VALUES (722,202901,37,'effortlessly','electroencephalography','smoothed','');
-INSERT INTO t2 VALUES (723,202902,37,'accessed','similarities','deductions','FAS');
-INSERT INTO t2 VALUES (724,202903,37,'beaters','charges','Romano','W');
-INSERT INTO t2 VALUES (725,202904,37,'Hornblower','freest','bitterroot','');
-INSERT INTO t2 VALUES (726,202907,37,'vests','Greenberg','corset','');
-INSERT INTO t2 VALUES (727,202908,37,'indulgences','tinting','securing','');
-INSERT INTO t2 VALUES (728,203101,37,'infallibly','expelled','environing','FAS');
-INSERT INTO t2 VALUES (729,203103,37,'unwilling','warm','cute','');
-INSERT INTO t2 VALUES (730,203104,37,'excrete','smoothed','Crays','');
-INSERT INTO t2 VALUES (731,203105,37,'spools','deductions','heiress','FAS');
-INSERT INTO t2 VALUES (732,203401,37,'crunches','Romano','inform','FAS');
-INSERT INTO t2 VALUES (733,203402,37,'overestimating','bitterroot','avenge','');
-INSERT INTO t2 VALUES (734,203404,37,'ineffective','corset','universals','');
-INSERT INTO t2 VALUES (735,203901,37,'humiliation','securing','Kinsey','W');
-INSERT INTO t2 VALUES (736,203902,37,'sophomore','environing','ravines','FAS');
-INSERT INTO t2 VALUES (737,203903,37,'star','cute','bestseller','');
-INSERT INTO t2 VALUES (738,203906,37,'rifles','Crays','equilibrium','');
-INSERT INTO t2 VALUES (739,203907,37,'dialysis','heiress','extents','0');
-INSERT INTO t2 VALUES (740,203908,37,'arriving','inform','relatively','');
-INSERT INTO t2 VALUES (741,203909,37,'indulge','avenge','pressure','FAS');
-INSERT INTO t2 VALUES (742,206101,37,'clockers','universals','critiques','FAS');
-INSERT INTO t2 VALUES (743,206201,37,'languages','Kinsey','befouled','');
-INSERT INTO t2 VALUES (744,206202,37,'Antarctica','ravines','rightfully','FAS');
-INSERT INTO t2 VALUES (745,206203,37,'percentage','bestseller','mechanizing','FAS');
-INSERT INTO t2 VALUES (746,206206,37,'ceiling','equilibrium','Latinizes','');
-INSERT INTO t2 VALUES (747,206207,37,'specification','extents','timesharing','');
-INSERT INTO t2 VALUES (748,206208,37,'regimented','relatively','Aden','');
-INSERT INTO t2 VALUES (749,208001,37,'ciphers','pressure','embassies','');
-INSERT INTO t2 VALUES (750,208002,37,'pictures','critiques','males','FAS');
-INSERT INTO t2 VALUES (751,208003,37,'serpents','befouled','shapelessly','FAS');
-INSERT INTO t2 VALUES (752,208004,37,'allot','rightfully','genres','FAS');
-INSERT INTO t2 VALUES (753,208008,37,'realized','mechanizing','mastering','');
-INSERT INTO t2 VALUES (754,208009,37,'mayoral','Latinizes','Newtonian','');
-INSERT INTO t2 VALUES (755,208010,37,'opaquely','timesharing','finishers','FAS');
-INSERT INTO t2 VALUES (756,208011,37,'hostess','Aden','abates','');
-INSERT INTO t2 VALUES (757,208101,37,'fiftieth','embassies','teem','');
-INSERT INTO t2 VALUES (758,208102,37,'incorrectly','males','kiting','FAS');
-INSERT INTO t2 VALUES (759,208103,37,'decomposition','shapelessly','stodgy','FAS');
-INSERT INTO t2 VALUES (760,208104,37,'stranglings','genres','scalps','FAS');
-INSERT INTO t2 VALUES (761,208105,37,'mixture','mastering','feed','FAS');
-INSERT INTO t2 VALUES (762,208110,37,'electroencephalography','Newtonian','guitars','');
-INSERT INTO t2 VALUES (763,208111,37,'similarities','finishers','airships','');
-INSERT INTO t2 VALUES (764,208112,37,'charges','abates','store','');
-INSERT INTO t2 VALUES (765,208113,37,'freest','teem','denounces','');
-INSERT INTO t2 VALUES (766,208201,37,'Greenberg','kiting','Pyle','FAS');
-INSERT INTO t2 VALUES (767,208203,37,'tinting','stodgy','Saxony','');
-INSERT INTO t2 VALUES (768,208301,37,'expelled','scalps','serializations','FAS');
-INSERT INTO t2 VALUES (769,208302,37,'warm','feed','Peruvian','FAS');
-INSERT INTO t2 VALUES (770,208305,37,'smoothed','guitars','taxonomically','FAS');
-INSERT INTO t2 VALUES (771,208401,37,'deductions','airships','kingdom','A');
-INSERT INTO t2 VALUES (772,208402,37,'Romano','store','stint','A');
-INSERT INTO t2 VALUES (773,208403,37,'bitterroot','denounces','Sault','A');
-INSERT INTO t2 VALUES (774,208404,37,'corset','Pyle','faithful','');
-INSERT INTO t2 VALUES (775,208501,37,'securing','Saxony','Ganymede','FAS');
-INSERT INTO t2 VALUES (776,208502,37,'environing','serializations','tidiness','FAS');
-INSERT INTO t2 VALUES (777,208503,37,'cute','Peruvian','gainful','FAS');
-INSERT INTO t2 VALUES (778,208504,37,'Crays','taxonomically','contrary','FAS');
-INSERT INTO t2 VALUES (779,208505,37,'heiress','kingdom','Tipperary','FAS');
-INSERT INTO t2 VALUES (780,210101,37,'inform','stint','tropics','W');
-INSERT INTO t2 VALUES (781,210102,37,'avenge','Sault','theorizers','');
-INSERT INTO t2 VALUES (782,210103,37,'universals','faithful','renew','0');
-INSERT INTO t2 VALUES (783,210104,37,'Kinsey','Ganymede','already','');
-INSERT INTO t2 VALUES (784,210105,37,'ravines','tidiness','terminal','');
-INSERT INTO t2 VALUES (785,210106,37,'bestseller','gainful','Hegelian','');
-INSERT INTO t2 VALUES (786,210107,37,'equilibrium','contrary','hypothesizer','');
-INSERT INTO t2 VALUES (787,210401,37,'extents','Tipperary','warningly','FAS');
-INSERT INTO t2 VALUES (788,213201,37,'relatively','tropics','journalizing','FAS');
-INSERT INTO t2 VALUES (789,213203,37,'pressure','theorizers','nested','');
-INSERT INTO t2 VALUES (790,213204,37,'critiques','renew','Lars','');
-INSERT INTO t2 VALUES (791,213205,37,'befouled','already','saplings','');
-INSERT INTO t2 VALUES (792,213206,37,'rightfully','terminal','foothill','');
-INSERT INTO t2 VALUES (793,213207,37,'mechanizing','Hegelian','labeled','');
-INSERT INTO t2 VALUES (794,216101,37,'Latinizes','hypothesizer','imperiously','FAS');
-INSERT INTO t2 VALUES (795,216103,37,'timesharing','warningly','reporters','FAS');
-INSERT INTO t2 VALUES (796,218001,37,'Aden','journalizing','furnishings','FAS');
-INSERT INTO t2 VALUES (797,218002,37,'embassies','nested','precipitable','FAS');
-INSERT INTO t2 VALUES (798,218003,37,'males','Lars','discounts','FAS');
-INSERT INTO t2 VALUES (799,218004,37,'shapelessly','saplings','excises','FAS');
-INSERT INTO t2 VALUES (800,143503,50,'genres','foothill','Stalin','');
-INSERT INTO t2 VALUES (801,218006,37,'mastering','labeled','despot','FAS');
-INSERT INTO t2 VALUES (802,218007,37,'Newtonian','imperiously','ripeness','FAS');
-INSERT INTO t2 VALUES (803,218008,37,'finishers','reporters','Arabia','');
-INSERT INTO t2 VALUES (804,218009,37,'abates','furnishings','unruly','');
-INSERT INTO t2 VALUES (805,218010,37,'teem','precipitable','mournfulness','');
-INSERT INTO t2 VALUES (806,218011,37,'kiting','discounts','boom','FAS');
-INSERT INTO t2 VALUES (807,218020,37,'stodgy','excises','slaughter','A');
-INSERT INTO t2 VALUES (808,218021,50,'scalps','Stalin','Sabine','');
-INSERT INTO t2 VALUES (809,218022,37,'feed','despot','handy','FAS');
-INSERT INTO t2 VALUES (810,218023,37,'guitars','ripeness','rural','');
-INSERT INTO t2 VALUES (811,218024,37,'airships','Arabia','organizer','');
-INSERT INTO t2 VALUES (812,218101,37,'store','unruly','shipyard','FAS');
-INSERT INTO t2 VALUES (813,218102,37,'denounces','mournfulness','civics','FAS');
-INSERT INTO t2 VALUES (814,218103,37,'Pyle','boom','inaccuracy','FAS');
-INSERT INTO t2 VALUES (815,218201,37,'Saxony','slaughter','rules','FAS');
-INSERT INTO t2 VALUES (816,218202,37,'serializations','Sabine','juveniles','FAS');
-INSERT INTO t2 VALUES (817,218203,37,'Peruvian','handy','comprised','W');
-INSERT INTO t2 VALUES (818,218204,37,'taxonomically','rural','investigations','');
-INSERT INTO t2 VALUES (819,218205,37,'kingdom','organizer','stabilizes','A');
-INSERT INTO t2 VALUES (820,218301,37,'stint','shipyard','seminaries','FAS');
-INSERT INTO t2 VALUES (821,218302,37,'Sault','civics','Hunter','A');
-INSERT INTO t2 VALUES (822,218401,37,'faithful','inaccuracy','sporty','FAS');
-INSERT INTO t2 VALUES (823,218402,37,'Ganymede','rules','test','FAS');
-INSERT INTO t2 VALUES (824,218403,37,'tidiness','juveniles','weasels','');
-INSERT INTO t2 VALUES (825,218404,37,'gainful','comprised','CERN','');
-INSERT INTO t2 VALUES (826,218407,37,'contrary','investigations','tempering','');
-INSERT INTO t2 VALUES (827,218408,37,'Tipperary','stabilizes','afore','FAS');
-INSERT INTO t2 VALUES (828,218409,37,'tropics','seminaries','Galatean','');
-INSERT INTO t2 VALUES (829,218410,37,'theorizers','Hunter','techniques','W');
-INSERT INTO t2 VALUES (830,226001,37,'renew','sporty','error','');
-INSERT INTO t2 VALUES (831,226002,37,'already','test','veranda','');
-INSERT INTO t2 VALUES (832,226003,37,'terminal','weasels','severely','');
-INSERT INTO t2 VALUES (833,226004,37,'Hegelian','CERN','Cassites','FAS');
-INSERT INTO t2 VALUES (834,226005,37,'hypothesizer','tempering','forthcoming','');
-INSERT INTO t2 VALUES (835,226006,37,'warningly','afore','guides','');
-INSERT INTO t2 VALUES (836,226007,37,'journalizing','Galatean','vanish','FAS');
-INSERT INTO t2 VALUES (837,226008,37,'nested','techniques','lied','A');
-INSERT INTO t2 VALUES (838,226203,37,'Lars','error','sawtooth','FAS');
-INSERT INTO t2 VALUES (839,226204,37,'saplings','veranda','fated','FAS');
-INSERT INTO t2 VALUES (840,226205,37,'foothill','severely','gradually','');
-INSERT INTO t2 VALUES (841,226206,37,'labeled','Cassites','widens','');
-INSERT INTO t2 VALUES (842,226207,37,'imperiously','forthcoming','preclude','');
-INSERT INTO t2 VALUES (843,226208,37,'reporters','guides','Jobrel','');
-INSERT INTO t2 VALUES (844,226209,37,'furnishings','vanish','hooker','');
-INSERT INTO t2 VALUES (845,226210,37,'precipitable','lied','rainstorm','');
-INSERT INTO t2 VALUES (846,226211,37,'discounts','sawtooth','disconnects','');
-INSERT INTO t2 VALUES (847,228001,37,'excises','fated','cruelty','');
-INSERT INTO t2 VALUES (848,228004,37,'Stalin','gradually','exponentials','A');
-INSERT INTO t2 VALUES (849,228005,37,'despot','widens','affective','A');
-INSERT INTO t2 VALUES (850,228006,37,'ripeness','preclude','arteries','');
-INSERT INTO t2 VALUES (851,228007,37,'Arabia','Jobrel','Crosby','FAS');
-INSERT INTO t2 VALUES (852,228008,37,'unruly','hooker','acquaint','');
-INSERT INTO t2 VALUES (853,228009,37,'mournfulness','rainstorm','evenhandedly','');
-INSERT INTO t2 VALUES (854,228101,37,'boom','disconnects','percentage','');
-INSERT INTO t2 VALUES (855,228108,37,'slaughter','cruelty','disobedience','');
-INSERT INTO t2 VALUES (856,228109,37,'Sabine','exponentials','humility','');
-INSERT INTO t2 VALUES (857,228110,37,'handy','affective','gleaning','A');
-INSERT INTO t2 VALUES (858,228111,37,'rural','arteries','petted','A');
-INSERT INTO t2 VALUES (859,228112,37,'organizer','Crosby','bloater','A');
-INSERT INTO t2 VALUES (860,228113,37,'shipyard','acquaint','minion','A');
-INSERT INTO t2 VALUES (861,228114,37,'civics','evenhandedly','marginal','A');
-INSERT INTO t2 VALUES (862,228115,37,'inaccuracy','percentage','apiary','A');
-INSERT INTO t2 VALUES (863,228116,37,'rules','disobedience','measures','');
-INSERT INTO t2 VALUES (864,228117,37,'juveniles','humility','precaution','');
-INSERT INTO t2 VALUES (865,228118,37,'comprised','gleaning','repelled','');
-INSERT INTO t2 VALUES (866,228119,37,'investigations','petted','primary','FAS');
-INSERT INTO t2 VALUES (867,228120,37,'stabilizes','bloater','coverings','');
-INSERT INTO t2 VALUES (868,228121,37,'seminaries','minion','Artemia','A');
-INSERT INTO t2 VALUES (869,228122,37,'Hunter','marginal','navigate','');
-INSERT INTO t2 VALUES (870,228201,37,'sporty','apiary','spatial','');
-INSERT INTO t2 VALUES (871,228206,37,'test','measures','Gurkha','');
-INSERT INTO t2 VALUES (872,228207,37,'weasels','precaution','meanwhile','A');
-INSERT INTO t2 VALUES (873,228208,37,'CERN','repelled','Melinda','A');
-INSERT INTO t2 VALUES (874,228209,37,'tempering','primary','Butterfield','');
-INSERT INTO t2 VALUES (875,228210,37,'afore','coverings','Aldrich','A');
-INSERT INTO t2 VALUES (876,228211,37,'Galatean','Artemia','previewing','A');
-INSERT INTO t2 VALUES (877,228212,37,'techniques','navigate','glut','A');
-INSERT INTO t2 VALUES (878,228213,37,'error','spatial','unaffected','');
-INSERT INTO t2 VALUES (879,228214,37,'veranda','Gurkha','inmate','');
-INSERT INTO t2 VALUES (880,228301,37,'severely','meanwhile','mineral','');
-INSERT INTO t2 VALUES (881,228305,37,'Cassites','Melinda','impending','A');
-INSERT INTO t2 VALUES (882,228306,37,'forthcoming','Butterfield','meditation','A');
-INSERT INTO t2 VALUES (883,228307,37,'guides','Aldrich','ideas','');
-INSERT INTO t2 VALUES (884,228308,37,'vanish','previewing','miniaturizes','W');
-INSERT INTO t2 VALUES (885,228309,37,'lied','glut','lewdly','');
-INSERT INTO t2 VALUES (886,228310,37,'sawtooth','unaffected','title','');
-INSERT INTO t2 VALUES (887,228311,37,'fated','inmate','youthfulness','');
-INSERT INTO t2 VALUES (888,228312,37,'gradually','mineral','creak','FAS');
-INSERT INTO t2 VALUES (889,228313,37,'widens','impending','Chippewa','');
-INSERT INTO t2 VALUES (890,228314,37,'preclude','meditation','clamored','');
-INSERT INTO t2 VALUES (891,228401,65,'Jobrel','ideas','freezes','');
-INSERT INTO t2 VALUES (892,228402,65,'hooker','miniaturizes','forgivably','FAS');
-INSERT INTO t2 VALUES (893,228403,65,'rainstorm','lewdly','reduce','FAS');
-INSERT INTO t2 VALUES (894,228404,65,'disconnects','title','McGovern','W');
-INSERT INTO t2 VALUES (895,228405,65,'cruelty','youthfulness','Nazis','W');
-INSERT INTO t2 VALUES (896,228406,65,'exponentials','creak','epistle','W');
-INSERT INTO t2 VALUES (897,228407,65,'affective','Chippewa','socializes','W');
-INSERT INTO t2 VALUES (898,228408,65,'arteries','clamored','conceptions','');
-INSERT INTO t2 VALUES (899,228409,65,'Crosby','freezes','Kevin','');
-INSERT INTO t2 VALUES (900,228410,65,'acquaint','forgivably','uncovering','');
-INSERT INTO t2 VALUES (901,230301,37,'evenhandedly','reduce','chews','FAS');
-INSERT INTO t2 VALUES (902,230302,37,'percentage','McGovern','appendixes','FAS');
-INSERT INTO t2 VALUES (903,230303,37,'disobedience','Nazis','raining','');
-INSERT INTO t2 VALUES (904,018062,37,'humility','epistle','infest','');
-INSERT INTO t2 VALUES (905,230501,37,'gleaning','socializes','compartment','');
-INSERT INTO t2 VALUES (906,230502,37,'petted','conceptions','minting','');
-INSERT INTO t2 VALUES (907,230503,37,'bloater','Kevin','ducks','');
-INSERT INTO t2 VALUES (908,230504,37,'minion','uncovering','roped','A');
-INSERT INTO t2 VALUES (909,230505,37,'marginal','chews','waltz','');
-INSERT INTO t2 VALUES (910,230506,37,'apiary','appendixes','Lillian','');
-INSERT INTO t2 VALUES (911,230507,37,'measures','raining','repressions','A');
-INSERT INTO t2 VALUES (912,230508,37,'precaution','infest','chillingly','');
-INSERT INTO t2 VALUES (913,230509,37,'repelled','compartment','noncritical','');
-INSERT INTO t2 VALUES (914,230901,37,'primary','minting','lithograph','');
-INSERT INTO t2 VALUES (915,230902,37,'coverings','ducks','spongers','');
-INSERT INTO t2 VALUES (916,230903,37,'Artemia','roped','parenthood','');
-INSERT INTO t2 VALUES (917,230904,37,'navigate','waltz','posed','');
-INSERT INTO t2 VALUES (918,230905,37,'spatial','Lillian','instruments','');
-INSERT INTO t2 VALUES (919,230906,37,'Gurkha','repressions','filial','');
-INSERT INTO t2 VALUES (920,230907,37,'meanwhile','chillingly','fixedly','');
-INSERT INTO t2 VALUES (921,230908,37,'Melinda','noncritical','relives','');
-INSERT INTO t2 VALUES (922,230909,37,'Butterfield','lithograph','Pandora','');
-INSERT INTO t2 VALUES (923,230910,37,'Aldrich','spongers','watering','A');
-INSERT INTO t2 VALUES (924,230911,37,'previewing','parenthood','ungrateful','');
-INSERT INTO t2 VALUES (925,230912,37,'glut','posed','secures','');
-INSERT INTO t2 VALUES (926,230913,37,'unaffected','instruments','chastisers','');
-INSERT INTO t2 VALUES (927,230914,37,'inmate','filial','icon','');
-INSERT INTO t2 VALUES (928,231304,37,'mineral','fixedly','reuniting','A');
-INSERT INTO t2 VALUES (929,231305,37,'impending','relives','imagining','A');
-INSERT INTO t2 VALUES (930,231306,37,'meditation','Pandora','abiding','A');
-INSERT INTO t2 VALUES (931,231307,37,'ideas','watering','omnisciently','');
-INSERT INTO t2 VALUES (932,231308,37,'miniaturizes','ungrateful','Britannic','');
-INSERT INTO t2 VALUES (933,231309,37,'lewdly','secures','scholastics','A');
-INSERT INTO t2 VALUES (934,231310,37,'title','chastisers','mechanics','A');
-INSERT INTO t2 VALUES (935,231311,37,'youthfulness','icon','humidly','A');
-INSERT INTO t2 VALUES (936,231312,37,'creak','reuniting','masterpiece','');
-INSERT INTO t2 VALUES (937,231313,37,'Chippewa','imagining','however','');
-INSERT INTO t2 VALUES (938,231314,37,'clamored','abiding','Mendelian','');
-INSERT INTO t2 VALUES (939,231315,37,'freezes','omnisciently','jarred','');
-INSERT INTO t2 VALUES (940,232102,37,'forgivably','Britannic','scolds','');
-INSERT INTO t2 VALUES (941,232103,37,'reduce','scholastics','infatuate','');
-INSERT INTO t2 VALUES (942,232104,37,'McGovern','mechanics','willed','A');
-INSERT INTO t2 VALUES (943,232105,37,'Nazis','humidly','joyfully','');
-INSERT INTO t2 VALUES (944,232106,37,'epistle','masterpiece','Microsoft','');
-INSERT INTO t2 VALUES (945,232107,37,'socializes','however','fibrosities','');
-INSERT INTO t2 VALUES (946,232108,37,'conceptions','Mendelian','Baltimorean','');
-INSERT INTO t2 VALUES (947,232601,37,'Kevin','jarred','equestrian','');
-INSERT INTO t2 VALUES (948,232602,37,'uncovering','scolds','Goodrich','');
-INSERT INTO t2 VALUES (949,232603,37,'chews','infatuate','apish','A');
-INSERT INTO t2 VALUES (950,232605,37,'appendixes','willed','Adlerian','');
-INSERT INTO t2 VALUES (5950,1232605,37,'appendixes','willed','Adlerian','');
-INSERT INTO t2 VALUES (5951,1232606,37,'appendixes','willed','Adlerian','');
-INSERT INTO t2 VALUES (5952,1232607,37,'appendixes','willed','Adlerian','');
-INSERT INTO t2 VALUES (5953,1232608,37,'appendixes','willed','Adlerian','');
-INSERT INTO t2 VALUES (5954,1232609,37,'appendixes','willed','Adlerian','');
-INSERT INTO t2 VALUES (951,232606,37,'raining','joyfully','Tropez','');
-INSERT INTO t2 VALUES (952,232607,37,'infest','Microsoft','nouns','');
-INSERT INTO t2 VALUES (953,232608,37,'compartment','fibrosities','distracting','');
-INSERT INTO t2 VALUES (954,232609,37,'minting','Baltimorean','mutton','');
-INSERT INTO t2 VALUES (955,236104,37,'ducks','equestrian','bridgeable','A');
-INSERT INTO t2 VALUES (956,236105,37,'roped','Goodrich','stickers','A');
-INSERT INTO t2 VALUES (957,236106,37,'waltz','apish','transcontinental','A');
-INSERT INTO t2 VALUES (958,236107,37,'Lillian','Adlerian','amateurish','');
-INSERT INTO t2 VALUES (959,236108,37,'repressions','Tropez','Gandhian','');
-INSERT INTO t2 VALUES (960,236109,37,'chillingly','nouns','stratified','');
-INSERT INTO t2 VALUES (961,236110,37,'noncritical','distracting','chamberlains','');
-INSERT INTO t2 VALUES (962,236111,37,'lithograph','mutton','creditably','');
-INSERT INTO t2 VALUES (963,236112,37,'spongers','bridgeable','philosophic','');
-INSERT INTO t2 VALUES (964,236113,37,'parenthood','stickers','ores','');
-INSERT INTO t2 VALUES (965,238005,37,'posed','transcontinental','Carleton','');
-INSERT INTO t2 VALUES (966,238006,37,'instruments','amateurish','tape','A');
-INSERT INTO t2 VALUES (967,238007,37,'filial','Gandhian','afloat','A');
-INSERT INTO t2 VALUES (968,238008,37,'fixedly','stratified','goodness','A');
-INSERT INTO t2 VALUES (969,238009,37,'relives','chamberlains','welcoming','');
-INSERT INTO t2 VALUES (970,238010,37,'Pandora','creditably','Pinsky','FAS');
-INSERT INTO t2 VALUES (971,238011,37,'watering','philosophic','halting','');
-INSERT INTO t2 VALUES (972,238012,37,'ungrateful','ores','bibliography','');
-INSERT INTO t2 VALUES (973,238013,37,'secures','Carleton','decoding','');
-INSERT INTO t2 VALUES (974,240401,41,'chastisers','tape','variance','A');
-INSERT INTO t2 VALUES (975,240402,41,'icon','afloat','allowed','A');
-INSERT INTO t2 VALUES (976,240901,41,'reuniting','goodness','dire','A');
-INSERT INTO t2 VALUES (977,240902,41,'imagining','welcoming','dub','A');
-INSERT INTO t2 VALUES (978,241801,41,'abiding','Pinsky','poisoning','');
-INSERT INTO t2 VALUES (979,242101,41,'omnisciently','halting','Iraqis','A');
-INSERT INTO t2 VALUES (980,242102,41,'Britannic','bibliography','heaving','');
-INSERT INTO t2 VALUES (981,242201,41,'scholastics','decoding','population','A');
-INSERT INTO t2 VALUES (982,242202,41,'mechanics','variance','bomb','A');
-INSERT INTO t2 VALUES (983,242501,41,'humidly','allowed','Majorca','A');
-INSERT INTO t2 VALUES (984,242502,41,'masterpiece','dire','Gershwins','');
-INSERT INTO t2 VALUES (985,246201,41,'however','dub','explorers','');
-INSERT INTO t2 VALUES (986,246202,41,'Mendelian','poisoning','libretto','A');
-INSERT INTO t2 VALUES (987,246203,41,'jarred','Iraqis','occurred','');
-INSERT INTO t2 VALUES (988,246204,41,'scolds','heaving','Lagos','');
-INSERT INTO t2 VALUES (989,246205,41,'infatuate','population','rats','');
-INSERT INTO t2 VALUES (990,246301,41,'willed','bomb','bankruptcies','A');
-INSERT INTO t2 VALUES (991,246302,41,'joyfully','Majorca','crying','');
-INSERT INTO t2 VALUES (992,248001,41,'Microsoft','Gershwins','unexpected','');
-INSERT INTO t2 VALUES (993,248002,41,'fibrosities','explorers','accessed','A');
-INSERT INTO t2 VALUES (994,248003,41,'Baltimorean','libretto','colorful','A');
-INSERT INTO t2 VALUES (995,248004,41,'equestrian','occurred','versatility','A');
-INSERT INTO t2 VALUES (996,248005,41,'Goodrich','Lagos','cosy','');
-INSERT INTO t2 VALUES (997,248006,41,'apish','rats','Darius','A');
-INSERT INTO t2 VALUES (998,248007,41,'Adlerian','bankruptcies','mastering','A');
-INSERT INTO t2 VALUES (999,248008,41,'Tropez','crying','Asiaticizations','A');
-INSERT INTO t2 VALUES (1000,248009,41,'nouns','unexpected','offerers','A');
-INSERT INTO t2 VALUES (1001,248010,41,'distracting','accessed','uncles','A');
-INSERT INTO t2 VALUES (1002,248011,41,'mutton','colorful','sleepwalk','');
-INSERT INTO t2 VALUES (1003,248012,41,'bridgeable','versatility','Ernestine','');
-INSERT INTO t2 VALUES (1004,248013,41,'stickers','cosy','checksumming','');
-INSERT INTO t2 VALUES (1005,248014,41,'transcontinental','Darius','stopped','');
-INSERT INTO t2 VALUES (1006,248015,41,'amateurish','mastering','sicker','');
-INSERT INTO t2 VALUES (1007,248016,41,'Gandhian','Asiaticizations','Italianization','');
-INSERT INTO t2 VALUES (1008,248017,41,'stratified','offerers','alphabetic','');
-INSERT INTO t2 VALUES (1009,248018,41,'chamberlains','uncles','pharmaceutic','');
-INSERT INTO t2 VALUES (1010,248019,41,'creditably','sleepwalk','creator','');
-INSERT INTO t2 VALUES (1011,248020,41,'philosophic','Ernestine','chess','');
-INSERT INTO t2 VALUES (1012,248021,41,'ores','checksumming','charcoal','');
-INSERT INTO t2 VALUES (1013,248101,41,'Carleton','stopped','Epiphany','A');
-INSERT INTO t2 VALUES (1014,248102,41,'tape','sicker','bulldozes','A');
-INSERT INTO t2 VALUES (1015,248201,41,'afloat','Italianization','Pygmalion','A');
-INSERT INTO t2 VALUES (1016,248202,41,'goodness','alphabetic','caressing','A');
-INSERT INTO t2 VALUES (1017,248203,41,'welcoming','pharmaceutic','Palestine','A');
-INSERT INTO t2 VALUES (1018,248204,41,'Pinsky','creator','regimented','A');
-INSERT INTO t2 VALUES (1019,248205,41,'halting','chess','scars','A');
-INSERT INTO t2 VALUES (1020,248206,41,'bibliography','charcoal','realest','A');
-INSERT INTO t2 VALUES (1021,248207,41,'decoding','Epiphany','diffusing','A');
-INSERT INTO t2 VALUES (1022,248208,41,'variance','bulldozes','clubroom','A');
-INSERT INTO t2 VALUES (1023,248209,41,'allowed','Pygmalion','Blythe','A');
-INSERT INTO t2 VALUES (1024,248210,41,'dire','caressing','ahead','');
-INSERT INTO t2 VALUES (1025,248211,50,'dub','Palestine','reviver','');
-INSERT INTO t2 VALUES (1026,250501,34,'poisoning','regimented','retransmitting','A');
-INSERT INTO t2 VALUES (1027,250502,34,'Iraqis','scars','landslide','');
-INSERT INTO t2 VALUES (1028,250503,34,'heaving','realest','Eiffel','');
-INSERT INTO t2 VALUES (1029,250504,34,'population','diffusing','absentee','');
-INSERT INTO t2 VALUES (1030,250505,34,'bomb','clubroom','aye','');
-INSERT INTO t2 VALUES (1031,250601,34,'Majorca','Blythe','forked','A');
-INSERT INTO t2 VALUES (1032,250602,34,'Gershwins','ahead','Peruvianizes','');
-INSERT INTO t2 VALUES (1033,250603,34,'explorers','reviver','clerked','');
-INSERT INTO t2 VALUES (1034,250604,34,'libretto','retransmitting','tutor','');
-INSERT INTO t2 VALUES (1035,250605,34,'occurred','landslide','boulevard','');
-INSERT INTO t2 VALUES (1036,251001,34,'Lagos','Eiffel','shuttered','');
-INSERT INTO t2 VALUES (1037,251002,34,'rats','absentee','quotes','A');
-INSERT INTO t2 VALUES (1038,251003,34,'bankruptcies','aye','Caltech','');
-INSERT INTO t2 VALUES (1039,251004,34,'crying','forked','Mossberg','');
-INSERT INTO t2 VALUES (1040,251005,34,'unexpected','Peruvianizes','kept','');
-INSERT INTO t2 VALUES (1041,251301,34,'accessed','clerked','roundly','');
-INSERT INTO t2 VALUES (1042,251302,34,'colorful','tutor','features','A');
-INSERT INTO t2 VALUES (1043,251303,34,'versatility','boulevard','imaginable','A');
-INSERT INTO t2 VALUES (1044,251304,34,'cosy','shuttered','controller','');
-INSERT INTO t2 VALUES (1045,251305,34,'Darius','quotes','racial','');
-INSERT INTO t2 VALUES (1046,251401,34,'mastering','Caltech','uprisings','A');
-INSERT INTO t2 VALUES (1047,251402,34,'Asiaticizations','Mossberg','narrowed','A');
-INSERT INTO t2 VALUES (1048,251403,34,'offerers','kept','cannot','A');
-INSERT INTO t2 VALUES (1049,251404,34,'uncles','roundly','vest','');
-INSERT INTO t2 VALUES (1050,251405,34,'sleepwalk','features','famine','');
-INSERT INTO t2 VALUES (1051,251406,34,'Ernestine','imaginable','sugars','');
-INSERT INTO t2 VALUES (1052,251801,34,'checksumming','controller','exterminated','A');
-INSERT INTO t2 VALUES (1053,251802,34,'stopped','racial','belays','');
-INSERT INTO t2 VALUES (1054,252101,34,'sicker','uprisings','Hodges','A');
-INSERT INTO t2 VALUES (1055,252102,34,'Italianization','narrowed','translatable','');
-INSERT INTO t2 VALUES (1056,252301,34,'alphabetic','cannot','duality','A');
-INSERT INTO t2 VALUES (1057,252302,34,'pharmaceutic','vest','recording','A');
-INSERT INTO t2 VALUES (1058,252303,34,'creator','famine','rouses','A');
-INSERT INTO t2 VALUES (1059,252304,34,'chess','sugars','poison','');
-INSERT INTO t2 VALUES (1060,252305,34,'charcoal','exterminated','attitude','');
-INSERT INTO t2 VALUES (1061,252306,34,'Epiphany','belays','dusted','');
-INSERT INTO t2 VALUES (1062,252307,34,'bulldozes','Hodges','encompasses','');
-INSERT INTO t2 VALUES (1063,252308,34,'Pygmalion','translatable','presentation','');
-INSERT INTO t2 VALUES (1064,252309,34,'caressing','duality','Kantian','');
-INSERT INTO t2 VALUES (1065,256001,34,'Palestine','recording','imprecision','A');
-INSERT INTO t2 VALUES (1066,256002,34,'regimented','rouses','saving','');
-INSERT INTO t2 VALUES (1067,256003,34,'scars','poison','maternal','');
-INSERT INTO t2 VALUES (1068,256004,34,'realest','attitude','hewed','');
-INSERT INTO t2 VALUES (1069,256005,34,'diffusing','dusted','kerosene','');
-INSERT INTO t2 VALUES (1070,258001,34,'clubroom','encompasses','Cubans','');
-INSERT INTO t2 VALUES (1071,258002,34,'Blythe','presentation','photographers','');
-INSERT INTO t2 VALUES (1072,258003,34,'ahead','Kantian','nymph','A');
-INSERT INTO t2 VALUES (1073,258004,34,'reviver','imprecision','bedlam','A');
-INSERT INTO t2 VALUES (1074,258005,34,'retransmitting','saving','north','A');
-INSERT INTO t2 VALUES (1075,258006,34,'landslide','maternal','Schoenberg','A');
-INSERT INTO t2 VALUES (1076,258007,34,'Eiffel','hewed','botany','A');
-INSERT INTO t2 VALUES (1077,258008,34,'absentee','kerosene','curs','');
-INSERT INTO t2 VALUES (1078,258009,34,'aye','Cubans','solidification','');
-INSERT INTO t2 VALUES (1079,258010,34,'forked','photographers','inheritresses','');
-INSERT INTO t2 VALUES (1080,258011,34,'Peruvianizes','nymph','stiller','');
-INSERT INTO t2 VALUES (1081,258101,68,'clerked','bedlam','t1','A');
-INSERT INTO t2 VALUES (1082,258102,68,'tutor','north','suite','A');
-INSERT INTO t2 VALUES (1083,258103,34,'boulevard','Schoenberg','ransomer','');
-INSERT INTO t2 VALUES (1084,258104,68,'shuttered','botany','Willy','');
-INSERT INTO t2 VALUES (1085,258105,68,'quotes','curs','Rena','A');
-INSERT INTO t2 VALUES (1086,258106,68,'Caltech','solidification','Seattle','A');
-INSERT INTO t2 VALUES (1087,258107,68,'Mossberg','inheritresses','relaxes','A');
-INSERT INTO t2 VALUES (1088,258108,68,'kept','stiller','exclaim','');
-INSERT INTO t2 VALUES (1089,258109,68,'roundly','t1','implicated','A');
-INSERT INTO t2 VALUES (1090,258110,68,'features','suite','distinguish','');
-INSERT INTO t2 VALUES (1091,258111,68,'imaginable','ransomer','assayed','');
-INSERT INTO t2 VALUES (1092,258112,68,'controller','Willy','homeowner','');
-INSERT INTO t2 VALUES (1093,258113,68,'racial','Rena','and','');
-INSERT INTO t2 VALUES (1094,258201,34,'uprisings','Seattle','stealth','');
-INSERT INTO t2 VALUES (1095,258202,34,'narrowed','relaxes','coinciding','A');
-INSERT INTO t2 VALUES (1096,258203,34,'cannot','exclaim','founder','A');
-INSERT INTO t2 VALUES (1097,258204,34,'vest','implicated','environing','');
-INSERT INTO t2 VALUES (1098,258205,34,'famine','distinguish','jewelry','');
-INSERT INTO t2 VALUES (1099,258301,34,'sugars','assayed','lemons','A');
-INSERT INTO t2 VALUES (1100,258401,34,'exterminated','homeowner','brokenness','A');
-INSERT INTO t2 VALUES (1101,258402,34,'belays','and','bedpost','A');
-INSERT INTO t2 VALUES (1102,258403,34,'Hodges','stealth','assurers','A');
-INSERT INTO t2 VALUES (1103,258404,34,'translatable','coinciding','annoyers','');
-INSERT INTO t2 VALUES (1104,258405,34,'duality','founder','affixed','');
-INSERT INTO t2 VALUES (1105,258406,34,'recording','environing','warbling','');
-INSERT INTO t2 VALUES (1106,258407,34,'rouses','jewelry','seriously','');
-INSERT INTO t2 VALUES (1107,228123,37,'poison','lemons','boasted','');
-INSERT INTO t2 VALUES (1108,250606,34,'attitude','brokenness','Chantilly','');
-INSERT INTO t2 VALUES (1109,208405,37,'dusted','bedpost','Iranizes','');
-INSERT INTO t2 VALUES (1110,212101,37,'encompasses','assurers','violinist','');
-INSERT INTO t2 VALUES (1111,218206,37,'presentation','annoyers','extramarital','');
-INSERT INTO t2 VALUES (1112,150401,37,'Kantian','affixed','spates','');
-INSERT INTO t2 VALUES (1113,248212,41,'imprecision','warbling','cloakroom','');
-INSERT INTO t2 VALUES (1114,128026,00,'saving','seriously','gazer','');
-INSERT INTO t2 VALUES (1115,128024,00,'maternal','boasted','hand','');
-INSERT INTO t2 VALUES (1116,128027,00,'hewed','Chantilly','tucked','');
-INSERT INTO t2 VALUES (1117,128025,00,'kerosene','Iranizes','gems','');
-INSERT INTO t2 VALUES (1118,128109,00,'Cubans','violinist','clinker','');
-INSERT INTO t2 VALUES (1119,128705,00,'photographers','extramarital','refiner','');
-INSERT INTO t2 VALUES (1120,126303,00,'nymph','spates','callus','');
-INSERT INTO t2 VALUES (1121,128308,00,'bedlam','cloakroom','leopards','');
-INSERT INTO t2 VALUES (1122,128204,00,'north','gazer','comfortingly','');
-INSERT INTO t2 VALUES (1123,128205,00,'Schoenberg','hand','generically','');
-INSERT INTO t2 VALUES (1124,128206,00,'botany','tucked','getters','');
-INSERT INTO t2 VALUES (1125,128207,00,'curs','gems','sexually','');
-INSERT INTO t2 VALUES (1126,118205,00,'solidification','clinker','spear','');
-INSERT INTO t2 VALUES (1127,116801,00,'inheritresses','refiner','serums','');
-INSERT INTO t2 VALUES (1128,116803,00,'stiller','callus','Italianization','');
-INSERT INTO t2 VALUES (1129,116804,00,'t1','leopards','attendants','');
-INSERT INTO t2 VALUES (1130,116802,00,'suite','comfortingly','spies','');
-INSERT INTO t2 VALUES (1131,128605,00,'ransomer','generically','Anthony','');
-INSERT INTO t2 VALUES (1132,118308,00,'Willy','getters','planar','');
-INSERT INTO t2 VALUES (1133,113702,00,'Rena','sexually','cupped','');
-INSERT INTO t2 VALUES (1134,113703,00,'Seattle','spear','cleanser','');
-INSERT INTO t2 VALUES (1135,112103,00,'relaxes','serums','commuters','');
-INSERT INTO t2 VALUES (1136,118009,00,'exclaim','Italianization','honeysuckle','');
-INSERT INTO t2 VALUES (5136,1118009,00,'exclaim','Italianization','honeysuckle','');
-INSERT INTO t2 VALUES (1137,138011,00,'implicated','attendants','orphanage','');
-INSERT INTO t2 VALUES (1138,138010,00,'distinguish','spies','skies','');
-INSERT INTO t2 VALUES (1139,138012,00,'assayed','Anthony','crushers','');
-INSERT INTO t2 VALUES (1140,068304,00,'homeowner','planar','Puritan','');
-INSERT INTO t2 VALUES (1141,078009,00,'and','cupped','squeezer','');
-INSERT INTO t2 VALUES (1142,108013,00,'stealth','cleanser','bruises','');
-INSERT INTO t2 VALUES (1143,084004,00,'coinciding','commuters','bonfire','');
-INSERT INTO t2 VALUES (1144,083402,00,'founder','honeysuckle','Colombo','');
-INSERT INTO t2 VALUES (1145,084003,00,'environing','orphanage','nondecreasing','');
-INSERT INTO t2 VALUES (1146,088504,00,'jewelry','skies','innocents','');
-INSERT INTO t2 VALUES (1147,088005,00,'lemons','crushers','masked','');
-INSERT INTO t2 VALUES (1148,088007,00,'brokenness','Puritan','file','');
-INSERT INTO t2 VALUES (1149,088006,00,'bedpost','squeezer','brush','');
-INSERT INTO t2 VALUES (1150,148025,00,'assurers','bruises','mutilate','');
-INSERT INTO t2 VALUES (1151,148024,00,'annoyers','bonfire','mommy','');
-INSERT INTO t2 VALUES (1152,138305,00,'affixed','Colombo','bulkheads','');
-INSERT INTO t2 VALUES (1153,138306,00,'warbling','nondecreasing','undeclared','');
-INSERT INTO t2 VALUES (1154,152701,00,'seriously','innocents','displacements','');
-INSERT INTO t2 VALUES (1155,148505,00,'boasted','masked','nieces','');
-INSERT INTO t2 VALUES (1156,158003,00,'Chantilly','file','coeducation','');
-INSERT INTO t2 VALUES (1157,156201,00,'Iranizes','brush','brassy','');
-INSERT INTO t2 VALUES (1158,156202,00,'violinist','mutilate','authenticator','');
-INSERT INTO t2 VALUES (1159,158307,00,'extramarital','mommy','Washoe','');
-INSERT INTO t2 VALUES (1160,158402,00,'spates','bulkheads','penny','');
-INSERT INTO t2 VALUES (1161,158401,00,'cloakroom','undeclared','Flagler','');
-INSERT INTO t2 VALUES (1162,068013,00,'gazer','displacements','stoned','');
-INSERT INTO t2 VALUES (1163,068012,00,'hand','nieces','cranes','');
-INSERT INTO t2 VALUES (1164,068203,00,'tucked','coeducation','masterful','');
-INSERT INTO t2 VALUES (1165,088205,00,'gems','brassy','biracial','');
-INSERT INTO t2 VALUES (1166,068704,00,'clinker','authenticator','steamships','');
-INSERT INTO t2 VALUES (1167,068604,00,'refiner','Washoe','windmills','');
-INSERT INTO t2 VALUES (1168,158502,00,'callus','penny','exploit','');
-INSERT INTO t2 VALUES (1169,123103,00,'leopards','Flagler','riverfront','');
-INSERT INTO t2 VALUES (1170,148026,00,'comfortingly','stoned','sisterly','');
-INSERT INTO t2 VALUES (1171,123302,00,'generically','cranes','sharpshoot','');
-INSERT INTO t2 VALUES (1172,076503,00,'getters','masterful','mittens','');
-INSERT INTO t2 VALUES (1173,126304,00,'sexually','biracial','interdependency','');
-INSERT INTO t2 VALUES (1174,068306,00,'spear','steamships','policy','');
-INSERT INTO t2 VALUES (1175,143504,00,'serums','windmills','unleashing','');
-INSERT INTO t2 VALUES (1176,160201,00,'Italianization','exploit','pretenders','');
-INSERT INTO t2 VALUES (1177,148028,00,'attendants','riverfront','overstatements','');
-INSERT INTO t2 VALUES (1178,148027,00,'spies','sisterly','birthed','');
-INSERT INTO t2 VALUES (1179,143505,00,'Anthony','sharpshoot','opportunism','');
-INSERT INTO t2 VALUES (1180,108014,00,'planar','mittens','showroom','');
-INSERT INTO t2 VALUES (1181,076104,00,'cupped','interdependency','compromisingly','');
-INSERT INTO t2 VALUES (1182,078106,00,'cleanser','policy','Medicare','');
-INSERT INTO t2 VALUES (1183,126102,00,'commuters','unleashing','corresponds','');
-INSERT INTO t2 VALUES (1184,128029,00,'honeysuckle','pretenders','hardware','');
-INSERT INTO t2 VALUES (1185,128028,00,'orphanage','overstatements','implant','');
-INSERT INTO t2 VALUES (1186,018410,00,'skies','birthed','Alicia','');
-INSERT INTO t2 VALUES (1187,128110,00,'crushers','opportunism','requesting','');
-INSERT INTO t2 VALUES (1188,148506,00,'Puritan','showroom','produced','');
-INSERT INTO t2 VALUES (1189,123303,00,'squeezer','compromisingly','criticizes','');
-INSERT INTO t2 VALUES (1190,123304,00,'bruises','Medicare','backer','');
-INSERT INTO t2 VALUES (1191,068504,00,'bonfire','corresponds','positively','');
-INSERT INTO t2 VALUES (1192,068305,00,'Colombo','hardware','colicky','');
-INSERT INTO t2 VALUES (1193,000000,00,'nondecreasing','implant','thrillingly','');
---enable_query_log
-
-#
-# Search with a key
-#
-
-select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%";
-select fld3 from t2 where fld3 like "%cultivation" ;
-
-#
-# Search with a key using sorting and limit the same time
-#
-
-select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3;
-select fld3,companynr from t2 where companynr = 58 order by fld3;
-
-select fld3 from t2 order by fld3 desc limit 10;
-select fld3 from t2 order by fld3 desc limit 5;
-select fld3 from t2 order by fld3 desc limit 5,5;
-
-#
-# Search with a key having a constant with each unique key.
-# The table is read directly with read-next on fld3
-#
-
-select t2.fld3 from t2 where fld3 = 'honeysuckle';
-select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_';
-select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_';
-select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%';
-select t2.fld3 from t2 where fld3 LIKE 'h%le';
-
-select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_';
-select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%';
-
-#
-# Test using INDEX and IGNORE INDEX
-#
-
-explain select t2.fld3 from t2 where fld3 = 'honeysuckle';
-
-explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle';
-explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle';
-
-explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle';
-explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle';
-
-#
-# NOTE NOTE NOTE
-# The next should give an error
-#
-
--- error 1176
-explain select fld3 from t2 ignore index (fld3,not_used);
--- error 1176
-explain select fld3 from t2 use index (not_used);
-
-#
-# Test sorting with a used key (there is no need for sorting)
-#
-
-select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
-explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
-select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3;
-
-#
-# Search with a key having a constant with many occurrences
-# The table is read directly with read-next having fld3 to get the
-# occurrences
-#
-
-select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes';
-
-#
-# Search with bunched 'or's.
-# If one can limit the key to a certain interval only the possible
-# alternatives will be gone through
-#
-
-select fld1 from t2 where fld1=250501 or fld1="250502";
-explain select fld1 from t2 where fld1=250501 or fld1="250502";
-select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502;
-explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502;
-
-#
-# Search with a key with LIKE constant
-# If the like starts with a certain letter key will be used.
-#
-
---sorted_result
-select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%';
-select fld3 from t2 where fld3 like "L%" and fld3 = "ok";
-select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly");
-select fld1,fld3 from t2 where fld1 like "25050%";
-select fld1,fld3 from t2 where fld1 like "25050_";
-
-#
-# Search using distinct. An automatic grouping will be done over all the fields,
-# if only distinct is used. In any other case a temporary table will always
-# be created. If only the field used for sorting is from the main register,
-# it will be sorted first before the distinct table is created.
-#
-
-select distinct companynr from t2;
-select distinct companynr from t2 order by companynr;
-select distinct companynr from t2 order by companynr desc;
-select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%";
-
-select distinct fld3 from t2 where companynr = 34 order by fld3;
-select distinct fld3 from t2 limit 10;
-select distinct fld3 from t2 having fld3 like "A%" limit 10;
-select distinct substring(fld3,1,3) from t2 where fld3 like "A%";
-select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10;
-select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10;
-select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10;
-
-# make a big table.
-
-create table t3 (
- period int not null,
- name char(32) not null,
- companynr int not null,
- price double(11,0),
- price2 double(11,0),
- key (period),
- key (name)
-);
-
---disable_query_log
-INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1001,"Iranizes",37,5987435,234724);
-INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1002,"violinist",37,28357832,8723648);
-INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1003,"extramarital",37,39654943,235872);
-INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1004,"spates",78,726498,72987523);
-INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1005,"cloakroom",78,98439034,823742);
-INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1006,"gazer",101,834598,27348324);
-INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1007,"hand",154,983543950,29837423);
-INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1008,"tucked",311,234298,3275892);
-INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1009,"gems",447,2374834,9872392);
-INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1010,"clinker",512,786542,76234234);
---enable_query_log
-
-create temporary table tmp engine = myisam select * from t3;
-
-insert into t3 select * from tmp;
-insert into tmp select * from t3;
-insert into t3 select * from tmp;
-insert into tmp select * from t3;
-insert into t3 select * from tmp;
-insert into tmp select * from t3;
-insert into t3 select * from tmp;
-insert into tmp select * from t3;
-insert into t3 select * from tmp;
-insert into tmp select * from t3;
-insert into t3 select * from tmp;
-insert into tmp select * from t3;
-insert into t3 select * from tmp;
-insert into tmp select * from t3;
-insert into t3 select * from tmp;
-insert into tmp select * from t3;
-insert into t3 select * from tmp;
-#insert into tmp select * from t3;
-#insert into t3 select * from tmp;
-
-alter table t3 add t2nr int not null auto_increment primary key first;
-
-drop table tmp;
-
-# big table done
-
-SET SQL_BIG_TABLES=1;
-select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10;
-SET SQL_BIG_TABLES=0;
-select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10;
-select distinct fld5 from t2 limit 10;
-
-#
-# Force use of remove_dupp
-#
-
-select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
-SET SQL_BIG_TABLES=1; # Force use of MyISAM
-select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
-SET SQL_BIG_TABLES=0;
-select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10;
-
-#
-# A big order by that should trigger a merge in filesort
-#
-
-select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2;
-
-#
-# Search with distinct and order by with many table.
-#
-
-select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3;
-
-#
-# Here the last fld3 is optimized away from the order by
-#
-
-explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3;
-
-#
-# Some test with ORDER BY and limit
-#
-
-explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
-explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
-explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
-
-#
-# Search with a constant table.
-#
-
-select period from t1;
-select period from t1 where period=1900;
-select fld3,period from t1,t2 where fld1 = 011401 order by period;
-
-#
-# Search with a constant table and several keyparts. (Rows are read only once
-# in the beginning of the search)
-#
-
-select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001;
-
-explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period;
-
-#
-# Search with a constant table and several rows from another table
-#
-
-select fld3,period from t2,t1 where companynr*10 = 37*10;
-
-#
-# Search with a table reference and without a key.
-# t3 will be the main table.
-#
-
-select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price;
-
-#
-# Search with an interval on a table with full key on reference table.
-# Here t2 will be the main table and only records matching the
-# t2nr will be checked.
-#
-
-select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37;
-
-#
-# We need another table for join stuff..
-#
-
-create table t4 (
- companynr tinyint(2) unsigned zerofill NOT NULL default '00',
- companyname char(30) NOT NULL default '',
- PRIMARY KEY (companynr),
- UNIQUE KEY companyname(companyname)
-) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
-
---disable_query_log
-INSERT INTO t4 (companynr, companyname) VALUES (29,'company 1');
-INSERT INTO t4 (companynr, companyname) VALUES (34,'company 2');
-INSERT INTO t4 (companynr, companyname) VALUES (36,'company 3');
-INSERT INTO t4 (companynr, companyname) VALUES (37,'company 4');
-INSERT INTO t4 (companynr, companyname) VALUES (40,'company 5');
-INSERT INTO t4 (companynr, companyname) VALUES (41,'company 6');
-INSERT INTO t4 (companynr, companyname) VALUES (53,'company 7');
-INSERT INTO t4 (companynr, companyname) VALUES (58,'company 8');
-INSERT INTO t4 (companynr, companyname) VALUES (65,'company 9');
-INSERT INTO t4 (companynr, companyname) VALUES (68,'company 10');
-INSERT INTO t4 (companynr, companyname) VALUES (50,'company 11');
-INSERT INTO t4 (companynr, companyname) VALUES (00,'Unknown');
---enable_query_log
-
-#
-# Test of stright join to force a full join.
-#
-
-select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
-
-select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
-
-#
-# Full join (same alias)
-#
-
-select * from t1,t1 t12;
-select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505;
-
-#
-# Test of left join.
-#
-insert into t2 (fld1, companynr) values (999999,99);
-
-analyze table t2; # PBXT: Required for correct count(*)
-
-select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null;
-select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null;
-explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null;
-explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null;
-
-select companynr,companyname from t2 left join t4 using (companynr) where companynr is null;
-select count(*) from t2 left join t4 using (companynr) where companynr is not null;
-explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null;
-explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null;
-delete from t2 where fld1=999999;
-
-analyze table t2; # PBXT: Required for correct count(*)
-
-#
-# Test left join optimization
-
-explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
-explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
-explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0;
-
-explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
-explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0;
-explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0;
-# Following can't be optimized
-explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null;
-explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0;
-explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0;
-
-explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null;
-explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0;
-explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0;
-
-#
-# Joins with forms.
-#
-
-select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
-explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
-
-#
-# Search using 'or' with the same referens group.
-# An interval search will be done first with the first table and after that
-# the other table is referenced with a key with a 'test if key in use' for
-# each record
-#
-
-select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
-
-select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009;
-
-select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009;
-
-#
-# Test of many parenthesis levels
-#
-
-select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909);
-select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6)));
-
-select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1;
-
-select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606);
-
-select fld1 from t2 where fld1 between 250502 and 250504;
-
-select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ;
-
-#
-# Group on one table.
-# optimizer: sort table by group and send rows.
-#
-
-select count(*) from t1;
-select companynr,count(*),sum(fld1) from t2 group by companynr;
-select companynr,count(*) from t2 group by companynr order by companynr desc limit 5;
-select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>"";
-explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>"";
-select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3;
-select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10;
-select /*! SQL_SMALL_RESULT */ companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10;
-select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ;
-select distinct mod(companynr,10) from t4 group by companynr;
-select distinct 1 from t4 group by companynr;
-select count(distinct fld1) from t2;
-select companynr,count(distinct fld1) from t2 group by companynr;
-select companynr,count(*) from t2 group by companynr;
-select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr;
-select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr;
-select companynr,count(distinct floor(fld1/100)) from t2 group by companynr;
-select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr;
-
-#
-# group with where on a key field
-#
-
-select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10;
-select name,count(*) from t3 where name='cloakroom' group by name;
-select name,count(*) from t3 where name='cloakroom' and price>10 group by name;
-select count(*) from t3 where name='cloakroom' and price2=823742;
-select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name;
-select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name;
-select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name;
-
-#
-# Group with extra not group fields.
-#
-
-select companynr|0,companyname from t4 group by 1;
-select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname;
-select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name;
-
-#
-# Calculation with group functions
-#
-
-select sum(Period)/count(*) from t1;
-select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr;
-select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg;
-
-#
-# Group with order on not first table
-# optimizer: sort table by group and write group records to tmp table.
-# sort tmp_table and send rows.
-#
-
-select companynr,count(*) from t2 group by companynr order by 2 desc;
-select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc;
-select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4;
-
-#
-# group by with many tables
-# optimizer: create tmp table with group-by uniq index.
-# write with update to tmp table.
-# sort tmp table according to order (or group if no order)
-# send rows
-#
-
-select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3;
-select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr;
-
-#
-# group with many tables and long group on many tables. group on formula
-# optimizer: create tmp table with neaded fields
-# sort tmp table by group and calculate sums to new table
-# if different order by than group, sort tmp table
-# send rows
-#
-
-select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1;
-
-#
-# WHERE const folding
-# optimize: If there is a "field = const" part in the where, change all
-# instances of field in the and level to const.
-# All instances of const = const are checked once and removed.
-#
-
-#
-# Where -> t3.t2nr = 98005 and t2.fld1 = 98005
-#
-
-select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008;
-
-select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1;
-
-explain select fld3 from t2 where 1>2 or 2>3;
-explain select fld3 from t2 where fld1=fld1;
-
-#
-# HAVING
-#
-
-select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502;
-select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502;
-select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000;
-select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ;
-select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40;
-
-#
-# MIN(), MAX() and COUNT() optimizing
-#
-
-select count(*) from t2;
-select count(*) from t2 where fld1 < 098024;
-# PS does correct pre-zero here. MySQL can't do it as it returns a number.
---disable_ps_protocol
-select min(fld1) from t2 where fld1>= 098024;
---enable_ps_protocol
-select max(fld1) from t2 where fld1>= 098024;
-select count(*) from t3 where price2=76234234;
-select count(*) from t3 where companynr=512 and price2=76234234;
-explain select min(fld1),max(fld1),count(*) from t2;
-# PS does correct pre-zero here. MySQL can't do it as it returns a number.
---disable_ps_protocol
-select min(fld1),max(fld1),count(*) from t2;
---enable_ps_protocol
-select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742;
-select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78;
-select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20;
-select max(t2nr) from t3 where price=983543950;
-
-#
-# Test of alias
-#
-
-select t1.period from t3 = t1 limit 1;
-select t1.period from t1 as t1 limit 1;
-select t1.period as "Nuvarande period" from t1 as t1 limit 1;
-select period as ok_period from t1 limit 1;
-select period as ok_period from t1 group by ok_period limit 1;
-select 1+1 as summa from t1 group by summa limit 1;
-select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1;
-
-#
-# Some simple show commands
-#
-
-show tables;
-show tables from test like "s%";
-show tables from test like "t?";
-# We mask out the Privileges column because it differs with embedded server
---replace_column 8 #
-show full columns from t2;
---replace_column 8 #
-show full columns from t2 from test like 'f%';
---replace_column 8 #
-show full columns from t2 from test like 's%';
-show keys from t2;
-
-drop table t4, t3, t2, t1;
-
-#
-# Test of DO
-#
-
-DO 1;
-DO benchmark(100,1+1),1,1;
-
-#
-# Bug #6449: do default;
-#
-
---error ER_PARSE_ERROR
-do default;
---error ER_BAD_FIELD_ERROR
-do foobar;
-
-#
-# random in WHERE clause
-#
-
-CREATE TABLE t1 (
- id mediumint(8) unsigned NOT NULL auto_increment,
- pseudo varchar(35) NOT NULL default '',
- PRIMARY KEY (id),
- UNIQUE KEY pseudo (pseudo)
-);
-INSERT INTO t1 (pseudo) VALUES ('test');
-INSERT INTO t1 (pseudo) VALUES ('test1');
-SELECT 1 as rnd1 from t1 where rand() > 2;
-DROP TABLE t1;
-
-#
-# Test of bug with SUM(CASE...)
-#
-
-CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM;
-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);
-# Disable PS becasue we get more warnings from PS than from normal execution
---disable_ps_protocol
-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;
---enable_ps_protocol
-# Testing the same select with NULL's instead of invalid datetime values
-SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid;
-DROP TABLE t1,t2;
-
-#
-# Test of bigint comparision
-#
-
-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');
-INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093);
-select wss_type from t1 where wss_type ='102935229216544106';
-select wss_type from t1 where wss_type ='102935229216544105';
-select wss_type from t1 where wss_type ='102935229216544104';
-select wss_type from t1 where wss_type ='102935229216544093';
-select wss_type from t1 where wss_type =102935229216544093;
-drop table t1;
-select 1+2,"aaaa",3.13*2.0 into @a,@b,@c;
-select @a;
-select @b;
-select @c;
-
-#
-# Test of removing redundant braces in the FROM part
-# (We test each construct with the braced join to the left and right;
-# the latter case used to cause a syntax errors.)
-#
-
-create table t1 (a int not null auto_increment primary key);
-insert into t1 values ();
-insert into t1 values ();
-insert into t1 values ();
-# ,
-select * from (t1 as t2 left join t1 as t3 using (a)), t1;
-select * from t1, (t1 as t2 left join t1 as t3 using (a));
-# stright_join
-select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1;
-select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a));
-# inner join on
-select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1;
-select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1;
-# inner join using
-select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a );
-select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a );
-# left [outer] join on
---sorted_result
-select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1;
---sorted_result
-select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1;
-# left join using
-select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a );
-select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a );
-# natural left join
-select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1;
-select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a));
-# right join on
---sorted_result
-select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1;
---sorted_result
-select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1;
-# right [outer] joing using
-select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a );
-select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a );
-# natural right join
-select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1;
-select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a));
-# natural join
-select * from t1 natural join (t1 as t2 left join t1 as t3 using (a));
-select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1;
-drop table t1;
-
-CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) ENGINE=MyISAM;
-INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522);
-CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=MyISAM;
-INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522);
-select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5;
-drop table t1,t2;
-
-#
-# outer join, impossible on condition, where, and usable key for range
-#
-create table t1 (id1 int NOT NULL);
-create table t2 (id2 int NOT NULL);
-create table t3 (id3 int NOT NULL);
-create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4));
-
-insert into t1 values (1);
-insert into t1 values (2);
-insert into t2 values (1);
-insert into t4 values (1,1);
-
-explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3
-left join t4 on id3 = id4 where id2 = 1 or id4 = 1;
-select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3
-left join t4 on id3 = id4 where id2 = 1 or id4 = 1;
-
-drop table t1,t2,t3,t4;
-#
-# Bug #2298
-#
-
-create table t1(s varchar(10) not null);
-create table t2(s varchar(10) not null primary key);
-create table t3(s varchar(10) not null primary key);
-insert into t1 values ('one\t'), ('two\t');
-insert into t2 values ('one\r'), ('two\t');
-insert into t3 values ('one '), ('two\t');
-select * from t1 where s = 'one';
-select * from t2 where s = 'one';
-select * from t3 where s = 'one';
-select * from t1,t2 where t1.s = t2.s;
-select * from t2,t3 where t2.s = t3.s;
-drop table t1, t2, t3;
-
-#
-# Bug #3759
-# Both queries should produce identical plans and results.
-#
-create table t1 (a integer, b integer, index(a), index(b));
-create table t2 (c integer, d integer, index(c), index(d));
-insert into t1 values (1,2), (2,2), (3,2), (4,2);
-insert into t2 values (1,3), (2,3), (3,4), (4,4);
-explain select * from t1 left join t2 on a=c where d in (4);
-select * from t1 left join t2 on a=c where d in (4);
-explain select * from t1 left join t2 on a=c where d = 4;
-select * from t1 left join t2 on a=c where d = 4;
-drop table t1, t2;
-
-#
-# Covering index is mentioned in EXPLAIN output for const tables (bug #5333)
-#
-
-CREATE TABLE t1 (
- i int(11) NOT NULL default '0',
- c char(10) NOT NULL default '',
- PRIMARY KEY (i),
- UNIQUE KEY c (c)
-) ENGINE=MyISAM;
-
-INSERT INTO t1 VALUES (1,'a');
-INSERT INTO t1 VALUES (2,'b');
-INSERT INTO t1 VALUES (3,'c');
-
-EXPLAIN SELECT i FROM t1 WHERE i=1;
-
-DROP TABLE t1;
-
-#
-# Test case for bug 7520: a wrong cost of the index for a BLOB field
-#
-
-CREATE TABLE t1 ( a BLOB, INDEX (a(20)) );
-CREATE TABLE t2 ( a BLOB, INDEX (a(20)) );
-
-INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five');
-INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five');
-
-EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a;
-EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a;
-
-DROP TABLE t1, t2;
-
-#
-# Test case for bug 7098: substitution of a constant for a string field
-#
-
-CREATE TABLE t1 ( city char(30) );
-INSERT INTO t1 VALUES ('London');
-INSERT INTO t1 VALUES ('Paris');
-
-SELECT * FROM t1 WHERE city='London';
-SELECT * FROM t1 WHERE city='london';
-EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london';
-SELECT * FROM t1 WHERE city='London' AND city='london';
-EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London';
-SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London';
-
-DROP TABLE t1;
-
-#
-# Bug#7425 inconsistent sort order on unsigned columns result of substraction
-#
-
-create table t1 (a int(11) unsigned, b int(11) unsigned);
-insert into t1 values (1,0), (1,1), (18446744073709551615,0);
-select a-b from t1 order by 1;
-select a-b , (a-b < 0) from t1 order by 1;
-select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0;
-select cast((a - b) as unsigned) from t1 order by 1;
-drop table t1;
-
-
-#
-# Bug#8733 server accepts malformed query (multiply mentioned distinct)
-#
-create table t1 (a int(11));
-select all all * from t1;
-select distinct distinct * from t1;
---error 1221
-select all distinct * from t1;
---error 1221
-select distinct all * from t1;
-drop table t1;
-
-#
-# Test for BUG#10095
-#
-CREATE TABLE t1 (
- kunde_intern_id int(10) unsigned NOT NULL default '0',
- kunde_id int(10) unsigned NOT NULL default '0',
- FK_firma_id int(10) unsigned NOT NULL default '0',
- aktuell enum('Ja','Nein') NOT NULL default 'Ja',
- vorname varchar(128) NOT NULL default '',
- nachname varchar(128) NOT NULL default '',
- geloescht enum('Ja','Nein') NOT NULL default 'Nein',
- firma varchar(128) NOT NULL default ''
-);
-
-INSERT INTO t1 VALUES
- (3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'),
- (3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX');
-
-
-SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1
- WHERE
- (
- (
- ( '' != '' AND firma LIKE CONCAT('%', '', '%'))
- OR
- (vorname LIKE CONCAT('%', 'Vorname1', '%') AND
- nachname LIKE CONCAT('%', '1Nachname', '%') AND
- 'Vorname1' != '' AND 'xxxx' != '')
- )
- AND
- (
- aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2
- )
- )
- ;
-
-SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname,
-geloescht FROM t1
- WHERE
- (
- (
- aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2
- )
- AND
- (
- ( '' != '' AND firma LIKE CONCAT('%', '', '%') )
- OR
- ( vorname LIKE CONCAT('%', 'Vorname1', '%') AND
-nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND
-'xxxx' != '')
- )
- )
- ;
-
-SELECT COUNT(*) FROM t1 WHERE
-( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1))
-AND FK_firma_id = 2;
-
-drop table t1;
-
-#
-#
-# Test for Bug#8009, SELECT failed on bigint unsigned when using HEX
-#
-
-CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b));
-INSERT INTO t1 VALUES (0x8000000000000000);
-SELECT b FROM t1 WHERE b=0x8000000000000000;
-DROP TABLE t1;
-
-#
-# IN with outer join condition (BUG#9393)
-#
-CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL);
-
-CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL);
-INSERT INTO `t2` VALUES (0,'READ');
-
-CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL);
-INSERT INTO `t3` VALUES (1,'fs');
-
-select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0);
-
-drop table t1,t2,t3;
-
-# Test for BUG#11700
-CREATE TABLE t1 (
- acct_id int(11) NOT NULL default '0',
- profile_id smallint(6) default NULL,
- UNIQUE KEY t1$acct_id (acct_id),
- KEY t1$profile_id (profile_id)
-);
-INSERT INTO t1 VALUES (132,17),(133,18);
-
-CREATE TABLE t2 (
- profile_id smallint(6) default NULL,
- queue_id int(11) default NULL,
- seq int(11) default NULL,
- KEY t2$queue_id (queue_id)
-);
-INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1);
-
-CREATE TABLE t3 (
- id int(11) NOT NULL default '0',
- qtype int(11) default NULL,
- seq int(11) default NULL,
- warn_lvl int(11) default NULL,
- crit_lvl int(11) default NULL,
- rr1 tinyint(4) NOT NULL default '0',
- rr2 int(11) default NULL,
- default_queue tinyint(4) NOT NULL default '0',
- KEY t3$qtype (qtype),
- KEY t3$id (id)
-);
-
-INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0),
- (36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0);
-
-SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q
-WHERE
- (pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND
- (pq.queue_id = q.id) AND (q.rr1 <> 1);
-
-drop table t1,t2,t3;
-
-#
-# Bug #11482 Wrongly applied optimization was erroneously rejecting valid
-# rows
-create table t1 (f1 int);
-insert into t1 values (1),(NULL);
-create table t2 (f2 int, f3 int, f4 int);
-create index idx1 on t2 (f4);
-insert into t2 values (1,2,3),(2,4,6);
-select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3)
-from t2 C where A.f4 = C.f4) or A.f3 IS NULL;
-drop table t1,t2;
-
-#
-# Bug #11521 Negative integer keys incorrectly substituted for 0 during
-# range analysis.
-
-create table t2 (a tinyint unsigned);
-create index t2i on t2(a);
-insert into t2 values (0), (254), (255);
-explain select * from t2 where a > -1;
-select * from t2 where a > -1;
-drop table t2;
-
-#
-# Bug #11745: SELECT ... FROM DUAL with WHERE condition
-#
-
-CREATE TABLE t1 (a int, b int, c int);
-INSERT INTO t1
- SELECT 50, 3, 3 FROM DUAL
- WHERE NOT EXISTS
- (SELECT * FROM t1 WHERE a = 50 AND b = 3);
-SELECT * FROM t1;
-INSERT INTO t1
- SELECT 50, 3, 3 FROM DUAL
- WHERE NOT EXISTS
- (SELECT * FROM t1 WHERE a = 50 AND b = 3);
-select found_rows();
-SELECT * FROM t1;
-select count(*) from t1;
-select found_rows();
-select count(*) from t1 limit 2,3;
-select found_rows(); # PBXT: returns 1 here (like InnoDB), MyISAM returns 0. Bug?!
-select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3;
-select found_rows();
-
-DROP TABLE t1;
-
-#
-# Bug 7672 Unknown column error in order clause
-#
-CREATE TABLE t1 (a INT, b INT);
-(SELECT a, b AS c FROM t1) ORDER BY c+1;
-(SELECT a, b AS c FROM t1) ORDER BY b+1;
-SELECT a, b AS c FROM t1 ORDER BY c+1;
-SELECT a, b AS c FROM t1 ORDER BY b+1;
-drop table t1;
-
-#
-# Bug #13356 assertion failed in resolve_const_item()
-#
-create table t1(f1 int, f2 int);
-create table t2(f3 int);
-select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1));
-select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1));
-select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL));
-insert into t1 values(1,1),(2,null);
-insert into t2 values(2);
-select * from t1,t2 where f1=f3 and (f1,f2) = (2,null);
-select * from t1,t2 where f1=f3 and (f1,f2) <=> (2,null);
-drop table t1,t2;
-
-#
-# Bug #13535
-#
-create table t1 (f1 int not null auto_increment primary key, f2 varchar(10));
-create table t11 like t1;
-insert into t1 values(1,""),(2,"");
---replace_column 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X
-show table status like 't1%';
-select 123 as a from t1 where f1 is null;
-drop table t1,t11;
-
-#
-# Bug #3874 (function in GROUP and LEFT JOIN)
-#
-
-CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) );
-INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4);
-CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, e INT );
-INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2),(1,2,3);
-SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN
-t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c;
-SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN
-t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t1.a, t1.b, c;
-SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN
-t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t2.a, t2.b, c;
-SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2,t1
-WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c;
-DROP TABLE IF EXISTS t1, t2;
-
-#
-# Bug #13855 select distinct with group by caused server crash
-#
-create table t1 (f1 int primary key, f2 int);
-create table t2 (f3 int, f4 int, primary key(f3,f4));
-insert into t1 values (1,1);
-insert into t2 values (1,1),(1,2);
-select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1;
-drop table t1,t2;
-
-#
-# Bug #14482 Server crash when subselecting from the same table
-#
-create table t1 (f1 int,f2 int);
-insert into t1 values(1,1);
-create table t2 (f3 int, f4 int, primary key(f3,f4));
-insert into t2 values(1,1);
-select * from t1 where f1 in (select f3 from t2 where (f3,f4)= (select f3,f4 from t2));
-drop table t1,t2;
-
-#
-# Bug #4981: 4.x and 5.x produce non-optimal execution path, 3.23 regression test failure
-#
-CREATE TABLE t1(a int, b int, c int, KEY b(b), KEY c(c));
-insert into t1 values (1,0,0),(2,0,0);
-CREATE TABLE t2 (a int, b varchar(2), c varchar(2), PRIMARY KEY(a));
-insert into t2 values (1,'',''), (2,'','');
-CREATE TABLE t3 (a int, b int, PRIMARY KEY (a,b), KEY a (a), KEY b (b));
-insert into t3 values (1,1),(1,2);
-# must have "range checked" for t2
-explain select straight_join DISTINCT t2.a,t2.b, t1.c from t1, t3, t2
- where (t1.c=t2.a or (t1.c=t3.a and t2.a=t3.b)) and t1.b=556476786 and
- t2.b like '%%' order by t2.b limit 0,1;
-DROP TABLE t1,t2,t3;
-
-#
-# Bug #17873: confusing error message when IGNORE INDEX refers a column name
-#
-
-CREATE TABLE t1 (a int, INDEX idx(a));
-INSERT INTO t1 VALUES (2), (3), (1);
-
-EXPLAIN SELECT * FROM t1 IGNORE INDEX (idx);
---error 1176
-EXPLAIN SELECT * FROM t1 IGNORE INDEX (a);
---error 1176
-EXPLAIN SELECT * FROM t1 FORCE INDEX (a);
-
-DROP TABLE t1;
-
-#
-# Bug #21019: First result of SELECT COUNT(*) different than consecutive runs
-#
-CREATE TABLE t1 (a int, b int);
-INSERT INTO t1 VALUES (1,1), (2,1), (4,10);
-
-CREATE TABLE t2 (a int PRIMARY KEY, b int, KEY b (b));
-INSERT INTO t2 VALUES (1,NULL), (2,10);
-ALTER TABLE t1 ENABLE KEYS;
-
-EXPLAIN SELECT STRAIGHT_JOIN SQL_NO_CACHE COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
-SELECT STRAIGHT_JOIN SQL_NO_CACHE * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
-EXPLAIN SELECT STRAIGHT_JOIN SQL_NO_CACHE COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
-SELECT STRAIGHT_JOIN SQL_NO_CACHE * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
-DROP TABLE IF EXISTS t1,t2;
-
-#
-# Bug #20954 "avg(keyval) retuns 0.38 but max(keyval) returns an empty set"
-#
---disable_ps_protocol
-CREATE TABLE t1 (key1 float default NULL, UNIQUE KEY key1 (key1));
-CREATE TABLE t2 (key2 float default NULL, UNIQUE KEY key2 (key2));
-INSERT INTO t1 VALUES (0.3762),(0.3845),(0.6158),(0.7941);
-INSERT INTO t2 VALUES (1.3762),(1.3845),(1.6158),(1.7941);
-
-explain select max(key1) from t1 where key1 <= 0.6158;
-explain select max(key2) from t2 where key2 <= 1.6158;
-explain select min(key1) from t1 where key1 >= 0.3762;
-explain select min(key2) from t2 where key2 >= 1.3762;
-explain select max(key1), min(key2) from t1, t2
-where key1 <= 0.6158 and key2 >= 1.3762;
-explain select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
-explain select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
-
-select max(key1) from t1 where key1 <= 0.6158;
-select max(key2) from t2 where key2 <= 1.6158;
-select min(key1) from t1 where key1 >= 0.3762;
-select min(key2) from t2 where key2 >= 1.3762;
-select max(key1), min(key2) from t1, t2
-where key1 <= 0.6158 and key2 >= 1.3762;
-select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
-select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
-
-DROP TABLE t1,t2;
---enable_ps_protocol
-
-#
-# Bug #18759 "Incorrect string to numeric conversion"
-#
-# This test is here so that the behavior will not be changed to 4.1
-# and not to 5.0 either. In 4.1 and 5.0 sending an integer as a string
-# will be converted internally to real (double) value and it is not
-# as accurate as bigint (longlong) for integers. Thus the results may
-# vary. In 5.1 internally it is decimal, which is a string type and
-# will be more accurate. Due to rather big changes needed to fix this
-# in 4.1 or 5.0 it is not desired to do it in the stable versions.
-#
-# This test is here only to make sure that behavior is not changed in
-# 4.1 and 5.0
-#
-CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL);
-INSERT INTO t1 VALUES (10);
-SELECT i='1e+01',i=1e+01, i in (1e+01,1e+01), i in ('1e+01','1e+01') FROM t1;
-DROP TABLE t1;
-
-#
-# Bug #22533: storing large hex strings
-#
-
-create table t1(a bigint unsigned, b bigint);
-insert into t1 values (0xfffffffffffffffff, 0xfffffffffffffffff),
- (0x10000000000000000, 0x10000000000000000),
- (0x8fffffffffffffff, 0x8fffffffffffffff);
-select hex(a), hex(b) from t1;
-drop table t1;
-
---echo End of 4.1 tests
-
-#
-# Test for bug #6474
-#
-
-CREATE TABLE t1 (
-K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '',
-K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000',
-F2I4 int(11) NOT NULL default '0'
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-
-INSERT INTO t1 VALUES
-('W%RT', '0100', 1),
-('W-RT', '0100', 1),
-('WART', '0100', 1),
-('WART', '0200', 1),
-('WERT', '0100', 2),
-('WORT','0200', 2),
-('WT', '0100', 2),
-('W_RT', '0100', 2),
-('WaRT', '0100', 3),
-('WART', '0300', 3),
-('WRT' , '0400', 3),
-('WURM', '0500', 3),
-('W%T', '0600', 4),
-('WA%T', '0700', 4),
-('WA_T', '0800', 4);
-
-SELECT K2C4, K4N4, F2I4 FROM t1
- WHERE K2C4 = 'WART' AND
- (F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200'));
-SELECT K2C4, K4N4, F2I4 FROM t1
- WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200');
-DROP TABLE t1;
-
-#
-# Bug#8670
-#
-create table t1 (a int, b int);
-create table t2 like t1;
-select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1;
-select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1;
-select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1;
-drop table t1,t2;
-
-#
-# Bug#9820
-#
-
-create table t1 (s1 varchar(5));
-insert into t1 values ('Wall');
-select min(s1) from t1 group by s1 with rollup;
-drop table t1;
-
-#
-# Bug#9799
-#
-
-create table t1 (s1 int) engine=myisam;
-insert into t1 values (0);
-select avg(distinct s1) from t1 group by s1 with rollup;
-drop table t1;
-
-#
-# Bug#9800
-#
-
-create table t1 (s1 int);
-insert into t1 values (null),(1);
-select distinct avg(s1) as x from t1 group by s1 with rollup;
-drop table t1;
-
-
-#
-# Test for bug #10084: STRAIGHT_JOIN with ON expression
-#
-
-CREATE TABLE t1 (a int);
-CREATE TABLE t2 (a int);
-INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
-INSERT INTO t2 VALUES (2), (4), (6);
-
-SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a;
-
-EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a;
-EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a;
-
-DROP TABLE t1,t2;
-
-#
-# Bug #10650
-#
-
-select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0;
-
-#
-# Bug #11398 Bug in field_conv() results in wrong result of join with index
-#
-create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null);
-create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4));
-insert into t1 values (" 2", 2);
-insert into t2 values (" 2", " one "),(" 2", " two ");
-select * from t1 left join t2 on f1 = f3;
-drop table t1,t2;
-
-#
-# Bug #6558 Views: CREATE VIEW fails with JOIN ... USING
-#
-
-create table t1 (empnum smallint, grp int);
-create table t2 (empnum int, name char(5));
-insert into t1 values(1,1);
-insert into t2 values(1,'bob');
-create view v1 as select * from t2 inner join t1 using (empnum);
-select * from v1;
-drop table t1,t2;
-drop view v1;
-
-#
-# Bug #10646 Columns included in the join between two tables are ambigious
-# in the select
-#
-
-create table t1 (pk int primary key, b int);
-create table t2 (pk int primary key, c int);
-select pk from t1 inner join t2 using (pk);
-drop table t1,t2;
-
-#
-# Bug #10972 Natural join of view and underlying table gives wrong result
-#
-
-create table t1 (s1 int, s2 char(5), s3 decimal(10));
-create view v1 as select s1, s2, 'x' as s3 from t1;
-select * from t1 natural join v1;
-insert into t1 values (1,'x',5);
-select * from t1 natural join v1;
-drop table t1;
-drop view v1;
-
-#
-# Bug #6276 A SELECT that does a NATURAL OUTER JOIN without common
-# columns crashes server because of empty ON condition
-#
-
-create table t1(a1 int);
-create table t2(a2 int);
-insert into t1 values(1),(2);
-insert into t2 values(1),(2);
-create view v2 (c) as select a1 from t1;
-
---sorted_result
-select * from t1 natural left join t2;
---sorted_result
-select * from t1 natural right join t2;
-
---sorted_result
-select * from v2 natural left join t2;
---sorted_result
-select * from v2 natural right join t2;
-
-drop table t1, t2;
-drop view v2;
-
-
-#
-# Bug #4789 Incosistent results of more than 2-way natural joins due to
-# incorrect transformation to join ... on.
-#
-
-create table t1 (a int(10), t1_val int(10));
-create table t2 (b int(10), t2_val int(10));
-create table t3 (a int(10), b int(10));
-insert into t1 values (1,1),(2,2);
-insert into t2 values (1,1),(2,2),(3,3);
-insert into t3 values (1,1),(2,1),(3,1),(4,1);
-# the following two queries must return the same result
-select * from t1 natural join t2 natural join t3;
-select * from t1 natural join t3 natural join t2;
-drop table t1, t2, t3;
-
-
-#
-# Bug #12841: Server crash on DO IFNULL(NULL,NULL)
-#
-# (testing returning of int, decimal, real, string)
-DO IFNULL(NULL, NULL);
-SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL);
-SELECT ABS(IFNULL(NULL, NULL));
-SELECT IFNULL(NULL, NULL);
-
-#
-# BUG #12595 (ESCAPE must be exactly one)
-#
-SET @OLD_SQL_MODE12595=@@SQL_MODE, @@SQL_MODE='';
-SHOW LOCAL VARIABLES LIKE 'SQL_MODE';
-
-CREATE TABLE BUG_12595(a varchar(100));
-INSERT INTO BUG_12595 VALUES ('hakan%'), ('hakank'), ("ha%an");
-SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%';
-SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*';
--- error 1210
-SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**';
-# this should work when sql_mode is not NO_BACKSLASH_ESCAPES
-SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE '';
-SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE '';
-SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c;
-SELECT * FROM BUG_12595 WHERE a LIKE 'ha%%an' ESCAPE '%';
-SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE '\\';
-SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|';
-
-SET @@SQL_MODE='NO_BACKSLASH_ESCAPES';
-SHOW LOCAL VARIABLES LIKE 'SQL_MODE';
-SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%';
-SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*';
--- error 1210
-SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**';
--- error 1210
-SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE '\\';
-#this gives an error when NO_BACKSLASH_ESCAPES is set
--- error 1210
-SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE '';
-SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c;
-SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|';
--- error 1210
-SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\n%' ESCAPE '\n';
-
-SET @@SQL_MODE=@OLD_SQL_MODE12595;
-DROP TABLE BUG_12595;
-
-#
-# Bug #6495 Illogical requirement for column qualification in NATURAL join
-#
-
-create table t1 (a char(1));
-create table t2 (a char(1));
-insert into t1 values ('a'),('b'),('c');
-insert into t2 values ('b'),('c'),('d');
-select a from t1 natural join t2;
-select * from t1 natural join t2 where a = 'b';
-drop table t1, t2;
-
-#
-# Bug #12977 Compare table names with qualifying field tables only
-# for base tables, search all nested join operands of natural joins.
-#
-
-CREATE TABLE t1 (`id` TINYINT);
-CREATE TABLE t2 (`id` TINYINT);
-CREATE TABLE t3 (`id` TINYINT);
-INSERT INTO t1 VALUES (1),(2),(3);
-INSERT INTO t2 VALUES (2);
-INSERT INTO t3 VALUES (3);
--- error 1052
-SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id);
--- error 1052
-SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id);
--- error 1052
-SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id);
--- error 1052
-SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id);
-
-drop table t1, t2, t3;
-
-#
-# Bug #13067 JOIN xxx USING is case sensitive
-#
-
-create table t1 (a int(10),b int(10));
-create table t2 (a int(10),b int(10));
-insert into t1 values (1,10),(2,20),(3,30);
-insert into t2 values (1,10);
-# both queries should produce the same result
-select * from t1 inner join t2 using (A);
-select * from t1 inner join t2 using (a);
-drop table t1, t2;
-
-#
-# Bug #12943 Incorrect nesting of [INNER| CROSS] JOIN due to unspecified
-# associativity in the parser.
-#
-
-create table t1 (a int, c int);
-create table t2 (b int);
-create table t3 (b int, a int);
-create table t4 (c int);
-insert into t1 values (1,1);
-insert into t2 values (1);
-insert into t3 values (1,1);
-insert into t4 values (1);
-
-select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a);
-# Notice that ',' has lower priority than 'join', thus we have that:
-# t1, t2 join t3 <==> t1, (t2 join t3).
--- error 1054
-select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a);
-select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c);
-select * from t1 join t2 join t4 using (c);
-drop table t1, t2, t3, t4;
-
-#
-# Bug #12291 Table wasn't reinited for index scan after sequential scan
-#
-create table t1(x int, y int);
-create table t2(x int, y int);
-create table t3(x int, primary key(x));
-insert into t1 values (1, 1), (2, 1), (3, 1), (4, 3), (5, 6), (6, 6);
-insert into t2 values (1, 1), (2, 1), (3, 3), (4, 6), (5, 6);
-insert into t3 values (1), (2), (3), (4), (5);
-select t1.x, t3.x from t1, t2, t3 where t1.x = t2.x and t3.x >= t1.y and t3.x <= t2.y;
-drop table t1,t2,t3;
-
-#
-# Bug #13127 LEFT JOIN against a VIEW returns NULL instead of correct value
-#
-
-create table t1 (id char(16) not null default '', primary key (id));
-insert into t1 values ('100'),('101'),('102');
-create table t2 (id char(16) default null);
-insert into t2 values (1);
-create view v1 as select t1.id from t1;
-create view v2 as select t2.id from t2;
-create view v3 as select (t1.id+2) as id from t1 natural left join t2;
-
-# all queries must return the same result
-select t1.id from t1 left join v2 using (id);
-select t1.id from v2 right join t1 using (id);
---sorted_result
-select t1.id from t1 left join v3 using (id);
-select * from t1 left join v2 using (id);
-select * from v2 right join t1 using (id);
---sorted_result
-select * from t1 left join v3 using (id);
-
-select v1.id from v1 left join v2 using (id);
-select v1.id from v2 right join v1 using (id);
---sorted_result
-select v1.id from v1 left join v3 using (id);
-select * from v1 left join v2 using (id);
-select * from v2 right join v1 using (id);
---sorted_result
-select * from v1 left join v3 using (id);
-
-drop table t1, t2;
-drop view v1, v2, v3;
-
-#
-# Bug #13597 Column in ON condition not resolved if references a table in
-# nested right join.
-#
-
-create table t1 (id int(11) not null default '0');
-insert into t1 values (123),(191),(192);
-create table t2 (id char(16) character set utf8 not null);
-insert into t2 values ('58013'),('58014'),('58015'),('58016');
-create table t3 (a_id int(11) not null, b_id char(16) character set utf8);
-insert into t3 values (123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013');
-
-# both queries are equivalent
-select count(*)
-from t1 inner join (t3 left join t2 on t2.id = t3.b_id) on t1.id = t3.a_id;
-
-select count(*)
-from t1 inner join (t2 right join t3 on t2.id = t3.b_id) on t1.id = t3.a_id;
-
-drop table t1,t2,t3;
-
-#
-# Bug #13832 Incorrect parse order of join productions due to unspecified
-# operator priorities results in incorrect join tree.
-#
-
-create table t1 (a int);
-create table t2 (b int);
-create table t3 (c int);
-select * from t1 join t2 join t3 on (t1.a=t3.c);
-select * from t1 join t2 left join t3 on (t1.a=t3.c);
-select * from t1 join t2 right join t3 on (t1.a=t3.c);
-select * from t1 join t2 straight_join t3 on (t1.a=t3.c);
-drop table t1, t2 ,t3;
-
-#
-# Bug #14093 Query takes a lot of time when date format is not valid
-# fix optimizes execution. so here we just check that returned set is
-# correct.
-create table t1(f1 int, f2 date);
-insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'),
- (4,'2005-10-01'),(5,'2005-12-30');
-# should return all records
-select * from t1 where f2 >= 0 order by f2;
-select * from t1 where f2 >= '0000-00-00' order by f2;
-# should return 4,5
-select * from t1 where f2 >= '2005-09-31' order by f2;
-select * from t1 where f2 >= '2005-09-3a' order by f2;
-# should return 1,2,3
-select * from t1 where f2 <= '2005-09-31' order by f2;
-select * from t1 where f2 <= '2005-09-3a' order by f2;
-drop table t1;
-
-#
-# Bug ##14662 ORDER BY on column of a view, with an alias of the same
-# column causes ambiguous
-#
-
-create table t1 (f1 int, f2 int);
-insert into t1 values (1, 30), (2, 20), (3, 10);
-create algorithm=merge view v1 as select f1, f2 from t1;
-create algorithm=merge view v2 (f2, f1) as select f1, f2 from t1;
-create algorithm=merge view v3 as select t1.f1 as f2, t1.f2 as f1 from t1;
-select t1.f1 as x1, f1 from t1 order by t1.f1;
-select v1.f1 as x1, f1 from v1 order by v1.f1;
-select v2.f1 as x1, f1 from v2 order by v2.f1;
-select v3.f1 as x1, f1 from v3 order by v3.f1;
-select f1, f2, v1.f1 as x1 from v1 order by v1.f1;
-select f1, f2, v2.f1 as x1 from v2 order by v2.f1;
-select f1, f2, v3.f1 as x1 from v3 order by v3.f1;
-drop table t1;
-drop view v1, v2, v3;
-
-#
-# Bug #15106: lost equality predicate of the form field=const in a join query
-#
-
-CREATE TABLE t1(key_a int4 NOT NULL, optimus varchar(32), PRIMARY KEY(key_a));
-CREATE TABLE t2(key_a int4 NOT NULL, prime varchar(32), PRIMARY KEY(key_a));
-CREATE table t3(key_a int4 NOT NULL, key_b int4 NOT NULL, foo varchar(32),
- PRIMARY KEY(key_a,key_b));
-
-INSERT INTO t1 VALUES (0,'');
-INSERT INTO t1 VALUES (1,'i');
-INSERT INTO t1 VALUES (2,'j');
-INSERT INTO t1 VALUES (3,'k');
-
-INSERT INTO t2 VALUES (1,'r');
-INSERT INTO t2 VALUES (2,'s');
-INSERT INTO t2 VALUES (3,'t');
-
-INSERT INTO t3 VALUES (1,5,'x');
-INSERT INTO t3 VALUES (1,6,'y');
-INSERT INTO t3 VALUES (2,5,'xx');
-INSERT INTO t3 VALUES (2,6,'yy');
-INSERT INTO t3 VALUES (2,7,'zz');
-INSERT INTO t3 VALUES (3,5,'xxx');
-
-SELECT t2.key_a,foo
- FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a
- INNER JOIN t3 ON t1.key_a = t3.key_a
- WHERE t2.key_a=2 and key_b=5;
-EXPLAIN SELECT t2.key_a,foo
- FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a
- INNER JOIN t3 ON t1.key_a = t3.key_a
- WHERE t2.key_a=2 and key_b=5;
-
-SELECT t2.key_a,foo
- FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a
- INNER JOIN t3 ON t1.key_a = t3.key_a
- WHERE t2.key_a=2 and key_b=5;
-EXPLAIN SELECT t2.key_a,foo
- FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a
- INNER JOIN t3 ON t1.key_a = t3.key_a
- WHERE t2.key_a=2 and key_b=5;
-
-DROP TABLE t1,t2,t3;
-
-#
-# Bug#15347 Wrong result of subselect when records cache and set functions
-# are involved
-#
-create table t1 (f1 int);
-insert into t1 values(1),(2);
-create table t2 (f2 int, f3 int, key(f2));
-insert into t2 values(1,1),(2,2);
-create table t3 (f4 int not null);
-insert into t3 values (2),(2),(2);
-select f1,(select count(*) from t2,t3 where f2=f1 and f3=f4) as count from t1;
-drop table t1,t2,t3;
-
-#
-# Bug #15633 Evaluation of Item_equal for non-const table caused wrong
-# select result
-#
-create table t1 (f1 int unique);
-create table t2 (f2 int unique);
-create table t3 (f3 int unique);
-insert into t1 values(1),(2);
-insert into t2 values(1),(2);
-insert into t3 values(1),(NULL);
-select * from t3 where f3 is null;
-select t2.f2 from t1 left join t2 on f1=f2 join t3 on f1=f3 where f1=1;
-drop table t1,t2,t3;
-
-#
-# Bug#15268 Unchecked null value caused server crash
-#
-create table t1(f1 char, f2 char not null);
-insert into t1 values(null,'a');
-create table t2 (f2 char not null);
-insert into t2 values('b');
-select * from t1 left join t2 on f1=t2.f2 where t1.f2='a';
-drop table t1,t2;
-
-#
-# Bug#15538 unchecked table absense caused server crash.
-#
---error 1064
-select * from (select * left join t on f1=f2) tt;
-
-#
-# Bug #16504: re-evaluation of Item_equal object after reading const table
-#
-
-CREATE TABLE t1 (sku int PRIMARY KEY, pr int);
-CREATE TABLE t2 (sku int PRIMARY KEY, sppr int, name varchar(255));
-
-INSERT INTO t1 VALUES
- (10, 10), (20, 10), (30, 20), (40, 30), (50, 10), (60, 10);
-
-INSERT INTO t2 VALUES
- (10, 10, 'aaa'), (20, 10, 'bbb'), (30, 10, 'ccc'), (40, 20, 'ddd'),
- (50, 10, 'eee'), (60, 20, 'fff'), (70, 20, 'ggg'), (80, 30, 'hhh');
-
-SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr
- FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku);
-EXPLAIN
-SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr
- FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku);
-
-
-DROP TABLE t1,t2;
-
-#
-# Bug#18712: Truncation problem (needs just documenting and test
-# cases to prevent fixing this accidently. It is intended behaviour)
-#
-
-SET SQL_MODE='NO_UNSIGNED_SUBTRACTION';
-CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL);
-INSERT t1 SET i = 0;
-UPDATE t1 SET i = -1;
-SELECT * FROM t1;
-UPDATE t1 SET i = CAST(i - 1 AS SIGNED);
-SELECT * FROM t1;
-UPDATE t1 SET i = i - 1;
-SELECT * FROM t1;
-DROP TABLE t1;
-SET SQL_MODE=default;
-
-# BUG#17379
-
-create table t1 (a int);
-insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-create table t2 (a int, b int, c int, e int, primary key(a,b,c));
-insert into t2 select A.a, B.a, C.a, C.a from t1 A, t1 B, t1 C;
-analyze table t2;
--- echo In next EXPLAIN, B.rows must be exactly 10 (when using MyISAM):
-
-# We mask out the 'rows' column because it may differ from run to run
---replace_column 9 #
-explain select * from t2 A, t2 B where A.a=5 and A.b=5 and A.C<5
- and B.a=5 and B.b=A.e and (B.b =1 or B.b = 3 or B.b=5);
-drop table t1, t2;
-
-#
-#Bug #18940: selection of optimal execution plan caused by equality
-# propagation (the bug was fixed by the patch for bug #17379)
-
-CREATE TABLE t1 (a int PRIMARY KEY, b int, INDEX(b));
-INSERT INTO t1 VALUES (1, 3), (9,4), (7,5), (4,5), (6,2),
- (3,1), (5,1), (8,9), (2,2), (0,9);
-
-CREATE TABLE t2 (c int, d int, f int, INDEX(c,f));
-INSERT INTO t2 VALUES
- (1,0,0), (1,0,1), (2,0,0), (2,0,1), (3,0,0), (4,0,1),
- (5,0,0), (5,0,1), (6,0,0), (0,0,1), (7,0,0), (7,0,1),
- (0,0,0), (0,0,1), (8,0,0), (8,0,1), (9,0,0), (9,0,1);
-
-EXPLAIN
-SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6;
-EXPLAIN
-SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6 AND a > 0;
-
-DROP TABLE t1, t2;
-
-#
-# Bug #18895: BIT values cause joins to fail
-#
-create table t1 (
- a int unsigned not null auto_increment primary key,
- b bit not null,
- c bit not null
-);
-
-create table t2 (
- a int unsigned not null auto_increment primary key,
- b bit not null,
- c int unsigned not null,
- d varchar(50)
-);
-
-insert into t1 (b,c) values (0,1), (0,1);
-insert into t2 (b,c) values (0,1);
-
-# Row 1 should succeed. Row 2 should fail. Both fail.
-select t1.a, t1.b + 0, t1.c + 0, t2.a, t2.b + 0, t2.c, t2.d
-from t1 left outer join t2 on t1.a = t2.c and t2.b <> 1
-where t1.b <> 1 order by t1.a;
-
-drop table t1,t2;
-
-#
-# Bug #20569: Garbage in DECIMAL results from some mathematical functions
-#
-SELECT 0.9888889889 * 1.011111411911;
-
-#
-# Bug #10977: No warning issued if a column name is truncated
-#
-prepare stmt from 'select 1 as " a "';
-execute stmt;
-
-#
-# Bug #21390: wrong estimate of rows after elimination of const tables
-#
-
-CREATE TABLE t1 (a int NOT NULL PRIMARY KEY, b int NOT NULL);
-INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4);
-
-CREATE TABLE t2 (c int NOT NULL, INDEX idx(c));
-INSERT INTO t2 VALUES
- (1), (1), (1), (1), (1), (1), (1), (1),
- (2), (2), (2), (2),
- (3), (3),
- (4);
-
-EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=1;
-EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=4;
-
-DROP TABLE t1, t2;
-
-#
-# No matches for a join after substitution of a const table
-#
-
-CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a int);
-INSERT INTO t1 VALUES (1,2), (2,NULL), (3,2);
-
-CREATE TABLE t2 (b int, c INT, INDEX idx1(b));
-INSERT INTO t2 VALUES (2,1), (3,2);
-
-CREATE TABLE t3 (d int, e int, INDEX idx1(d));
-INSERT INTO t3 VALUES (2,10), (2,20), (1,30), (2,40), (2,50);
-
-EXPLAIN
-SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id
- WHERE t1.id=2;
-SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id
- WHERE t1.id=2;
-
-DROP TABLE t1,t2,t3;
-
-#
-# Bug #22735: no equality propagation for BETWEEN and IN with STRING arguments
-#
-
-CREATE TABLE t1 (pk varchar(10) PRIMARY KEY, fk varchar(16));
-CREATE TABLE t2 (pk varchar(16) PRIMARY KEY, fk varchar(10));
-
-INSERT INTO t1 VALUES
- ('d','dddd'), ('i','iii'), ('a','aa'), ('b','bb'), ('g','gg'),
- ('e','eee'), ('c','cccc'), ('h','hhh'), ('j','jjj'), ('f','fff');
-INSERT INTO t2 VALUES
- ('jjj', 'j'), ('cc','c'), ('ccc','c'), ('aaa', 'a'), ('jjjj','j'),
- ('hhh','h'), ('gg','g'), ('fff','f'), ('ee','e'), ('ffff','f'),
- ('bbb','b'), ('ff','f'), ('cccc','c'), ('dddd','d'), ('jj','j'),
- ('aaaa','a'), ('bb','b'), ('eeee','e'), ('aa','a'), ('hh','h');
-
-EXPLAIN SELECT t2.*
- FROM t1 JOIN t2 ON t2.fk=t1.pk
- WHERE t2.fk < 'c' AND t2.pk=t1.fk;
-EXPLAIN SELECT t2.*
- FROM t1 JOIN t2 ON t2.fk=t1.pk
- WHERE t2.fk BETWEEN 'a' AND 'b' AND t2.pk=t1.fk;
-EXPLAIN SELECT t2.*
- FROM t1 JOIN t2 ON t2.fk=t1.pk
- WHERE t2.fk IN ('a','b') AND t2.pk=t1.fk;
-
-DROP TABLE t1,t2;
-
-#
-# Bug #22367: Optimizer uses ref join type instead of eq_ref for simple
-# join on strings
-#
-CREATE TABLE t1 (a int, b varchar(20) NOT NULL, PRIMARY KEY(a));
-CREATE TABLE t2 (a int, b varchar(20) NOT NULL,
- PRIMARY KEY (a), UNIQUE KEY (b));
-INSERT INTO t1 VALUES (1,'a'),(2,'b'),(3,'c');
-INSERT INTO t2 VALUES (1,'a'),(2,'b'),(3,'c');
-
-EXPLAIN SELECT t1.a FROM t1 LEFT JOIN t2 ON t2.b=t1.b WHERE t1.a=3;
-
-DROP TABLE t1,t2;
-
-#
-# Bug #19579: predicates that become sargable after reading const tables
-# are not taken into account by optimizer
-#
-
-CREATE TABLE t1(id int PRIMARY KEY, b int, e int);
-CREATE TABLE t2(i int, a int, INDEX si(i), INDEX ai(a));
-CREATE TABLE t3(a int PRIMARY KEY, c char(4), INDEX ci(c));
-
-INSERT INTO t1 VALUES
- (1,10,19), (2,20,22), (4,41,42), (9,93,95), (7, 77,79),
- (6,63,67), (5,55,58), (3,38,39), (8,81,89);
-INSERT INTO t2 VALUES
- (21,210), (41,410), (82,820), (83,830), (84,840),
- (65,650), (51,510), (37,370), (94,940), (76,760),
- (22,220), (33,330), (40,400), (95,950), (38,380),
- (67,670), (88,880), (57,570), (96,960), (97,970);
-INSERT INTO t3 VALUES
- (210,'bb'), (950,'ii'), (400,'ab'), (500,'ee'), (220,'gg'),
- (440,'gg'), (310,'eg'), (380,'ee'), (840,'bb'), (830,'ff'),
- (230,'aa'), (960,'ii'), (410,'aa'), (510,'ee'), (290,'bb'),
- (450,'gg'), (320,'dd'), (390,'hh'), (850,'jj'), (860,'ff');
-
-EXPLAIN
-SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3
- WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND
- t3.a=t2.a AND t3.c IN ('bb','ee');
-EXPLAIN
-SELECT t3.a FROM t1,t2,t3
- WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND
- t3.a=t2.a AND t3.c IN ('bb','ee') ;
-
-EXPLAIN
-SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3
- WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND
- t3.c IN ('bb','ee');
-EXPLAIN
-SELECT t3.a FROM t1,t2,t3
- WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND
- t3.c IN ('bb','ee');
-
-DROP TABLE t1,t2,t3;
-
-#
-# Bug#6298: LIMIT #, -1 no longer works to set start with no end limit
-#
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-CREATE TABLE t1(a int);
-INSERT into t1 values (1), (2), (3);
-
-# LIMIT N, -1 was accepted by accident in 4.0, but was not intended.
-# This test verifies that this illegal construct is now properly detected.
-
---error ER_PARSE_ERROR
-SELECT * FROM t1 LIMIT 2, -1;
-
-DROP TABLE t1;
-
-
-SET optimizer_switch=@save_optimizer_switch;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/select_found.test b/mysql-test/suite/pbxt/t/select_found.test
deleted file mode 100644
index 23813f6d883..00000000000
--- a/mysql-test/suite/pbxt/t/select_found.test
+++ /dev/null
@@ -1,198 +0,0 @@
-#
-# Testing of found_rows()
-#
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-create table t1 (a int not null auto_increment, b int not null, primary key(a));
-insert into t1 (b) values (2),(3),(5),(5),(5),(6),(7),(9);
-select SQL_CALC_FOUND_ROWS * from t1;
-select found_rows();
-select SQL_CALC_FOUND_ROWS * from t1 limit 1;
-select found_rows();
-select SQL_BUFFER_RESULT SQL_CALC_FOUND_ROWS * from t1 limit 1;
-select found_rows();
-select SQL_CALC_FOUND_ROWS * from t1 order by b desc limit 1;
-select found_rows();
-select SQL_CALC_FOUND_ROWS distinct b from t1 limit 1;
-select found_rows();
-select SQL_CALC_FOUND_ROWS b,count(*) as c from t1 group by b order by c desc limit 1;
-select found_rows();
-select SQL_CALC_FOUND_ROWS * from t1 left join t1 as t2 on (t1.b=t2.a) limit 2,1;
-select found_rows();
-drop table t1;
-
-#
-# Test SQL_CALC_FOUND_ROWS optimization when used with one table and filesort
-#
-
-create table t1 (a int not null primary key);
-insert into t1 values (1),(2),(3),(4),(5);
-select sql_calc_found_rows a from t1 where a in (1,2,3) order by a desc limit 0,2;
-select FOUND_ROWS();
-select sql_calc_found_rows a from t1 where a in (1,2,3) order by a+2 desc limit 0,2;
-select FOUND_ROWS();
-drop table t1;
-
-#
-# Test of SQL_CALC_FOUND_ROWS with DISTINCT
-#
-
-CREATE TABLE t1 (
-`id` smallint(5) unsigned NOT NULL auto_increment,
-`kid` smallint(5) unsigned NOT NULL default '0',
-PRIMARY KEY (`id`),
-KEY `kid` (`kid`)
-);
-
-CREATE TABLE t2 (
- id smallint(5) unsigned NOT NULL auto_increment,
- name varchar(50) NOT NULL default '',
- email varchar(50) NOT NULL default '',
- PRIMARY KEY (id),
- UNIQUE KEY e_n (email,name)
-);
-
-disable_query_log;
-let $1=200;
-let $2=0;
-while ($1)
-{
- inc $2;
- eval INSERT INTO t2 VALUES ($2,'name$2','email$2');
- dec $1;
-}
-enable_query_log;
-
-EXPLAIN SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id WHERE t1.id IS NULL LIMIT 10;
-SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id WHERE t1.id IS NULL LIMIT 10;
-SELECT FOUND_ROWS();
-
-SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id WHERE t1.id IS NULL order by email LIMIT 10;
-SELECT FOUND_ROWS();
-
-SELECT DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id WHERE t1.id IS NULL LIMIT 10;
-SELECT DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id WHERE t1.id IS NULL ORDER BY email LIMIT 10;
-INSERT INTO `t1` (`id`, `kid`) VALUES ('0', '150');
-
-SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id WHERE t1.id IS NULL LIMIT 10;
-SELECT FOUND_ROWS();
-
-drop table t1,t2;
-
-#
-# Test bug when using range optimization
-#
-
-CREATE TABLE `t1` (
- `titre` char(80) NOT NULL default '',
- `numeropost` mediumint(8) unsigned NOT NULL auto_increment,
- `maxnumrep` int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (`numeropost`),
- KEY `maxnumrep` (`maxnumrep`)
-) ENGINE=MyISAM ROW_FORMAT=FIXED;
-INSERT INTO t1 (titre,maxnumrep) VALUES
-('test1','1'),('test2','2'),('test3','3');
-SELECT SQL_CALC_FOUND_ROWS titre,numeropost,maxnumrep FROM t1 WHERE numeropost IN (1,2) ORDER BY maxnumrep DESC LIMIT 0, 1;
-SELECT FOUND_ROWS();
-SELECT SQL_CALC_FOUND_ROWS 1 FROM (SELECT 1) as a LIMIT 0;
-SELECT FOUND_ROWS();
-SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE numeropost > 1 LIMIT 0;
-SELECT FOUND_ROWS();
-SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 0;
-SELECT FOUND_ROWS();
-SELECT SQL_CALC_FOUND_ROWS * FROM t1 ORDER BY numeropost LIMIT 0;
-SELECT FOUND_ROWS();
-drop table t1;
-
-#
-# Test problem with impossible WHERE (Bug #1468)
-#
-
-create table t1 (id int, primary key (id));
-insert into t1 values (1), (2), (3), (4), (5);
-select SQL_CALC_FOUND_ROWS * from t1 where id > 3 limit 0, 1;
-select FOUND_ROWS();
-select SQL_CALC_FOUND_ROWS * from t1 where id > 3 AND 1=2 limit 0, 1;
-select FOUND_ROWS();
-select SQL_CALC_FOUND_ROWS * from t1 where id > 6 limit 0, 1;
-select FOUND_ROWS();
-drop table t1;
-
-#
-# Other bugs with range optimization
-#
-
-# bug #2448
-
-CREATE TABLE t1 ( a int not null, b int not null, KEY ab(a,b) );
-INSERT INTO t1 VALUES ( 47, 1 );
-INSERT INTO t1 VALUES ( 70, 1 );
-SELECT * FROM t1
-WHERE
-(
- ( b =1 AND a BETWEEN 14 AND 21 ) OR
- ( b =2 AND a BETWEEN 16 AND 18 ) OR
- ( b =3 AND a BETWEEN 15 AND 19 )
-);
-DROP TABLE t1;
-
-# bug #2698
-
-CREATE TABLE t1 ( a integer, u varchar(15), r integer, key uao_idx( r, a, u));
-DELETE FROM t1
-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;
-
-#
-# Bug #3738: we have a ref key
-#
-
-CREATE TABLE t1 (a VARCHAR(16), UNIQUE(a));
-INSERT INTO t1 VALUES ('1'), ('2'), ('3');
-SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a = '2' LIMIT 0, 1;
-SELECT FOUND_ROWS();
-DROP TABLE t1;
-
-#
-# Bug #3845: group by, having and empty result
-#
-
-CREATE TABLE t1 (a INT);
-INSERT INTO t1 VALUES (0), (0), (1), (2);
-SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a = 0 GROUP BY a HAVING a > 10;
-SELECT FOUND_ROWS();
-DROP TABLE t1;
-
-#
-# Bug #6089: queries which don't use any tables
-#
-
-SELECT 'foo';
-SELECT FOUND_ROWS();
-SELECT SQL_CALC_FOUND_ROWS 'foo';
-SELECT FOUND_ROWS();
-SELECT SQL_CALC_FOUND_ROWS 'foo' limit 0;
-SELECT FOUND_ROWS();
-SELECT FOUND_ROWS();
-
-SELECT SQL_CALC_FOUND_ROWS 'foo' UNION SELECT 'bar' LIMIT 0;
-SELECT FOUND_ROWS();
-
-#
-# Bug #7945: group by + distinct with constant expression + limit
-#
-
-CREATE TABLE t1 (a int, b int);
-INSERT INTO t1 VALUES (1,2), (1,3), (1,4), (1,5);
-SELECT SQL_CALC_FOUND_ROWS DISTINCT 'a' FROM t1 GROUP BY b LIMIT 2;
-SELECT FOUND_ROWS();
-DROP TABLE t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/select_safe.test b/mysql-test/suite/pbxt/t/select_safe.test
deleted file mode 100644
index a0b004696ef..00000000000
--- a/mysql-test/suite/pbxt/t/select_safe.test
+++ /dev/null
@@ -1,99 +0,0 @@
-#
-# test of safe selects
-#
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=4, SQL_MAX_JOIN_SIZE=9;
-create table t1 (a int auto_increment primary key, b char(20));
-insert into t1 values(1,"test");
-SELECT SQL_BUFFER_RESULT * from t1;
-update t1 set b="a" where a=1;
-delete from t1 where a=1;
-insert into t1 values(1,"test"),(2,"test2");
-SELECT SQL_BUFFER_RESULT * from t1 order by a; # PBXT required for consistent result
-update t1 set b="a" where a=1;
-
-# Test MAX_JOIN_SIZE in a fresh table, as insert/delete combination
-# makes PBXT statistics non-deterministic
-create table t2 like t1;
-insert into t2 select * from t1;
-analyze table t2; # PBXT: required to get the correct COUNT(*)
-select 1 from t2 as t1,t2,t2 as t3;
-
-# The following should give errors:
---error 1175
-update t1 set b="a";
---error 1175
-update t1 set b="a" where b="test";
---error 1175
-delete from t1;
---error 1175
-delete from t1 where b="test";
---error 1175
-delete from t1 where a+0=1;
---error 1104
-select 1 from t1,t1 as t2,t1 as t3,t1 as t4,t1 as t5;
-
-# The following should be ok:
-update t1 set b="a" order by a limit 1; # PBXT required for consistent result
-update t1 set b="a" where b="b" order by a limit 2; # PBXT required for consistent result
-delete from t1 where b="test" order by a limit 1; # PBXT required for consistent result
-delete from t1 where a+0=1 order by a limit 2; # PBXT required for consistent result
-
-# Test SQL_BIG_SELECTS
-
-alter table t1 add key b (b);
-SET MAX_JOIN_SIZE=2;
-SELECT @@MAX_JOIN_SIZE, @@SQL_BIG_SELECTS;
-insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a");
---error 1104
-SELECT * from t1 order by a;
-SET SQL_BIG_SELECTS=1;
-SELECT * from t1 order by a;
-SET MAX_JOIN_SIZE=2;
---error 1104
-SELECT * from t1;
-SET MAX_JOIN_SIZE=DEFAULT;
-SELECT * from t1;
-
-#
-# Test MAX_SEEKS_FOR_KEY
-#
-analyze table t1;
-insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a");
-explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
-set MAX_SEEKS_FOR_KEY=1;
-explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
-SET MAX_SEEKS_FOR_KEY=DEFAULT;
-
-drop table t1, t2;
-
-# BUG#8726
-create table t1 (a int);
-insert into t1 values (1),(2),(3),(4),(5);
-insert into t1 select * from t1;
-insert into t1 select * from t1;
-insert into t1 select * from t1;
-
-set local max_join_size=8;
---error 1104
-select * from (select * from t1) x;
-
-set local max_join_size=1;
---error 1104
-select * from (select a.a as aa, b.a as ba from t1 a, t1 b) x;
-
-set local max_join_size=1;
---error 1104
-select * from (select 1 union select 2 union select 3) x;
-drop table t1;
-
-SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, SQL_MAX_JOIN_SIZE=DEFAULT;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/skip_grants.test b/mysql-test/suite/pbxt/t/skip_grants.test
deleted file mode 100644
index 87a8fa88491..00000000000
--- a/mysql-test/suite/pbxt/t/skip_grants.test
+++ /dev/null
@@ -1,114 +0,0 @@
-# This tests not performed with embedded server
--- source include/not_embedded.inc
-
-use test;
-
-#
-# BUG#16777: Can not create trigger nor view w/o definer if --skip-grant-tables
-# specified
-#
-# Also, the following test cases have been moved here:
-# - test that we can create VIEW if privileges check switched off has been
-# moved here;
-# - test that we can create and drop procedure without warnings (BUG#9993);
-# - BUG#17595: "DROP FUNCTION IF EXISTS" crashes server;
-# - BUG#13504: creation view with DEFINER clause if --skip-grant-tables
-#
-
-# Prepare.
-
---disable_warnings
-
-DROP VIEW IF EXISTS v1;
-DROP VIEW IF EXISTS v2;
-DROP VIEW IF EXISTS v3;
-
-DROP TABLE IF EXISTS t1;
-
-DROP PROCEDURE IF EXISTS p1;
-DROP PROCEDURE IF EXISTS p2;
-DROP PROCEDURE IF EXISTS p3;
-
-DROP FUNCTION IF EXISTS f1;
-DROP FUNCTION IF EXISTS f2;
-DROP FUNCTION IF EXISTS f3;
-
---enable_warnings
-
-# Test case.
-
-CREATE TABLE t1(c INT);
-
-# - try to create with implicit definer (definer would be ''@'');
-
-CREATE TRIGGER t1_bi BEFORE INSERT ON t1
- FOR EACH ROW
- SET @a = 1;
-
-CREATE VIEW v1 AS SELECT * FROM t1;
-
-CREATE PROCEDURE p1()
- SELECT 1;
-
-CREATE FUNCTION f1() RETURNS INT
- RETURN 1;
-
-# - try to create with explicit definer;
-
-CREATE DEFINER=a@b TRIGGER ti_ai AFTER INSERT ON t1
- FOR EACH ROW
- SET @b = 1;
-
-CREATE DEFINER=a@b VIEW v2 AS SELECT * FROM t1;
-
-CREATE DEFINER=a@b PROCEDURE p2()
- SELECT 2;
-
-CREATE DEFINER=a@b FUNCTION f2() RETURNS INT
- RETURN 2;
-
-# - try to create with explicit definer with empty host;
-
-CREATE DEFINER=a@'' TRIGGER ti_bu BEFORE UPDATE ON t1
- FOR EACH ROW
- SET @c = 1;
-
-CREATE DEFINER=a@'' VIEW v3 AS SELECT * FROM t1;
-
-CREATE DEFINER=a@'' PROCEDURE p3()
- SELECT 3;
-
-CREATE DEFINER=a@'' FUNCTION f3() RETURNS INT
- RETURN 3;
-
-# - check that empty host name is treated correctly;
-
-SHOW CREATE VIEW v3;
-
-SHOW CREATE PROCEDURE p3;
-
-SHOW CREATE FUNCTION f3;
-
-# Cleanup.
-
-DROP TRIGGER t1_bi;
-DROP TRIGGER ti_ai;
-DROP TRIGGER ti_bu;
-
-DROP VIEW v1;
-DROP VIEW v2;
-DROP VIEW v3;
-
-DROP TABLE t1;
-
-DROP PROCEDURE p1;
-DROP PROCEDURE p2;
-DROP PROCEDURE p3;
-
-DROP FUNCTION f1;
-DROP FUNCTION f2;
-DROP FUNCTION f3;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/skip_name_resolve.test b/mysql-test/suite/pbxt/t/skip_name_resolve.test
deleted file mode 100644
index 3f732c8912b..00000000000
--- a/mysql-test/suite/pbxt/t/skip_name_resolve.test
+++ /dev/null
@@ -1,20 +0,0 @@
-# Can't be tested with embedded server
--- source include/not_embedded.inc
-
-# Bug #8471: IP address with mask fail when skip-name-resolve is on
-GRANT ALL ON test.* TO mysqltest_1@'127.0.0.1/255.255.255.255';
-SHOW GRANTS FOR mysqltest_1@'127.0.0.1/255.255.255.255';
-REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255';
-DROP USER mysqltest_1@'127.0.0.1/255.255.255.255';
-
-# End of 4.1 tests
-
-# Bug #13407 "Remote connecting crashes server".
-# Server crashed when one used USER() function in connection for which
-# was impossible to obtain peer hostname.
-connect (con1, 127.0.0.1, root, , test, $MASTER_MYPORT, );
---replace_column 1 #
-select user();
---replace_column 1 <id> 3 <host> 5 <command> 6 <time> 7 <state> 8 <info>
-show processlist;
-connection default;
diff --git a/mysql-test/suite/pbxt/t/sql_mode.test b/mysql-test/suite/pbxt/t/sql_mode.test
deleted file mode 100644
index 9f5183ce3cb..00000000000
--- a/mysql-test/suite/pbxt/t/sql_mode.test
+++ /dev/null
@@ -1,273 +0,0 @@
---disable_warnings
-drop table if exists t1,t2,v1,v2;
-drop view if exists t1,t2,v1,v2;
---enable_warnings
-
-CREATE TABLE `t1` (
- a int not null auto_increment,
- `pseudo` varchar(35) character set latin2 NOT NULL default '',
- `email` varchar(60) character set latin2 NOT NULL default '',
- PRIMARY KEY (a),
- UNIQUE KEY `email` USING BTREE (`email`)
-) ENGINE=HEAP CHARSET=latin1 ROW_FORMAT DYNAMIC;
-set @@sql_mode="";
-show variables like 'sql_mode';
-show create table t1;
-set @@sql_mode="ansi_quotes";
-show variables like 'sql_mode';
-show create table t1;
-set @@sql_mode="no_table_options";
-show variables like 'sql_mode';
-show create table t1;
-set @@sql_mode="no_key_options";
-show variables like 'sql_mode';
-show create table t1;
-set @@sql_mode="no_field_options,mysql323,mysql40";
-show variables like 'sql_mode';
-show create table t1;
-set sql_mode="postgresql,oracle,mssql,db2,maxdb";
-select @@sql_mode;
-show create table t1;
-drop table t1;
-
-#
-# Check that a binary collation adds 'binary'
-# suffix into a char() column definition in
-# mysql40 and mysql2323 modes. This allows
-# not to lose the column's case sensitivity
-# when loading the dump in pre-4.1 servers.
-#
-# Thus, in 4.0 and 3.23 modes we dump:
-#
-# 'char(10) collate xxx_bin' as 'char(10) binary'
-# 'binary(10)' as 'binary(10)'
-#
-# In mysql-4.1 these types are different, and they will
-# be recreated differently.
-#
-# In mysqld-4.0 the the above two types were the same,
-# so it will create a 'char(10) binary' column for both definitions.
-#
-CREATE TABLE t1 (
- a char(10),
- b char(10) collate latin1_bin,
- c binary(10)
-) character set latin1;
-set @@sql_mode="";
-show create table t1;
-set @@sql_mode="mysql323";
-show create table t1;
-set @@sql_mode="mysql40";
-show create table t1;
-drop table t1;
-
-#
-# BUG#5318 - failure: 'IGNORE_SPACE' affects numeric values after DEFAULT
-#
-# Force the usage of the default
-set session sql_mode = '';
-# statement for comparison, value starts with '.'
-create table t1 ( min_num dec(6,6) default .000001);
-show create table t1;
-drop table t1 ;
-#
-set session sql_mode = 'IGNORE_SPACE';
-# statement for comparison, value starts with '0'
-create table t1 ( min_num dec(6,6) default 0.000001);
-show create table t1;
-drop table t1 ;
-# This statement fails, value starts with '.'
-create table t1 ( min_num dec(6,6) default .000001);
-show create table t1;
-drop table t1 ;
-
-#
-# Bug #10732: Set SQL_MODE to NULL gives garbled error message
-#
---error 1231
-set @@SQL_MODE=NULL;
-
-#
-# Bug #797: in sql_mode=ANSI, show create table ignores auto_increment
-#
-set session sql_mode=ansi;
-create table t1
-(f1 integer auto_increment primary key,
- f2 timestamp default current_timestamp on update current_timestamp);
-show create table t1;
-set session sql_mode=no_field_options;
-show create table t1;
-drop table t1;
-
-# End of 4.1 tests
-
-#
-# test for
-# WL 1941 "NO_C_ESCAPES sql_mode"
-#
-# an sql_mode to disable \n, \r, \b, etc escapes in string literals. actually, to
-# disable special meaning of backslash completely. It's not in the SQL standard
-# and it causes some R/3 tests to fail.
-#
-
-SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE='';
-show local variables like 'SQL_MODE';
-
-CREATE TABLE t1 (p int not null auto_increment, a varchar(20), primary key(p));
-INSERT t1 (a) VALUES
-('\\'),
-('\n'),
-('\b'),
-('\r'),
-('\t'),
-('\x'),
-('\a'),
-('\aa'),
-('\\a'),
-('\\aa'),
-('_'),
-('\_'),
-('\\_'),
-('\\\_'),
-('\\\\_'),
-('%'),
-('\%'),
-('\\%'),
-('\\\%'),
-('\\\\%')
-;
-
-SELECT p, hex(a) FROM t1;
-
-delete from t1 where a in ('\n','\r','\t', '\b');
-
-select
- masks.p,
- masks.a as mask,
- examples.a as example
-from
- t1 as masks
- left join t1 as examples on examples.a LIKE masks.a
-order by masks.p, example;
-
-DROP TABLE t1;
-
-SET @@SQL_MODE='NO_BACKSLASH_ESCAPES';
-show local variables like 'SQL_MODE';
-
-CREATE TABLE t1 (p int not null auto_increment, a varchar(20), primary key(p));
-INSERT t1 (a) VALUES
-('\\'),
-('\n'),
-('\b'),
-('\r'),
-('\t'),
-('\x'),
-('\a'),
-('\aa'),
-('\\a'),
-('\\aa'),
-('_'),
-('\_'),
-('\\_'),
-('\\\_'),
-('\\\\_'),
-('%'),
-('\%'),
-('\\%'),
-('\\\%'),
-('\\\\%')
-;
-
-SELECT p, hex(a) FROM t1;
-
-delete from t1 where a in ('\n','\r','\t', '\b');
-
-select
- masks.p,
- masks.a as mask,
- examples.a as example
-from
- t1 as masks
- left join t1 as examples on examples.a LIKE masks.a
-order by masks.p, example;
-
-DROP TABLE t1;
-
-# Bug #6368: Make sure backslashes mixed with doubled quotes are handled
-# correctly in NO_BACKSLASH_ESCAPES mode
-SET @@SQL_MODE='NO_BACKSLASH_ESCAPES';
-SELECT 'a\\b', 'a\\\"b', 'a''\\b', 'a''\\\"b';
-SELECT "a\\b", "a\\\'b", "a""\\b", "a""\\\'b";
-
-SET @@SQL_MODE='';
-SELECT 'a\\b', 'a\\\"b', 'a''\\b', 'a''\\\"b';
-SELECT "a\\b", "a\\\'b", "a""\\b", "a""\\\'b";
-
-#
-# Bug#6877: MySQL should give an error if the requested table type
-# is not available
-#
-
-#set session sql_mode = 'NO_ENGINE_SUBSTITUTION';
-#--error 1289
-#create table t1 (a int) engine=isam;
-#--error 1146
-#show create table t1;
-#drop table if exists t1;
-#
-## for comparison, lets see the warnings...
-#set session sql_mode = '';
-#create table t1 (a int) engine=isam;
-#show create table t1;
-#drop table t1;
-
-#
-# Bug #6903: ANSI_QUOTES does not come into play with SHOW CREATE FUNCTION
-# or PROCEDURE because it displays the SQL_MODE used to create the routine.
-#
-SET @@SQL_MODE='';
-create function `foo` () returns int return 5;
-show create function `foo`;
-SET @@SQL_MODE='ANSI_QUOTES';
-show create function `foo`;
-drop function `foo`;
-
-create function `foo` () returns int return 5;
-show create function `foo`;
-SET @@SQL_MODE='';
-show create function `foo`;
-drop function `foo`;
-
-#
-# Bug #6903: ANSI_QUOTES should have effect for SHOW CREATE VIEW (Bug #6903)
-#
-SET @@SQL_MODE='';
-create table t1 (a int);
-create table t2 (a int);
-create view v1 as select a from t1;
-show create view v1;
-SET @@SQL_MODE='ANSI_QUOTES';
-show create view v1;
-# Test a view with a subselect, which will get shown incorrectly without
-# thd->lex->view_prepare_mode set properly.
-create view v2 as select a from t2 where a in (select a from v1);
-drop view v2, v1;
-drop table t1, t2;
-
-select @@sql_mode;
-set sql_mode=2097152;
-select @@sql_mode;
-# BUG#14675
-set sql_mode=4194304;
-select @@sql_mode;
-set sql_mode=16384+(65536*4);
-select @@sql_mode;
-set sql_mode=2147483648; # that mode does not exist
-select @@sql_mode;
-
-SET @@SQL_MODE=@OLD_SQL_MODE;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/status.test b/mysql-test/suite/pbxt/t/status.test
deleted file mode 100644
index 4ecb6acfd6f..00000000000
--- a/mysql-test/suite/pbxt/t/status.test
+++ /dev/null
@@ -1,190 +0,0 @@
-# embedded server causes different stat
--- source include/not_embedded.inc
-
-# PS causes different statistics
---disable_ps_protocol
-
-connect (con1,localhost,root,,);
-connect (con2,localhost,root,,);
-
-flush status;
-show status like 'Table_lock%';
-select * from information_schema.session_status where variable_name like 'Table_lock%';
-connection con1;
-SET SQL_LOG_BIN=0;
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1(n int) engine=myisam;
-insert into t1 values(1);
-
-# PBXT: fix for late commit on unlock, see comment in ps.test
-#
-select * from t1;
-connection con2;
-lock tables t1 read;
-unlock tables;
-lock tables t1 read;
-connection con1;
---send
-update t1 set n = 3;
-connection con2;
-sleep 5;
-unlock tables;
-connection con1;
-reap;
-show status like 'Table_lock%';
-select * from information_schema.session_status where variable_name like 'Table_lock%';
-drop table t1;
-
-disconnect con2;
-disconnect con1;
-connection default;
-
-# End of 4.1 tests
-
-#
-# last_query_cost
-#
-
-select 1;
-show status like 'last_query_cost';
-create table t1 (a int);
-insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
-insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
-insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
-insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
-insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
-select * from t1 where a=6;
-show status like 'last_query_cost';
-# Ensure value dosn't change by second status call
-show status like 'last_query_cost';
-select 1;
-show status like 'last_query_cost';
-drop table t1;
-
-#
-# Test for Bug #15933 max_used_connections is wrong after FLUSH STATUS
-# if connections are cached
-#
-#
-# The first suggested fix from the bug report was chosen
-# (see http://bugs.mysql.com/bug.php?id=15933):
-#
-# a) On flushing the status, set max_used_connections to
-# threads_connected, not to 0.
-#
-# b) Check if it is necessary to increment max_used_connections when
-# taking a thread from the cache as well as when creating new threads
-#
-
-# Wait for at most $disconnect_timeout seconds for disconnects to finish.
-let $disconnect_timeout = 10;
-
-# Wait for any previous disconnects to finish.
-FLUSH STATUS;
---disable_query_log
---disable_result_log
-eval SET @wait_left = $disconnect_timeout;
-let $max_used_connections = `SHOW STATUS LIKE 'max_used_connections'`;
-eval SET @max_used_connections = SUBSTRING('$max_used_connections', 21)+0;
-let $wait_more = `SELECT @max_used_connections != 1 && @wait_left > 0`;
-while ($wait_more)
-{
- sleep 1;
- FLUSH STATUS;
- SET @wait_left = @wait_left - 1;
- let $max_used_connections = `SHOW STATUS LIKE 'max_used_connections'`;
- eval SET @max_used_connections = SUBSTRING('$max_used_connections', 21)+0;
- let $wait_more = `SELECT @max_used_connections != 1 && @wait_left > 0`;
-}
---enable_query_log
---enable_result_log
-
-# Prerequisite.
-SHOW STATUS LIKE 'max_used_connections';
-SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
-
-# Save original setting.
-SET @save_thread_cache_size=@@thread_cache_size;
-SET GLOBAL thread_cache_size=3;
-
-connect (con1,localhost,root,,);
-connect (con2,localhost,root,,);
-
-connection con1;
-disconnect con2;
-
-# Check that max_used_connections still reflects maximum value.
-SHOW STATUS LIKE 'max_used_connections';
-SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
-
-# Check that after flush max_used_connections equals to current number
-# of connections. First wait for previous disconnect to finish.
-FLUSH STATUS;
---disable_query_log
---disable_result_log
-eval SET @wait_left = $disconnect_timeout;
-let $max_used_connections = `SHOW STATUS LIKE 'max_used_connections'`;
-eval SET @max_used_connections = SUBSTRING('$max_used_connections', 21)+0;
-let $wait_more = `SELECT @max_used_connections != 2 && @wait_left > 0`;
-while ($wait_more)
-{
- sleep 1;
- FLUSH STATUS;
- SET @wait_left = @wait_left - 1;
- let $max_used_connections = `SHOW STATUS LIKE 'max_used_connections'`;
- eval SET @max_used_connections = SUBSTRING('$max_used_connections', 21)+0;
- let $wait_more = `SELECT @max_used_connections != 2 && @wait_left > 0`;
-}
---enable_query_log
---enable_result_log
-# Check that we don't count disconnected thread any longer.
-SHOW STATUS LIKE 'max_used_connections';
-SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
-
-# Check that max_used_connections is updated when cached thread is
-# reused...
-connect (con2,localhost,root,,);
-SHOW STATUS LIKE 'max_used_connections';
-SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
-
-# ...and when new thread is created.
-connect (con3,localhost,root,,);
-SHOW STATUS LIKE 'max_used_connections';
-SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
-
-# Restore original setting.
-connection default;
-SET GLOBAL thread_cache_size=@save_thread_cache_size;
-
-disconnect con3;
-disconnect con2;
-disconnect con1;
-
-# End of 5.0 tests
-
-#
-# Ensure that SHOW STATUS only changes global status variables
-#
-
-connect (con1,localhost,root,,);
-let $rnd_next = `show global status like 'handler_read_rnd_next'`;
-let $tmp_table = `show global status like 'Created_tmp_tables'`;
-show status like 'com_show_status';
-show status like 'hand%write%';
-show status like '%tmp%';
-show status like 'hand%write%';
-show status like '%tmp%';
-show status like 'com_show_status';
-let $rnd_next2 = `show global status like 'handler_read_rnd_next'`;
-let $tmp_table2 = `show global status like 'Created_tmp_tables'`;
---disable_query_log
-eval select substring_index('$rnd_next2',0x9,-1)-substring_index('$rnd_next',0x9,-1) as rnd_diff, substring_index('$tmp_table2',0x9,-1)-substring_index('$tmp_table',0x9,-1) as tmp_table_diff;
---enable_query_log
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 5.1 tests
diff --git a/mysql-test/suite/pbxt/t/subselect.test b/mysql-test/suite/pbxt/t/subselect.test
deleted file mode 100644
index 3b49dfdebca..00000000000
--- a/mysql-test/suite/pbxt/t/subselect.test
+++ /dev/null
@@ -1,3241 +0,0 @@
-# Initialise
---disable_warnings
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t11,t12;
---enable_warnings
-
-select (select 2);
-explain extended select (select 2);
-SELECT (SELECT 1) UNION SELECT (SELECT 2);
-explain extended SELECT (SELECT 1) UNION SELECT (SELECT 2);
-SELECT (SELECT (SELECT 0 UNION SELECT 0));
-explain extended SELECT (SELECT (SELECT 0 UNION SELECT 0));
--- error 1247
-SELECT (SELECT 1 FROM (SELECT 1) as b HAVING a=1) as a;
--- error 1247
-SELECT (SELECT 1 FROM (SELECT 1) as b HAVING b=1) as a,(SELECT 1 FROM (SELECT 1) as c HAVING a=1) as b;
-SELECT (SELECT 1),MAX(1) FROM (SELECT 1) as a;
--- error 1247
-SELECT (SELECT a) as a;
-EXPLAIN EXTENDED SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1;
-SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1;
--- error 1054
-SELECT (SELECT 1), a;
-SELECT 1 as a FROM (SELECT 1) as b HAVING (SELECT a)=1;
--- error 1054
-SELECT 1 FROM (SELECT (SELECT a) b) c;
-SELECT * FROM (SELECT 1 as id) b WHERE id IN (SELECT * FROM (SELECT 1 as id) c ORDER BY id);
--- error 1241
-SELECT * FROM (SELECT 1) a WHERE 1 IN (SELECT 1,1);
-SELECT 1 IN (SELECT 1);
-SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a));
--- error ER_WRONG_USAGE
-select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1));
--- error ER_WRONG_PARAMETERS_TO_PROCEDURE
-SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1));
--- error ER_BAD_FIELD_ERROR
-SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL;
--- error ER_BAD_FIELD_ERROR
-SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL;
-SELECT (SELECT 1,2,3) = ROW(1,2,3);
-SELECT (SELECT 1,2,3) = ROW(1,2,1);
-SELECT (SELECT 1,2,3) < ROW(1,2,1);
-SELECT (SELECT 1,2,3) > ROW(1,2,1);
-SELECT (SELECT 1,2,3) = ROW(1,2,NULL);
-SELECT ROW(1,2,3) = (SELECT 1,2,3);
-SELECT ROW(1,2,3) = (SELECT 1,2,1);
-SELECT ROW(1,2,3) < (SELECT 1,2,1);
-SELECT ROW(1,2,3) > (SELECT 1,2,1);
-SELECT ROW(1,2,3) = (SELECT 1,2,NULL);
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a');
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b');
-SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b');
-SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a');
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a');
-SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a');
-
--- error 1241
-SELECT (SELECT * FROM (SELECT 'test' a,'test' b) a);
-
-SELECT 1 as a,(SELECT a+a) b,(SELECT b);
-
-create table t1 (a int);
-create table t2 (a int, b int);
-create table t3 (a int);
-create table t4 (a int not null, b int not null);
-insert into t1 values (2);
-insert into t2 values (1,7),(2,7);
-insert into t4 values (4,8),(3,8),(5,9);
--- error 1247
-select (select a from t1 where t1.a = a1) as a2, (select b from t2 where t2.b=a2) as a1;
-select (select a from t1 where t1.a=t2.a), a from t2;
-select (select a from t1 where t1.a=t2.b), a from t2;
-select (select a from t1), a, (select 1 union select 2 limit 1) from t2;
-select (select a from t3), a from t2;
-select * from t2 where t2.a=(select a from t1);
-insert into t3 values (6),(7),(3);
-select * from t2 where t2.b=(select a from t3 order by 1 desc limit 1);
-(select * from t2 where t2.b=(select a from t3 order by 1 desc limit 1)) union (select * from t4 order by a limit 2) limit 3;
-(select * from t2 where t2.b=(select a from t3 order by 1 desc limit 1)) union (select * from t4 where t4.b=(select max(t2.a)*4 from t2) order by a);
-explain extended (select * from t2 where t2.b=(select a from t3 order by 1 desc limit 1)) union (select * from t4 where t4.b=(select max(t2.a)*4 from t2) order by a);
-select (select a from t3 where a<t2.a*4 order by 1 desc limit 1), a from t2;
-select (select t3.a from t3 where a<8 order by 1 desc limit 1), a from
-(select * from t2 where a>1) as tt;
-set @tmp_optimizer_switch=@@optimizer_switch;
-set optimizer_switch='derived_merge=off,derived_with_keys=off';
-explain extended select (select t3.a from t3 where a<8 order by 1 desc limit 1), a from
-(select * from t2 where a>1) as tt;
-set optimizer_switch=@tmp_optimizer_switch;
-select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1);
-select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3 where t3.a > t1.a) order by 1 desc limit 1);
-select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3 where t3.a < t1.a) order by 1 desc limit 1);
-select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4;
-explain extended select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4;
-select * from t3 where exists (select * from t2 where t2.b=t3.a);
-select * from t3 where not exists (select * from t2 where t2.b=t3.a);
-select * from t3 where a in (select b from t2);
-select * from t3 where a not in (select b from t2);
-select * from t3 where a = some (select b from t2);
-select * from t3 where a <> any (select b from t2);
-
-# Rewrite: select * from t3 where not exists (select b from t2 where a <> b);
-select * from t3 where a = all (select b from t2);
-
-select * from t3 where a <> all (select b from t2);
-insert into t2 values (100, 5);
-select * from t3 where a < any (select b from t2);
-select * from t3 where a < all (select b from t2);
-select * from t3 where a >= any (select b from t2);
-explain extended select * from t3 where a >= any (select b from t2);
-select * from t3 where a >= all (select b from t2);
-delete from t2 where a=100;
--- error 1241
-select * from t3 where a in (select a,b from t2);
--- error 1241
-select * from t3 where a in (select * from t2);
-insert into t4 values (12,7),(1,7),(10,9),(9,6),(7,6),(3,9),(1,10);
-# empty set
-select b,max(a) as ma from t4 group by b having b < (select max(t2.a) from t2 where t2.b=t4.b);
-insert into t2 values (2,10);
-select b,max(a) as ma from t4 group by b having ma < (select max(t2.a) from t2 where t2.b=t4.b);
-delete from t2 where a=2 and b=10;
-select b,max(a) as ma from t4 group by b having b >= (select max(t2.a) from t2 where t2.b=t4.b);
-create table t5 (a int);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
-insert into t5 values (5);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
-insert into t5 values (2);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
---replace_column 9 #
-explain extended select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
--- error 1242
-select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
-create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq));
-create table t7( uq int primary key, name char(25));
-insert into t7 values(1,"Oblastnaia bolnitsa"),(2,"Bolnitsa Krasnogo Kresta");
-insert into t6 values (1,1),(1,2),(2,2),(1,3);
-select * from t6 where exists (select * from t7 where uq = clinic_uq);
-explain extended select * from t6 where exists (select * from t7 where uq = clinic_uq);
-
-# not unique fields
--- error 1052
-select * from t1 where a= (select a from t2,t4 where t2.b=t4.b);
-
-# different tipes & group functions
-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');
-INSERT INTO t2 VALUES ('W','1'),('A','3'),('J','2');
-CREATE TABLE t1 (a varchar(20),b date NOT NULL default '0000-00-00');
-INSERT INTO t1 VALUES ('W','1732-02-22'),('A','1735-10-30'),('J','1743-04-13');
-SELECT * FROM t1 WHERE b = (SELECT MIN(b) FROM t1);
-SELECT * FROM t2 WHERE b = (SELECT MIN(b) FROM t2);
-SELECT * FROM t3 WHERE b = (SELECT MIN(b) FROM t3);
-
-CREATE TABLE `t8` (
- `pseudo` varchar(35) character set latin1 NOT NULL default '',
- `email` varchar(60) character set latin1 NOT NULL default '',
- PRIMARY KEY (`pseudo`),
- UNIQUE KEY `email` (`email`)
-) ENGINE=MyISAM CHARSET=latin1 ROW_FORMAT=DYNAMIC;
-
-INSERT INTO t8 (pseudo,email) VALUES ('joce','test');
-INSERT INTO t8 (pseudo,email) VALUES ('joce1','test1');
-INSERT INTO t8 (pseudo,email) VALUES ('2joce1','2test1');
-EXPLAIN EXTENDED SELECT pseudo,(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce')) FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce');
--- error 1241
-SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo,email FROM
-t8 WHERE pseudo='joce');
--- error 1241
-SELECT pseudo FROM t8 WHERE pseudo=(SELECT * FROM t8 WHERE
-pseudo='joce');
-SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce');
--- error 1242
-SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo LIKE '%joce%');
-
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8;
-
-#searchconthardwarefr3 forumconthardwarefr7
-CREATE TABLE `t1` (
- `topic` mediumint(8) unsigned NOT NULL default '0',
- `date` date NOT NULL default '0000-00-00',
- `pseudo` varchar(35) character set latin1 NOT NULL default '',
- PRIMARY KEY (`pseudo`,`date`,`topic`),
- KEY `topic` (`topic`)
-) ENGINE=MyISAM ROW_FORMAT=DYNAMIC;
-INSERT INTO t1 (topic,date,pseudo) VALUES
-('43506','2002-10-02','joce'),('40143','2002-08-03','joce');
-EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
-EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03');
-SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
-SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03');
-SELECT 1 FROM t1 WHERE 1=(SELECT 1 UNION SELECT 1) UNION ALL SELECT 1;
--- error 1242
-SELECT 1 FROM t1 WHERE 1=(SELECT 1 UNION ALL SELECT 1) UNION SELECT 1;
-EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1=(SELECT 1 UNION SELECT 1);
-drop table t1;
-
-#forumconthardwarefr7 searchconthardwarefr7
-CREATE TABLE `t1` (
- `numeropost` mediumint(8) unsigned NOT NULL auto_increment,
- `maxnumrep` int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (`numeropost`),
- UNIQUE KEY `maxnumrep` (`maxnumrep`)
-) ENGINE=MyISAM ROW_FORMAT=FIXED;
-
-INSERT INTO t1 (numeropost,maxnumrep) VALUES (40143,1),(43506,2);
-
-CREATE TABLE `t2` (
- `mot` varchar(30) NOT NULL default '',
- `topic` mediumint(8) unsigned NOT NULL default '0',
- `date` date NOT NULL default '0000-00-00',
- `pseudo` varchar(35) NOT NULL default '',
- PRIMARY KEY (`mot`,`pseudo`,`date`,`topic`)
- ) ENGINE=MyISAM ROW_FORMAT=DYNAMIC;
-
-INSERT INTO t2 (mot,topic,date,pseudo) VALUES ('joce','40143','2002-10-22','joce'), ('joce','43506','2002-10-22','joce');
-select numeropost as a FROM t1 GROUP BY (SELECT 1 FROM t1 HAVING a=1);
-SELECT numeropost,maxnumrep FROM t1 WHERE exists (SELECT 1 FROM t2 WHERE (mot='joce') AND date >= '2002-10-21' AND t1.numeropost = t2.topic) ORDER BY maxnumrep DESC LIMIT 0, 20;
--- error 1054
-SELECT (SELECT 1) as a FROM (SELECT 1 FROM t1 HAVING a=1) b;
--- error 1054
-SELECT 1 IN (SELECT 1 FROM t2 HAVING a);
-
-SELECT * from t2 where topic IN (SELECT topic FROM t2 GROUP BY topic);
-SELECT * from t2 where topic IN (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100);
-SELECT * from t2 where topic IN (SELECT SUM(topic) FROM t1);
-SELECT * from t2 where topic = any (SELECT topic FROM t2 GROUP BY topic);
-SELECT * from t2 where topic = any (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100);
-SELECT * from t2 where topic = any (SELECT SUM(topic) FROM t1);
-SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic);
-SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100);
-SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) from t2;
-SELECT * from t2 where topic = all (SELECT SUM(topic) FROM t2);
-SELECT * from t2 where topic <> any (SELECT SUM(topic) FROM t2);
-SELECT * from t2 where topic IN (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000);
-SELECT * from t2 where topic = any (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000);
-SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000);
-SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) from t2;
-drop table t1,t2;
-
-#forumconthardwarefr7
-CREATE TABLE `t1` (
- `numeropost` mediumint(8) unsigned NOT NULL auto_increment,
- `maxnumrep` int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (`numeropost`),
- UNIQUE KEY `maxnumrep` (`maxnumrep`)
-) ENGINE=MyISAM ROW_FORMAT=FIXED;
-
-INSERT INTO t1 (numeropost,maxnumrep) VALUES (1,0),(2,1);
--- error 1242
-select numeropost as a FROM t1 GROUP BY (SELECT 1 FROM t1 HAVING a=1);
--- error 1242
-select numeropost as a FROM t1 ORDER BY (SELECT 1 FROM t1 HAVING a=1);
-drop table t1;
-
-create table t1 (a int);
-insert into t1 values (1),(2),(3);
-(select * from t1) union (select * from t1) order by (select a from t1 limit 1);
-drop table t1;
-
-#iftest
-CREATE TABLE t1 (field char(1) NOT NULL DEFAULT 'b');
-INSERT INTO t1 VALUES ();
--- error 1242
-SELECT field FROM t1 WHERE 1=(SELECT 1 UNION ALL SELECT 1 FROM (SELECT 1) a HAVING field='b');
-drop table t1;
-
-# threadhardwarefr7
-CREATE TABLE `t1` (
- `numeropost` mediumint(8) unsigned NOT NULL default '0',
- `numreponse` int(10) unsigned NOT NULL auto_increment,
- `pseudo` varchar(35) NOT NULL default '',
- PRIMARY KEY (`numeropost`,`numreponse`),
- UNIQUE KEY `numreponse` (`numreponse`),
- KEY `pseudo` (`pseudo`,`numeropost`)
-) ENGINE=MyISAM;
--- error 1247
-SELECT (SELECT numeropost FROM t1 HAVING numreponse=a),numreponse FROM (SELECT * FROM t1) as a;
--- error 1054
-SELECT numreponse, (SELECT numeropost FROM t1 HAVING numreponse=a) FROM (SELECT * FROM t1) as a;
-SELECT numreponse, (SELECT numeropost FROM t1 HAVING numreponse=1) FROM (SELECT * FROM t1) as a;
-INSERT INTO t1 (numeropost,numreponse,pseudo) VALUES (1,1,'joce'),(1,2,'joce'),(1,3,'test');
-EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT 1 FROM t1 WHERE numeropost='1');
--- error 1242
-SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT 1 FROM t1 WHERE numeropost='1');
-EXPLAIN EXTENDED SELECT MAX(numreponse) FROM t1 WHERE numeropost='1';
-EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1');
-drop table t1;
-
-CREATE TABLE t1 (a int(1));
-INSERT INTO t1 VALUES (1);
-SELECT 1 FROM (SELECT a FROM t1) b HAVING (SELECT b.a)=1;
-drop table t1;
-
-#update with subselects
-create table t1 (a int NOT NULL, b int, primary key (a));
-create table t2 (a int NOT NULL, b int, primary key (a));
-insert into t1 values (0, 10),(1, 11),(2, 12);
-insert into t2 values (1, 21),(2, 22),(3, 23);
-select * from t1;
--- error 1093
-update t1 set b= (select b from t1);
--- error 1242
-update t1 set b= (select b from t2);
-update t1 set b= (select b from t2 where t1.a = t2.a);
-select * from t1;
-drop table t1, t2;
-
-#delete with subselects
-create table t1 (a int NOT NULL, b int, primary key (a));
-create table t2 (a int NOT NULL, b int, primary key (a));
-insert into t1 values (0, 10),(1, 11),(2, 12);
-insert into t2 values (1, 21),(2, 12),(3, 23);
-select * from t1;
-select * from t1 where b = (select b from t2 where t1.a = t2.a);
--- error 1093
-delete from t1 where b = (select b from t1);
--- error 1242
-delete from t1 where b = (select b from t2);
-delete from t1 where b = (select b from t2 where t1.a = t2.a);
-select * from t1;
-drop table t1, t2;
-
-#multi-delete with subselects
-
-create table t11 (a int NOT NULL, b int, primary key (a));
-create table t12 (a int NOT NULL, b int, primary key (a));
-create table t2 (a int NOT NULL, b int, primary key (a));
-insert into t11 values (0, 10),(1, 11),(2, 12);
-insert into t12 values (33, 10),(22, 11),(2, 12);
-insert into t2 values (1, 21),(2, 12),(3, 23);
-select * from t11;
-select * from t12;
--- error 1093
-delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t12 where t11.a = t12.a);
--- error 1242
-delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2);
-delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2 where t11.a = t2.a);
-select * from t11;
-select * from t12;
-drop table t11, t12, t2;
-
-#insert with subselects
-CREATE TABLE t1 (x int);
-create table t2 (a int);
-create table t3 (b int);
-insert into t2 values (1);
-insert into t3 values (1),(2);
--- error 1093
-INSERT INTO t1 (x) VALUES ((SELECT x FROM t1));
--- error 1242
-INSERT INTO t1 (x) VALUES ((SELECT b FROM t3));
-INSERT INTO t1 (x) VALUES ((SELECT a FROM t2));
-select * from t1;
-insert into t2 values (1);
-# PBXT: DELAYED not supported
-#INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(a) FROM t2));
-INSERT INTO t1 (x) VALUES ((SELECT SUM(a) FROM t2));
--- sleep 1
-select * from t1;
-INSERT INTO t1 (x) select (SELECT SUM(a)+1 FROM t2) FROM t2;
-select * from t1;
-# After this, only data based on old t1 records should have been added.
-INSERT INTO t1 (x) select (SELECT SUM(x)+2 FROM t1) FROM t2;
-select * from t1;
--- error 1054
-# PBXT: DELAYED not supported
-#INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(x) FROM t2));
-INSERT INTO t1 (x) VALUES ((SELECT SUM(x) FROM t2));
-#INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(a) FROM t2));
-INSERT INTO t1 (x) VALUES ((SELECT SUM(a) FROM t2));
--- sleep 1
-select * from t1;
-#
-#TODO: should be uncommented after bug 380 fix pushed
-#INSERT INTO t1 (x) SELECT (SELECT SUM(a)+b FROM t2) from t3;
-#select * from t1;
-drop table t1, t2, t3;
-
-#replace with subselects
-CREATE TABLE t1 (x int not null, y int, primary key (x));
-create table t2 (a int);
-create table t3 (a int);
-insert into t2 values (1);
-insert into t3 values (1),(2);
-select * from t1;
--- error 1093
-replace into t1 (x, y) VALUES ((SELECT x FROM t1), (SELECT a+1 FROM t2));
--- error 1242
-replace into t1 (x, y) VALUES ((SELECT a FROM t3), (SELECT a+1 FROM t2));
-replace into t1 (x, y) VALUES ((SELECT a FROM t2), (SELECT a+1 FROM t2));
-select * from t1;
-replace into t1 (x, y) VALUES ((SELECT a FROM t2), (SELECT a+2 FROM t2));
-select * from t1;
-# PBXT: DELAYED not supported
-#replace DELAYED into t1 (x, y) VALUES ((SELECT a+3 FROM t2), (SELECT a FROM t2));
-replace into t1 (x, y) VALUES ((SELECT a+3 FROM t2), (SELECT a FROM t2));
--- sleep 1
-select * from t1 order by x; # PBXT required for consistent order
-# PBXT: DELAYED not supported
-#replace DELAYED into t1 (x, y) VALUES ((SELECT a+3 FROM t2), (SELECT a+1 FROM t2));
-replace into t1 (x, y) VALUES ((SELECT a+3 FROM t2), (SELECT a+1 FROM t2));
--- sleep 1
-select * from t1 order by x; # PBXT required for consistent order
-replace LOW_PRIORITY into t1 (x, y) VALUES ((SELECT a+1 FROM t2), (SELECT a FROM t2));
-select * from t1 order by x; # PBXT required for consistent order
-drop table t1, t2, t3;
-
--- error 1096
-SELECT * FROM (SELECT 1) b WHERE 1 IN (SELECT *);
-
-CREATE TABLE t2 (id int(11) default NULL, KEY id (id)) ENGINE=MyISAM CHARSET=latin1;
-INSERT INTO t2 VALUES (1),(2);
-SELECT * FROM t2 WHERE id IN (SELECT 1);
-EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1);
-SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3);
-SELECT * FROM t2 WHERE id IN (SELECT 1+(select 1));
-EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1+(select 1));
-EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3);
-SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 3);
-SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 2);
--- error 1093
-INSERT INTO t2 VALUES ((SELECT * FROM t2));
--- error 1093
-INSERT INTO t2 VALUES ((SELECT id FROM t2));
-SELECT * FROM t2;
-CREATE TABLE t1 (id int(11) default NULL, KEY id (id)) ENGINE=MyISAM CHARSET=latin1;
-INSERT INTO t1 values (1),(1);
--- error 1242
-UPDATE t2 SET id=(SELECT * FROM t1);
-drop table t2, t1;
-
-#NULL test
-create table t1 (a int);
-insert into t1 values (1),(2),(3);
-select 1 IN (SELECT * from t1);
-select 10 IN (SELECT * from t1);
-select NULL IN (SELECT * from t1);
-update t1 set a=NULL where a=2;
-select 1 IN (SELECT * from t1);
-select 3 IN (SELECT * from t1);
-select 10 IN (SELECT * from t1);
-select 1 > ALL (SELECT * from t1);
-select 10 > ALL (SELECT * from t1);
-select 1 > ANY (SELECT * from t1);
-select 10 > ANY (SELECT * from t1);
-drop table t1;
-create table t1 (a varchar(20));
-insert into t1 values ('A'),('BC'),('DEF');
-select 'A' IN (SELECT * from t1);
-select 'XYZS' IN (SELECT * from t1);
-select NULL IN (SELECT * from t1);
-update t1 set a=NULL where a='BC';
-select 'A' IN (SELECT * from t1);
-select 'DEF' IN (SELECT * from t1);
-select 'XYZS' IN (SELECT * from t1);
-select 'A' > ALL (SELECT * from t1);
-select 'XYZS' > ALL (SELECT * from t1);
-select 'A' > ANY (SELECT * from t1);
-select 'XYZS' > ANY (SELECT * from t1);
-drop table t1;
-create table t1 (a float);
-insert into t1 values (1.5),(2.5),(3.5);
-select 1.5 IN (SELECT * from t1);
-select 10.5 IN (SELECT * from t1);
-select NULL IN (SELECT * from t1);
-update t1 set a=NULL where a=2.5;
-select 1.5 IN (SELECT * from t1);
-select 3.5 IN (SELECT * from t1);
-select 10.5 IN (SELECT * from t1);
-select 1.5 > ALL (SELECT * from t1);
-select 10.5 > ALL (SELECT * from t1);
-select 1.5 > ANY (SELECT * from t1);
-select 10.5 > ANY (SELECT * from t1);
-explain extended select (select a+1) from t1;
-select (select a+1) from t1;
-drop table t1;
-
-#
-# Null with keys
-#
-
-set @save_optimizer_switch=@@optimizer_switch;
-set @@optimizer_switch="partial_match_rowid_merge=off,partial_match_table_scan=off";
-
-CREATE TABLE t1 (a int(11) NOT NULL default '0', PRIMARY KEY (a));
-CREATE TABLE t2 (a int(11) default '0', INDEX (a));
-INSERT INTO t1 VALUES (1),(2),(3),(4);
-INSERT INTO t2 VALUES (1),(2),(3);
-SELECT t1.a, t1.a in (select t2.a from t2) FROM t1;
-explain extended SELECT t1.a, t1.a in (select t2.a from t2) FROM t1;
-CREATE TABLE t3 (a int(11) default '0');
-INSERT INTO t3 VALUES (1),(2),(3);
-SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1;
-explain extended SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1;
-drop table t1,t2,t3;
-
-#LIMIT is not supported now
-create table t1 (a float);
--- error 1235
-select 10.5 IN (SELECT * from t1 LIMIT 1);
--- error 1235
-select 10.5 IN (SELECT * from t1 LIMIT 1 UNION SELECT 1.5);
-drop table t1;
-
-create table t1 (a int, b int, c varchar(10));
-create table t2 (a int);
-insert into t1 values (1,2,'a'),(2,3,'b'),(3,4,'c');
-insert into t2 values (1),(2),(NULL);
-select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a'),(select c from t1 where a=t2.a) from t2;
-select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b'),(select c from t1 where a=t2.a) from t2;
-select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c'),(select c from t1 where a=t2.a) from t2;
-drop table t1,t2;
-
-create table t1 (a int, b real, c varchar(10));
-insert into t1 values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b');
-select ROW(1, 1, 'a') IN (select a,b,c from t1);
-select ROW(1, 2, 'a') IN (select a,b,c from t1);
-select ROW(1, 1, 'a') IN (select b,a,c from t1);
-select ROW(1, 1, 'a') IN (select a,b,c from t1 where a is not null);
-select ROW(1, 2, 'a') IN (select a,b,c from t1 where a is not null);
-select ROW(1, 1, 'a') IN (select b,a,c from t1 where a is not null);
-select ROW(1, 1, 'a') IN (select a,b,c from t1 where c='b' or c='a');
-select ROW(1, 2, 'a') IN (select a,b,c from t1 where c='b' or c='a');
-select ROW(1, 1, 'a') IN (select b,a,c from t1 where c='b' or c='a');
--- error 1235
-select ROW(1, 1, 'a') IN (select b,a,c from t1 limit 2);
-drop table t1;
-
-#
-# DO & SET
-#
-create table t1 (a int);
-insert into t1 values (1);
-do @a:=(SELECT a from t1);
-select @a;
-set @a:=2;
-set @a:=(SELECT a from t1);
-select @a;
-drop table t1;
--- error 1146
-do (SELECT a from t1);
--- error 1146
-set @a:=(SELECT a from t1);
-
-CREATE TABLE t1 (a int, KEY(a));
-HANDLER t1 OPEN;
--- error 1064
-HANDLER t1 READ a=((SELECT 1));
-HANDLER t1 CLOSE;
-drop table t1;
-
-create table t1 (a int);
-create table t2 (b int);
-insert into t1 values (1),(2);
-insert into t2 values (1);
-select a from t1 where a in (select a from t1 where a in (select b from t2));
-drop table t1, t2;
-
-create table t1 (a int, b int);
-create table t2 like t1;
-insert into t1 values (1,2),(1,3),(1,4),(1,5);
-insert into t2 values (1,2),(1,3);
-select * from t1 where row(a,b) in (select a,b from t2);
-drop table t1, t2;
-
-CREATE TABLE `t1` (`i` int(11) NOT NULL default '0',PRIMARY KEY (`i`)) ENGINE=MyISAM CHARSET=latin1;
-INSERT INTO t1 VALUES (1);
-UPDATE t1 SET i=i+1 WHERE i=(SELECT MAX(i));
-select * from t1;
-drop table t1;
-
-#test of uncacheable subqueries
-CREATE TABLE t1 (a int(1));
-EXPLAIN EXTENDED SELECT (SELECT RAND() FROM t1) FROM t1;
-EXPLAIN EXTENDED SELECT (SELECT ENCRYPT('test') FROM t1) FROM t1;
-EXPLAIN EXTENDED SELECT (SELECT BENCHMARK(1,1) FROM t1) FROM t1;
-drop table t1;
-
-
-CREATE TABLE `t1` (
- `mot` varchar(30) character set latin1 NOT NULL default '',
- `topic` mediumint(8) unsigned NOT NULL default '0',
- `date` date NOT NULL default '0000-00-00',
- `pseudo` varchar(35) character set latin1 NOT NULL default '',
- PRIMARY KEY (`mot`,`pseudo`,`date`,`topic`),
- KEY `pseudo` (`pseudo`,`date`,`topic`),
- KEY `topic` (`topic`)
-) ENGINE=MyISAM CHARSET=latin1 ROW_FORMAT=DYNAMIC;
-
-CREATE TABLE `t2` (
- `mot` varchar(30) character set latin1 NOT NULL default '',
- `topic` mediumint(8) unsigned NOT NULL default '0',
- `date` date NOT NULL default '0000-00-00',
- `pseudo` varchar(35) character set latin1 NOT NULL default '',
- PRIMARY KEY (`mot`,`pseudo`,`date`,`topic`),
- KEY `pseudo` (`pseudo`,`date`,`topic`),
- KEY `topic` (`topic`)
-) ENGINE=MyISAM CHARSET=latin1 ROW_FORMAT=DYNAMIC;
-
-CREATE TABLE `t3` (
- `numeropost` mediumint(8) unsigned NOT NULL auto_increment,
- `maxnumrep` int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (`numeropost`),
- UNIQUE KEY `maxnumrep` (`maxnumrep`)
-) ENGINE=MyISAM CHARSET=latin1;
-INSERT INTO t1 VALUES ('joce','1','','joce'),('test','2','','test');
-
-INSERT INTO t2 VALUES ('joce','1','','joce'),('test','2','','test');
-
-INSERT INTO t3 VALUES (1,1);
-
-SELECT DISTINCT topic FROM t2 WHERE NOT EXISTS(SELECT * FROM t3 WHERE
-numeropost=topic);
-select * from t1;
-DELETE FROM t1 WHERE topic IN (SELECT DISTINCT topic FROM t2 WHERE NOT
-EXISTS(SELECT * FROM t3 WHERE numeropost=topic));
-select * from t1;
-
-drop table t1, t2, t3;
-
-SELECT * FROM (SELECT 1 as a,(SELECT a)) a;
-CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT 1)) a;
-SHOW CREATE TABLE t1;
-drop table t1;
-CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a)) a;
-SHOW CREATE TABLE t1;
-drop table t1;
-CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a+0)) a;
-SHOW CREATE TABLE t1;
-drop table t1;
-CREATE TABLE t1 SELECT (SELECT 1 as a UNION SELECT 1+1 limit 1,1) as a;
-select * from t1;
-SHOW CREATE TABLE t1;
-drop table t1;
-
-create table t1 (a int);
-insert into t1 values (1), (2), (3);
-explain extended select a,(select (select rand() from t1 limit 1) from t1 limit 1)
-from t1;
-drop table t1;
-
-#
-# error in IN
-#
--- error 1146
-select t1.Continent, t2.Name, t2.Population from t1 LEFT JOIN t2 ON t1.Code = t2.Country where t2.Population IN (select max(t2.Population) AS Population from t2, t1 where t2.Country = t1.Code group by Continent);
-
-#
-# complex subquery
-#
-
-CREATE TABLE t1 (
- ID int(11) NOT NULL auto_increment,
- name char(35) NOT NULL default '',
- t2 char(3) NOT NULL default '',
- District char(20) NOT NULL default '',
- Population int(11) NOT NULL default '0',
- PRIMARY KEY (ID)
-) ENGINE=MyISAM;
-
-INSERT INTO t1 VALUES (130,'Sydney','AUS','New South Wales',3276207);
-INSERT INTO t1 VALUES (131,'Melbourne','AUS','Victoria',2865329);
-INSERT INTO t1 VALUES (132,'Brisbane','AUS','Queensland',1291117);
-
-CREATE TABLE t2 (
- Code char(3) NOT NULL default '',
- Name char(52) NOT NULL default '',
- Continent enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America') NOT NULL default 'Asia',
- Region char(26) NOT NULL default '',
- SurfaceArea float(10,2) NOT NULL default '0.00',
- IndepYear smallint(6) default NULL,
- Population int(11) NOT NULL default '0',
- LifeExpectancy float(3,1) default NULL,
- GNP float(10,2) default NULL,
- GNPOld float(10,2) default NULL,
- LocalName char(45) NOT NULL default '',
- GovernmentForm char(45) NOT NULL default '',
- HeadOfState char(60) default NULL,
- Capital int(11) default NULL,
- Code2 char(2) NOT NULL default '',
- PRIMARY KEY (Code)
-) ENGINE=MyISAM;
-
-INSERT INTO t2 VALUES ('AUS','Australia','Oceania','Australia and New Zealand',7741220.00,1901,18886000,79.8,351182.00,392911.00,'Australia','Constitutional Monarchy, Federation','Elisabeth II',135,'AU');
-INSERT INTO t2 VALUES ('AZE','Azerbaijan','Asia','Middle East',86600.00,1991,7734000,62.9,4127.00,4100.00,'Azärbaycan','Federal Republic','Heydär Äliyev',144,'AZ');
-
-select t2.Continent, t1.Name, t1.Population from t2 LEFT JOIN t1 ON t2.Code = t1.t2 where t1.Population IN (select max(t1.Population) AS Population from t1, t2 where t1.t2 = t2.Code group by Continent);
-
-drop table t1, t2;
-
-#
-# constants in IN
-#
-CREATE TABLE `t1` (
- `id` mediumint(8) unsigned NOT NULL auto_increment,
- `pseudo` varchar(35) character set latin1 NOT NULL default '',
- PRIMARY KEY (`id`),
- UNIQUE KEY `pseudo` (`pseudo`)
-) ENGINE=MyISAM PACK_KEYS=1 ROW_FORMAT=DYNAMIC;
-INSERT INTO t1 (pseudo) VALUES ('test');
-SELECT 0 IN (SELECT 1 FROM t1 a);
-EXPLAIN EXTENDED SELECT 0 IN (SELECT 1 FROM t1 a);
-INSERT INTO t1 (pseudo) VALUES ('test1');
-SELECT 0 IN (SELECT 1 FROM t1 a);
-EXPLAIN EXTENDED SELECT 0 IN (SELECT 1 FROM t1 a);
-drop table t1;
-
-CREATE TABLE `t1` (
- `i` int(11) NOT NULL default '0',
- PRIMARY KEY (`i`)
-) ENGINE=MyISAM CHARSET=latin1;
-
-INSERT INTO t1 VALUES (1);
-UPDATE t1 SET i=i+(SELECT MAX(i) FROM (SELECT 1) t) WHERE i=(SELECT MAX(i));
-UPDATE t1 SET i=i+1 WHERE i=(SELECT MAX(i));
--- error 1054
-UPDATE t1 SET t.i=i+(SELECT MAX(i) FROM (SELECT 1) t);
-select * from t1;
-drop table t1;
-
-#
-# Multi update test
-#
-CREATE TABLE t1 (
- id int(11) default NULL
-) ENGINE=MyISAM CHARSET=latin1;
-INSERT INTO t1 VALUES (1),(1),(2),(2),(1),(3);
-CREATE TABLE t2 (
- id int(11) default NULL,
- name varchar(15) default NULL
-) ENGINE=MyISAM CHARSET=latin1;
-
-INSERT INTO t2 VALUES (4,'vita'), (1,'vita'), (2,'vita'), (1,'vita');
-update t1, t2 set t2.name='lenka' where t2.id in (select id from t1);
-select * from t2;
-drop table t1,t2;
-
-#
-# correct NULL in <CONSTANT> IN (SELECT ...)
-#
-create table t1 (a int, unique index indexa (a));
-insert into t1 values (-1), (-4), (-2), (NULL);
-select -10 IN (select a from t1 FORCE INDEX (indexa));
-drop table t1;
-
-#
-# Test optimization for sub selects
-#
-create table t1 (id int not null auto_increment primary key, salary int, key(salary));
-insert into t1 (salary) values (100),(1000),(10000),(10),(500),(5000),(50000);
-explain extended SELECT id FROM t1 where salary = (SELECT MAX(salary) FROM t1);
-drop table t1;
-
-CREATE TABLE t1 (
- ID int(10) unsigned NOT NULL auto_increment,
- SUB_ID int(3) unsigned NOT NULL default '0',
- REF_ID int(10) unsigned default NULL,
- REF_SUB int(3) unsigned default '0',
- PRIMARY KEY (ID,SUB_ID),
- UNIQUE KEY t1_PK (ID,SUB_ID),
- KEY t1_FK (REF_ID,REF_SUB),
- KEY t1_REFID (REF_ID)
-) ENGINE=MyISAM CHARSET=cp1251;
-INSERT INTO t1 VALUES (1,0,NULL,NULL),(2,0,NULL,NULL);
-SELECT DISTINCT REF_ID FROM t1 WHERE ID= (SELECT DISTINCT REF_ID FROM t1 WHERE ID=2);
-DROP TABLE t1;
-
-#
-# uninterruptable update
-#
-create table t1 (a int, b int);
-create table t2 (a int, b int);
-
-insert into t1 values (1,0), (2,0), (3,0);
-insert into t2 values (1,1), (2,1), (3,1), (2,2);
-
-update ignore t1 set b=(select b from t2 where t1.a=t2.a);
-select * from t1;
-
-drop table t1, t2;
-
-#
-# reduced subselect in ORDER BY & GROUP BY clauses
-#
-
-CREATE TABLE `t1` (
- `id` mediumint(8) unsigned NOT NULL auto_increment,
- `pseudo` varchar(35) NOT NULL default '',
- `email` varchar(60) NOT NULL default '',
- PRIMARY KEY (`id`),
- UNIQUE KEY `email` (`email`),
- UNIQUE KEY `pseudo` (`pseudo`)
-) ENGINE=MyISAM CHARSET=latin1 PACK_KEYS=1 ROW_FORMAT=DYNAMIC;
-INSERT INTO t1 (id,pseudo,email) VALUES (1,'test','test'),(2,'test1','test1');
-SELECT pseudo as a, pseudo as b FROM t1 GROUP BY (SELECT a) ORDER BY (SELECT id*1);
-drop table if exists t1;
-
-(SELECT 1 as a) UNION (SELECT 1) ORDER BY (SELECT a+0);
-
-#
-# IN subselect optimization test
-#
-create table t1 (a int not null, b int, primary key (a));
-create table t2 (a int not null, primary key (a));
-create table t3 (a int not null, b int, primary key (a));
-insert into t1 values (1,10), (2,20), (3,30), (4,40);
-insert into t2 values (2), (3), (4), (5);
-insert into t3 values (10,3), (20,4), (30,5);
-select * from t2 where t2.a in (select a from t1);
-explain extended select * from t2 where t2.a in (select a from t1);
-select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
-explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
-select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
-explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
-drop table t1, t2, t3;
-create table t1 (a int, b int, index a (a,b));
-create table t2 (a int, index a (a));
-create table t3 (a int, b int, index a (a));
-insert into t1 values (1,10), (2,20), (3,30), (4,40);
-disable_query_log;
-# making table large enough
-begin;
-let $1 = 10000;
-while ($1)
- {
- eval insert into t1 values (rand()*100000+200,rand()*100000);
- dec $1;
- }
-commit;
-enable_query_log;
-insert into t2 values (2), (3), (4), (5);
-insert into t3 values (10,3), (20,4), (30,5);
-SET @save_optimizer_switch=@@optimizer_switch;
-SET optimizer_switch='semijoin_with_cache=off';
-select * from t2 where t2.a in (select a from t1);
-explain extended select * from t2 where t2.a in (select a from t1);
-select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
-explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
-select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
-explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
-insert into t1 values (3,31);
-select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
-select * from t2 where t2.a in (select a from t1 where t1.b <> 30 and t1.b <> 31);
-explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
-SET optimizer_switch=@save_optimizer_switch;
-drop table t1, t2, t3;
-
-#
-# alloc_group_fields() working
-#
-create table t1 (a int, b int);
-create table t2 (a int, b int);
-create table t3 (a int, b int);
-insert into t1 values (0,100),(1,2), (1,3), (2,2), (2,7), (2,-1), (3,10);
-insert into t2 values (0,0), (1,1), (2,1), (3,1), (4,1);
-insert into t3 values (3,3), (2,2), (1,1);
-select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) from t3;
-drop table t1,t2,t3;
-
-#
-# aggregate functions in HAVING test
-#
-create table t1 (s1 int);
-create table t2 (s1 int);
-insert into t1 values (1);
-insert into t2 values (1);
-select * from t1 where exists (select s1 from t2 having max(t2.s1)=t1.s1);
-drop table t1,t2;
-
-#
-# update subquery with wrong field (to force name resolving
-# in UPDATE name space)
-#
-create table t1 (s1 int);
-create table t2 (s1 int);
-insert into t1 values (1);
-insert into t2 values (1);
--- error 1054
-update t1 set s1 = s1 + 1 where 1 = (select x.s1 as A from t2 WHERE t2.s1 > t1.s1 order by A);
-DROP TABLE t1, t2;
-
-#
-# collation test
-#
-CREATE TABLE t1 (s1 CHAR(5) COLLATE latin1_german1_ci,
- s2 CHAR(5) COLLATE latin1_swedish_ci);
-INSERT INTO t1 VALUES ('z','?');
--- error 1267
-select * from t1 where s1 > (select max(s2) from t1);
--- error 1267
-select * from t1 where s1 > any (select max(s2) from t1);
-drop table t1;
-
-#
-# aggregate functions reinitialization
-#
-create table t1(toid int,rd int);
-create table t2(userid int,pmnew int,pmtotal int);
-insert into t2 values(1,0,0),(2,0,0);
-insert into t1 values(1,0),(1,0),(1,0),(1,12),(1,15),(1,123),(1,12312),(1,12312),(1,123),(2,0),(2,0),(2,1),(2,2);
-select userid,pmtotal,pmnew, (select count(rd) from t1 where toid=t2.userid) calc_total, (select count(rd) from t1 where rd=0 and toid=t2.userid) calc_new from t2 where userid in (select distinct toid from t1);
-drop table t1, t2;
-
-#
-# row union
-#
-create table t1 (s1 char(5));
--- error 1241
-select (select 'a','b' from t1 union select 'a','b' from t1) from t1;
-insert into t1 values ('tttt');
-select * from t1 where ('a','b')=(select 'a','b' from t1 union select 'a','b' from t1);
-explain extended (select * from t1);
-(select * from t1);
-drop table t1;
-
-#
-# IN optimisation test results
-#
-create table t1 (s1 char(5), index s1(s1));
-create table t2 (s1 char(5), index s1(s1));
-insert into t1 values ('a1'),('a2'),('a3');
-insert into t2 values ('a1'),('a2');
-select s1, s1 NOT IN (SELECT s1 FROM t2) from t1;
-select s1, s1 = ANY (SELECT s1 FROM t2) from t1;
-select s1, s1 <> ALL (SELECT s1 FROM t2) from t1;
-select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1;
-explain extended select s1, s1 NOT IN (SELECT s1 FROM t2) from t1;
-explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1;
-explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1;
-explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1;
-drop table t1,t2;
-
-#
-# correct ALL optimisation
-#
-create table t2 (a int, b int not null);
-create table t3 (a int);
-insert into t3 values (6),(7),(3);
-select * from t3 where a >= all (select b from t2);
-explain extended select * from t3 where a >= all (select b from t2);
-select * from t3 where a >= some (select b from t2);
-explain extended select * from t3 where a >= some (select b from t2);
-select * from t3 where a >= all (select b from t2 group by 1);
-explain extended select * from t3 where a >= all (select b from t2 group by 1);
-select * from t3 where a >= some (select b from t2 group by 1);
-explain extended select * from t3 where a >= some (select b from t2 group by 1);
-select * from t3 where NULL >= any (select b from t2);
-explain extended select * from t3 where NULL >= any (select b from t2);
-select * from t3 where NULL >= any (select b from t2 group by 1);
-explain extended select * from t3 where NULL >= any (select b from t2 group by 1);
-select * from t3 where NULL >= some (select b from t2);
-explain extended select * from t3 where NULL >= some (select b from t2);
-select * from t3 where NULL >= some (select b from t2 group by 1);
-explain extended select * from t3 where NULL >= some (select b from t2 group by 1);
-#
-# optimized static ALL/ANY with grouping
-#
-insert into t2 values (2,2), (2,1), (3,3), (3,1);
-select * from t3 where a > all (select max(b) from t2 group by a);
-explain extended select * from t3 where a > all (select max(b) from t2 group by a);
-drop table t2, t3;
-
-#
-# correct used_tables()
-#
-
-CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL auto_increment, `taskid` bigint(20) NOT NULL default '0', `dbid` int(11) NOT NULL default '0', `create_date` datetime NOT NULL default '0000-00-00 00:00:00', `last_update` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=3 ;
-INSERT INTO `t1` (`id`, `taskid`, `dbid`, `create_date`,`last_update`) VALUES (1, 1, 15, '2003-09-29 10:31:36', '2003-09-29 10:31:36'), (2, 1, 21, now(), now());
-CREATE TABLE `t2` (`db_id` int(11) NOT NULL auto_increment,`name` varchar(200) NOT NULL default '',`primary_uid` smallint(6) NOT NULL default '0',`secondary_uid` smallint(6) NOT NULL default '0',PRIMARY KEY (`db_id`),UNIQUE KEY `name_2` (`name`),FULLTEXT KEY `name` (`name`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=2147483647;
-INSERT INTO `t2` (`db_id`, `name`, `primary_uid`, `secondary_uid`) VALUES (18, 'Not Set 1', 0, 0),(19, 'Valid', 1, 2),(20, 'Valid 2', 1, 2),(21, 'Should Not Return', 1, 2),(26, 'Not Set 2', 0, 0),(-1, 'ALL DB\'S', 0, 0);
-CREATE TABLE `t3` (`taskgenid` mediumint(9) NOT NULL auto_increment,`dbid` int(11) NOT NULL default '0',`taskid` int(11) NOT NULL default '0',`mon` tinyint(4) NOT NULL default '1',`tues` tinyint(4) NOT NULL default '1',`wed` tinyint(4) NOT NULL default '1',`thur` tinyint(4) NOT NULL default '1',`fri` tinyint(4) NOT NULL default '1',`sat` tinyint(4) NOT NULL default '0',`sun` tinyint(4) NOT NULL default '0',`how_often` smallint(6) NOT NULL default '1',`userid` smallint(6) NOT NULL default '0',`active` tinyint(4) NOT NULL default '1',PRIMARY KEY (`taskgenid`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=2 ;
-INSERT INTO `t3` (`taskgenid`, `dbid`, `taskid`, `mon`, `tues`,`wed`, `thur`, `fri`, `sat`, `sun`, `how_often`, `userid`, `active`) VALUES (1,-1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1);
-CREATE TABLE `t4` (`task_id` smallint(6) NOT NULL default '0',`description` varchar(200) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1;
-INSERT INTO `t4` (`task_id`, `description`) VALUES (1, 'Daily Check List'),(2, 'Weekly Status');
-select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid;
-SELECT dbid, name FROM t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND ((date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01')) AND t4.task_id = taskid;
-drop table t1,t2,t3,t4;
-
-#
-# cardinality check
-#
-CREATE TABLE t1 (id int(11) default NULL) ENGINE=MyISAM CHARSET=latin1;
-INSERT INTO t1 VALUES (1),(5);
-CREATE TABLE t2 (id int(11) default NULL) ENGINE=MyISAM CHARSET=latin1;
-INSERT INTO t2 VALUES (2),(6);
--- error 1241
-select * from t1 where (1,2,6) in (select * from t2);
-DROP TABLE t1,t2;
-
-#
-# DO and SET with errors
-#
-create table t1 (s1 int);
-insert into t1 values (1);
-insert into t1 values (2);
--- error 1242
-set sort_buffer_size = (select s1 from t1);
-do (select * from t1);
-drop table t1;
-
-#
-# optimized ALL/ANY with union
-#
-create table t1 (s1 char);
-insert into t1 values ('e');
-select * from t1 where 'f' > any (select s1 from t1);
-select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1);
-explain extended select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1);
-drop table t1;
-
-#
-# filesort in subquery (restoring join_tab)
-#
-CREATE TABLE t1 (number char(11) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1;
-INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874');
-CREATE TABLE t2 (code char(5) NOT NULL default '',UNIQUE KEY code (code)) ENGINE=MyISAM CHARSET=latin1;
-INSERT INTO t2 VALUES ('1'),('1226'),('1245'),('1862'),('18623'),('1874'),('1967'),('6');
-select c.number as phone,(select p.code from t2 p where c.number like concat(p.code, '%') order by length(p.code) desc limit 1) as code from t1 c;
-drop table t1, t2;
-
-#
-# unresolved field error
-#
-create table t1 (s1 int);
-create table t2 (s1 int);
--- error 1054
-select * from t1 where (select count(*) from t2 where t1.s2) = 1;
--- error 1054
-select * from t1 where (select count(*) from t2 group by t1.s2) = 1;
--- error 1054
-select count(*) from t2 group by t1.s2;
-drop table t1, t2;
-
-#
-# fix_fields() in add_ref_to_table_cond()
-#
-CREATE TABLE t1(COLA FLOAT NOT NULL,COLB FLOAT NOT NULL,COLC VARCHAR(20) DEFAULT NULL,PRIMARY KEY (COLA, COLB));
-CREATE TABLE t2(COLA FLOAT NOT NULL,COLB FLOAT NOT NULL,COLC CHAR(1) NOT NULL,PRIMARY KEY (COLA));
-INSERT INTO t1 VALUES (1,1,'1A3240'), (1,2,'4W2365');
-INSERT INTO t2 VALUES (100, 200, 'C');
-SELECT DISTINCT COLC FROM t1 WHERE COLA = (SELECT COLA FROM t2 WHERE COLB = 200 AND COLC ='C' LIMIT 1);
-DROP TABLE t1, t2;
-
-CREATE TABLE t1 (a int(1));
-INSERT INTO t1 VALUES (1),(1),(1),(1),(1),(2),(3),(4),(5);
-SELECT DISTINCT (SELECT a) FROM t1 LIMIT 100;
-DROP TABLE t1;
-
-#
-# Bug 2198
-#
-
-create table t1 (a int, b decimal(13, 3));
-insert into t1 values (1, 0.123);
-select a, (select max(b) from t1) into outfile "subselect.out.file.1" from t1;
-delete from t1;
-load data infile "subselect.out.file.1" into table t1;
-select * from t1;
-drop table t1;
-
-#
-# Bug 2479
-#
-
-CREATE TABLE `t1` (
- `id` int(11) NOT NULL auto_increment,
- `id_cns` tinyint(3) unsigned NOT NULL default '0',
- `tipo` enum('','UNO','DUE') NOT NULL default '',
- `anno_dep` smallint(4) unsigned zerofill NOT NULL default '0000',
- `particolare` mediumint(8) unsigned NOT NULL default '0',
- `generale` mediumint(8) unsigned NOT NULL default '0',
- `bis` tinyint(3) unsigned NOT NULL default '0',
- PRIMARY KEY (`id`),
- UNIQUE KEY `idx_cns_gen_anno` (`anno_dep`,`id_cns`,`generale`,`particolare`),
- UNIQUE KEY `idx_cns_par_anno` (`id_cns`,`anno_dep`,`tipo`,`particolare`,`bis`)
-);
-INSERT INTO `t1` VALUES (1,16,'UNO',1987,2048,9681,0),(2,50,'UNO',1987,1536,13987,0),(3,16,'UNO',1987,2432,14594,0),(4,16,'UNO',1987,1792,13422,0),(5,16,'UNO',1987,1025,10240,0),(6,16,'UNO',1987,1026,7089,0);
-CREATE TABLE `t2` (
- `id` tinyint(3) unsigned NOT NULL auto_increment,
- `max_anno_dep` smallint(6) unsigned NOT NULL default '0',
- PRIMARY KEY (`id`)
-);
-INSERT INTO `t2` VALUES (16,1987),(50,1990),(51,1990);
-
-SELECT cns.id, cns.max_anno_dep, cns.max_anno_dep = (SELECT s.anno_dep FROM t1 AS s WHERE s.id_cns = cns.id ORDER BY s.anno_dep DESC LIMIT 1) AS PIPPO FROM t2 AS cns;
-
-DROP TABLE t1, t2;
-
-#
-# GLOBAL LIMIT
-#
-create table t1 (a int);
-insert into t1 values (1), (2), (3);
-SET SQL_SELECT_LIMIT=1;
-select sum(a) from (select * from t1) as a;
-select 2 in (select * from t1);
-SET SQL_SELECT_LIMIT=default;
-drop table t1;
-
-#
-# Bug #3118: subselect + order by
-#
-
-CREATE TABLE t1 (a int, b int, INDEX (a));
-INSERT INTO t1 VALUES (1, 1), (1, 2), (1, 3);
-SELECT * FROM t1 WHERE a = (SELECT MAX(a) FROM t1 WHERE a = 1) ORDER BY b;
-DROP TABLE t1;
-
-# Item_cond fix field
-#
-create table t1(val varchar(10));
-insert into t1 values ('aaa'), ('bbb'),('eee'),('mmm'),('ppp');
-select count(*) from t1 as w1 where w1.val in (select w2.val from t1 as w2 where w2.val like 'm%') and w1.val in (select w3.val from t1 as w3 where w3.val like 'e%');
-drop table t1;
-
-#
-# ref_or_null replacing with ref
-#
-create table t1 (id int not null, text varchar(20) not null default '', primary key (id));
-insert into t1 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text11'), (12, 'text12');
-select * from t1 where id not in (select id from t1 where id < 8);
-select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null);
-explain extended select * from t1 where id not in (select id from t1 where id < 8);
-explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null);
-insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001');
-create table t2 (id int not null, text varchar(20) not null default '', primary key (id));
-insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10');
-select * from t1 a left join t2 b on (a.id=b.id or b.id is null) join t1 c on (if(isnull(b.id), 1000, b.id)=c.id);
-explain extended select * from t1 a left join t2 b on (a.id=b.id or b.id is null) join t1 c on (if(isnull(b.id), 1000, b.id)=c.id);
-drop table t1,t2;
-
-set @@optimizer_switch=@save_optimizer_switch;
-
-#
-# Static tables & rund() in subqueries
-#
-create table t1 (a int);
-insert into t1 values (1);
-explain select benchmark(1000, (select a from t1 where a=sha(rand())));
-drop table t1;
-
-#
-# bug 3188
-#
-create table t1(id int);
-create table t2(id int);
-create table t3(flag int);
--- error 1064
-select (select * from t3 where id not null) from t1, t2;
-drop table t1,t2,t3;
-
-#
-# aggregate functions (Bug #3505)
-#
-CREATE TABLE t1 (id INT);
-CREATE TABLE t2 (id INT);
-INSERT INTO t1 VALUES (1), (2);
-INSERT INTO t2 VALUES (1);
-SELECT t1.id, ( SELECT COUNT(t.id) FROM t2 AS t WHERE t.id = t1.id ) AS c FROM t1 LEFT JOIN t2 USING (id);
-SELECT id, ( SELECT COUNT(t.id) FROM t2 AS t WHERE t.id = t1.id ) AS c FROM t1 LEFT JOIN t2 USING (id);
-SELECT t1.id, ( SELECT COUNT(t.id) FROM t2 AS t WHERE t.id = t1.id ) AS c FROM t1 LEFT JOIN t2 USING (id) ORDER BY t1.id;
-SELECT id, ( SELECT COUNT(t.id) FROM t2 AS t WHERE t.id = t1.id ) AS c FROM t1 LEFT JOIN t2 USING (id) ORDER BY id;
-DROP TABLE t1,t2;
-
-#
-# ALL/ANY test
-#
-CREATE TABLE t1 ( a int, b int );
-INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
-SELECT a FROM t1 WHERE a > ANY ( SELECT a FROM t1 WHERE b = 2 );
-SELECT a FROM t1 WHERE a < ANY ( SELECT a FROM t1 WHERE b = 2 );
-SELECT a FROM t1 WHERE a = ANY ( SELECT a FROM t1 WHERE b = 2 );
-SELECT a FROM t1 WHERE a >= ANY ( SELECT a FROM t1 WHERE b = 2 );
-SELECT a FROM t1 WHERE a <= ANY ( SELECT a FROM t1 WHERE b = 2 );
-SELECT a FROM t1 WHERE a <> ANY ( SELECT a FROM t1 WHERE b = 2 );
-SELECT a FROM t1 WHERE a > ALL ( SELECT a FROM t1 WHERE b = 2 );
-SELECT a FROM t1 WHERE a < ALL ( SELECT a FROM t1 WHERE b = 2 );
-SELECT a FROM t1 WHERE a = ALL ( SELECT a FROM t1 WHERE b = 2 );
-SELECT a FROM t1 WHERE a >= ALL ( SELECT a FROM t1 WHERE b = 2 );
-SELECT a FROM t1 WHERE a <= ALL ( SELECT a FROM t1 WHERE b = 2 );
-SELECT a FROM t1 WHERE a <> ALL ( SELECT a FROM t1 WHERE b = 2 );
-# with index
-ALTER TABLE t1 ADD INDEX (a);
-SELECT a FROM t1 WHERE a > ANY ( SELECT a FROM t1 WHERE b = 2 );
-SELECT a FROM t1 WHERE a < ANY ( SELECT a FROM t1 WHERE b = 2 );
-SELECT a FROM t1 WHERE a = ANY ( SELECT a FROM t1 WHERE b = 2 );
-SELECT a FROM t1 WHERE a >= ANY ( SELECT a FROM t1 WHERE b = 2 );
-SELECT a FROM t1 WHERE a <= ANY ( SELECT a FROM t1 WHERE b = 2 );
-SELECT a FROM t1 WHERE a <> ANY ( SELECT a FROM t1 WHERE b = 2 );
-SELECT a FROM t1 WHERE a > ALL ( SELECT a FROM t1 WHERE b = 2 );
-SELECT a FROM t1 WHERE a < ALL ( SELECT a FROM t1 WHERE b = 2 );
-SELECT a FROM t1 WHERE a = ALL ( SELECT a FROM t1 WHERE b = 2 );
-SELECT a FROM t1 WHERE a >= ALL ( SELECT a FROM t1 WHERE b = 2 );
-SELECT a FROM t1 WHERE a <= ALL ( SELECT a FROM t1 WHERE b = 2 );
-SELECT a FROM t1 WHERE a <> ALL ( SELECT a FROM t1 WHERE b = 2 );
-# having clause test
-SELECT a FROM t1 WHERE a > ANY (SELECT a FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE a < ANY (SELECT a FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE a = ANY (SELECT a FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE a >= ANY (SELECT a FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE a <= ANY (SELECT a FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE a <> ANY (SELECT a FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE a > ALL (SELECT a FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE a < ALL (SELECT a FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE a = ALL (SELECT a FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE a >= ALL (SELECT a FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE a <= ALL (SELECT a FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 HAVING a = 2);
-# union test
-SELECT a FROM t1 WHERE a > ANY (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2);
-SELECT a FROM t1 WHERE a < ANY (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2);
-SELECT a FROM t1 WHERE a = ANY (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2);
-SELECT a FROM t1 WHERE a >= ANY (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2);
-SELECT a FROM t1 WHERE a <= ANY (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2);
-SELECT a FROM t1 WHERE a <> ANY (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2);
-SELECT a FROM t1 WHERE a > ALL (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2);
-SELECT a FROM t1 WHERE a < ALL (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2);
-SELECT a FROM t1 WHERE a = ALL (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2);
-SELECT a FROM t1 WHERE a >= ALL (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2);
-SELECT a FROM t1 WHERE a <= ALL (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2);
-SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2);
-# union + having test
-SELECT a FROM t1 WHERE a > ANY (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE a < ANY (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE a = ANY (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE a >= ANY (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE a <= ANY (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE a <> ANY (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE a > ALL (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE a < ALL (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE a = ALL (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE a >= ALL (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE a <= ALL (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2);
-# row tests
-# < > >= <= and = ALL/ <> ANY do not support row operation
--- error 1241
-SELECT a FROM t1 WHERE (1,2) > ANY (SELECT a FROM t1 WHERE b = 2);
--- error 1241
-SELECT a FROM t1 WHERE a > ANY (SELECT a,2 FROM t1 WHERE b = 2);
--- error 1241
-SELECT a FROM t1 WHERE (1,2) > ANY (SELECT a,2 FROM t1 WHERE b = 2);
--- error 1241
-SELECT a FROM t1 WHERE (1,2) > ALL (SELECT a FROM t1 WHERE b = 2);
--- error 1241
-SELECT a FROM t1 WHERE a > ALL (SELECT a,2 FROM t1 WHERE b = 2);
--- error 1241
-SELECT a FROM t1 WHERE (1,2) > ALL (SELECT a,2 FROM t1 WHERE b = 2);
--- error 1241
-SELECT a FROM t1 WHERE (1,2) = ALL (SELECT a,2 FROM t1 WHERE b = 2);
--- error 1241
-SELECT a FROM t1 WHERE (1,2) <> ANY (SELECT a,2 FROM t1 WHERE b = 2);
-# following should be converted to IN
--- error 1241
-SELECT a FROM t1 WHERE (1,2) = ANY (SELECT a FROM t1 WHERE b = 2);
--- error 1241
-SELECT a FROM t1 WHERE a = ANY (SELECT a,2 FROM t1 WHERE b = 2);
-SELECT a FROM t1 WHERE (1,2) = ANY (SELECT a,2 FROM t1 WHERE b = 2);
--- error 1241
-SELECT a FROM t1 WHERE (1,2) <> ALL (SELECT a FROM t1 WHERE b = 2);
--- error 1241
-SELECT a FROM t1 WHERE a <> ALL (SELECT a,2 FROM t1 WHERE b = 2);
-SELECT a FROM t1 WHERE (1,2) <> ALL (SELECT a,2 FROM t1 WHERE b = 2);
-SELECT a FROM t1 WHERE (a,1) = ANY (SELECT a,1 FROM t1 WHERE b = 2);
-SELECT a FROM t1 WHERE (a,1) <> ALL (SELECT a,1 FROM t1 WHERE b = 2);
-SELECT a FROM t1 WHERE (a,1) = ANY (SELECT a,1 FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE (a,1) <> ALL (SELECT a,1 FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE (a,1) = ANY (SELECT a,1 FROM t1 WHERE b = 2 UNION SELECT a,1 FROM t1 WHERE b = 2);
-SELECT a FROM t1 WHERE (a,1) <> ALL (SELECT a,1 FROM t1 WHERE b = 2 UNION SELECT a,1 FROM t1 WHERE b = 2);
-SELECT a FROM t1 WHERE (a,1) = ANY (SELECT a,1 FROM t1 HAVING a = 2 UNION SELECT a,1 FROM t1 HAVING a = 2);
-SELECT a FROM t1 WHERE (a,1) <> ALL (SELECT a,1 FROM t1 HAVING a = 2 UNION SELECT a,1 FROM t1 HAVING a = 2);
-# without optimisation
-SELECT a FROM t1 WHERE a > ANY (SELECT a FROM t1 WHERE b = 2 group by a);
-SELECT a FROM t1 WHERE a < ANY (SELECT a FROM t1 WHERE b = 2 group by a);
-SELECT a FROM t1 WHERE a = ANY (SELECT a FROM t1 WHERE b = 2 group by a);
-SELECT a FROM t1 WHERE a >= ANY (SELECT a FROM t1 WHERE b = 2 group by a);
-SELECT a FROM t1 WHERE a <= ANY (SELECT a FROM t1 WHERE b = 2 group by a);
-SELECT a FROM t1 WHERE a <> ANY (SELECT a FROM t1 WHERE b = 2 group by a);
-SELECT a FROM t1 WHERE a > ALL (SELECT a FROM t1 WHERE b = 2 group by a);
-SELECT a FROM t1 WHERE a < ALL (SELECT a FROM t1 WHERE b = 2 group by a);
-SELECT a FROM t1 WHERE a = ALL (SELECT a FROM t1 WHERE b = 2 group by a);
-SELECT a FROM t1 WHERE a >= ALL (SELECT a FROM t1 WHERE b = 2 group by a);
-SELECT a FROM t1 WHERE a <= ALL (SELECT a FROM t1 WHERE b = 2 group by a);
-SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 WHERE b = 2 group by a);
-# without optimisation + having
-SELECT a FROM t1 WHERE a > ANY (SELECT a FROM t1 group by a HAVING a = 2);
-SELECT a FROM t1 WHERE a < ANY (SELECT a FROM t1 group by a HAVING a = 2);
-SELECT a FROM t1 WHERE a = ANY (SELECT a FROM t1 group by a HAVING a = 2);
-SELECT a FROM t1 WHERE a >= ANY (SELECT a FROM t1 group by a HAVING a = 2);
-SELECT a FROM t1 WHERE a <= ANY (SELECT a FROM t1 group by a HAVING a = 2);
-SELECT a FROM t1 WHERE a <> ANY (SELECT a FROM t1 group by a HAVING a = 2);
-SELECT a FROM t1 WHERE a > ALL (SELECT a FROM t1 group by a HAVING a = 2);
-SELECT a FROM t1 WHERE a < ALL (SELECT a FROM t1 group by a HAVING a = 2);
-SELECT a FROM t1 WHERE a = ALL (SELECT a FROM t1 group by a HAVING a = 2);
-SELECT a FROM t1 WHERE a >= ALL (SELECT a FROM t1 group by a HAVING a = 2);
-SELECT a FROM t1 WHERE a <= ALL (SELECT a FROM t1 group by a HAVING a = 2);
-SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 group by a HAVING a = 2);
-# EXISTS in string contence
-SELECT concat(EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a > t1.a), '-') from t1 a;
-SELECT concat(EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a < t1.a), '-') from t1 a;
-SELECT concat(EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a = t1.a), '-') from t1 a;
-DROP TABLE t1;
-CREATE TABLE t1 ( a double, b double );
-INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
-SELECT a FROM t1 WHERE a > ANY (SELECT a FROM t1 WHERE b = 2e0);
-SELECT a FROM t1 WHERE a < ANY (SELECT a FROM t1 WHERE b = 2e0);
-SELECT a FROM t1 WHERE a = ANY (SELECT a FROM t1 WHERE b = 2e0);
-SELECT a FROM t1 WHERE a >= ANY (SELECT a FROM t1 WHERE b = 2e0);
-SELECT a FROM t1 WHERE a <= ANY (SELECT a FROM t1 WHERE b = 2e0);
-SELECT a FROM t1 WHERE a <> ANY (SELECT a FROM t1 WHERE b = 2e0);
-SELECT a FROM t1 WHERE a > ALL (SELECT a FROM t1 WHERE b = 2e0);
-SELECT a FROM t1 WHERE a < ALL (SELECT a FROM t1 WHERE b = 2e0);
-SELECT a FROM t1 WHERE a = ALL (SELECT a FROM t1 WHERE b = 2e0);
-SELECT a FROM t1 WHERE a >= ALL (SELECT a FROM t1 WHERE b = 2e0);
-SELECT a FROM t1 WHERE a <= ALL (SELECT a FROM t1 WHERE b = 2e0);
-SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 WHERE b = 2e0);
-DROP TABLE t1;
-CREATE TABLE t1 ( a char(1), b char(1));
-INSERT INTO t1 VALUES ('1','1'),('2','2'),('3','3');
-SELECT a FROM t1 WHERE a > ANY (SELECT a FROM t1 WHERE b = '2');
-SELECT a FROM t1 WHERE a < ANY (SELECT a FROM t1 WHERE b = '2');
-SELECT a FROM t1 WHERE a = ANY (SELECT a FROM t1 WHERE b = '2');
-SELECT a FROM t1 WHERE a >= ANY (SELECT a FROM t1 WHERE b = '2');
-SELECT a FROM t1 WHERE a <= ANY (SELECT a FROM t1 WHERE b = '2');
-SELECT a FROM t1 WHERE a <> ANY (SELECT a FROM t1 WHERE b = '2');
-SELECT a FROM t1 WHERE a > ALL (SELECT a FROM t1 WHERE b = '2');
-SELECT a FROM t1 WHERE a < ALL (SELECT a FROM t1 WHERE b = '2');
-SELECT a FROM t1 WHERE a = ALL (SELECT a FROM t1 WHERE b = '2');
-SELECT a FROM t1 WHERE a >= ALL (SELECT a FROM t1 WHERE b = '2');
-SELECT a FROM t1 WHERE a <= ALL (SELECT a FROM t1 WHERE b = '2');
-SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 WHERE b = '2');
-DROP TABLE t1;
-
-
-#
-# SELECT(EXISTS * ...)optimisation
-#
-create table t1 (a int, b int);
-insert into t1 values (1,2),(3,4);
-select * from t1 up where exists (select * from t1 where t1.a=up.a);
-explain extended select * from t1 up where exists (select * from t1 where t1.a=up.a);
-drop table t1;
-
-#
-# Bug #4102: subselect in HAVING
-#
-
-CREATE TABLE t1 (t1_a int);
-INSERT INTO t1 VALUES (1);
-CREATE TABLE t2 (t2_a int, t2_b int, PRIMARY KEY (t2_a, t2_b));
-INSERT INTO t2 VALUES (1, 1), (1, 2);
-SELECT * FROM t1, t2 table2 WHERE t1_a = 1 AND table2.t2_a = 1
- HAVING table2.t2_b = (SELECT MAX(t2_b) FROM t2 WHERE t2_a = table2.t2_a);
-DROP TABLE t1, t2;
-
-#
-# Test problem with NULL and derived tables (Bug #4097)
-#
-
-CREATE TABLE t1 (id int(11) default NULL,name varchar(10) default NULL);
-INSERT INTO t1 VALUES (1,'Tim'),(2,'Rebecca'),(3,NULL);
-CREATE TABLE t2 (id int(11) default NULL, pet varchar(10) default NULL);
-INSERT INTO t2 VALUES (1,'Fido'),(2,'Spot'),(3,'Felix');
-SELECT a.*, b.* FROM (SELECT * FROM t1) AS a JOIN t2 as b on a.id=b.id;
-drop table t1,t2;
-
-#
-# outer fields resolving in INSERT/REPLACE and CRETE with SELECT
-#
-CREATE TABLE t1 ( a int, b int );
-CREATE TABLE t2 ( c int, d int );
-INSERT INTO t1 VALUES (1,2), (2,3), (3,4);
-SELECT a AS abc, b FROM t1 outr WHERE b =
- (SELECT MIN(b) FROM t1 WHERE a=outr.a);
-INSERT INTO t2 SELECT a AS abc, b FROM t1 outr WHERE b =
- (SELECT MIN(b) FROM t1 WHERE a=outr.a);
-select * from t2;
-CREATE TABLE t3 SELECT a AS abc, b FROM t1 outr WHERE b =
- (SELECT MIN(b) FROM t1 WHERE a=outr.a);
-select * from t3;
-prepare stmt1 from "INSERT INTO t2 SELECT a AS abc, b FROM t1 outr WHERE b = (SELECT MIN(b) FROM t1 WHERE a=outr.a);";
-execute stmt1;
-deallocate prepare stmt1;
-select * from t2;
-drop table t3;
-prepare stmt1 from "CREATE TABLE t3 SELECT a AS abc, b FROM t1 outr WHERE b = (SELECT MIN(b) FROM t1 WHERE a=outr.a);";
-execute stmt1;
-select * from t3;
-deallocate prepare stmt1;
-DROP TABLE t1, t2, t3;
-
-#
-# Aggregate function comparation with ALL/ANY/SOME subselect
-#
-CREATE TABLE `t1` ( `a` int(11) default NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-insert into t1 values (1);
-CREATE TABLE `t2` ( `b` int(11) default NULL, `a` int(11) default NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-insert into t2 values (1,2);
-select t000.a, count(*) `C` FROM t1 t000 GROUP BY t000.a HAVING count(*) > ALL (SELECT count(*) FROM t2 t001 WHERE t001.a=1);
-drop table t1,t2;
-
-#
-# BUG#4769 - fulltext in subselect
-#
-create table t1 (a int not null auto_increment primary key, b varchar(40), fulltext(b)) engine=myisam; # PBXT: Full-text engine required
-insert into t1 (b) values ('ball'),('ball games'), ('games'), ('foo'), ('foobar'), ('Serg'), ('Sergei'),('Georg'), ('Patrik'),('Hakan');
-create table t2 (a int);
-insert into t2 values (1),(3),(2),(7);
-select a,b from t1 where match(b) against ('Ball') > 0;
-select a from t2 where a in (select a from t1 where match(b) against ('Ball') > 0);
-drop table t1,t2;
-
-#
-# BUG#5003 - like in subselect
-#
-CREATE TABLE t1(`IZAVORGANG_ID` VARCHAR(11) CHARACTER SET latin1 COLLATE latin1_bin,`KUERZEL` VARCHAR(10) CHARACTER SET latin1 COLLATE latin1_bin,`IZAANALYSEART_ID` VARCHAR(11) CHARACTER SET latin1 COLLATE latin1_bin,`IZAPMKZ_ID` VARCHAR(11) CHARACTER SET latin1 COLLATE latin1_bin);
-CREATE INDEX AK01IZAVORGANG ON t1(izaAnalyseart_id,Kuerzel);
-INSERT INTO t1(`IZAVORGANG_ID`,`KUERZEL`,`IZAANALYSEART_ID`,`IZAPMKZ_ID`)VALUES('D0000000001','601','D0000000001','I0000000001');
-INSERT INTO t1(`IZAVORGANG_ID`,`KUERZEL`,`IZAANALYSEART_ID`,`IZAPMKZ_ID`)VALUES('D0000000002','602','D0000000001','I0000000001');
-INSERT INTO t1(`IZAVORGANG_ID`,`KUERZEL`,`IZAANALYSEART_ID`,`IZAPMKZ_ID`)VALUES('D0000000003','603','D0000000001','I0000000001');
-INSERT INTO t1(`IZAVORGANG_ID`,`KUERZEL`,`IZAANALYSEART_ID`,`IZAPMKZ_ID`)VALUES('D0000000004','101','D0000000001','I0000000001');
-SELECT `IZAVORGANG_ID` FROM t1 WHERE `KUERZEL` IN(SELECT MIN(`KUERZEL`)`Feld1` FROM t1 WHERE `KUERZEL` LIKE'601%'And`IZAANALYSEART_ID`='D0000000001');
-drop table t1;
-
-#
-# Optimized IN with compound index
-#
-CREATE TABLE `t1` ( `aid` int(11) NOT NULL default '0', `bid` int(11) NOT NULL default '0', PRIMARY KEY (`aid`,`bid`));
-CREATE TABLE `t2` ( `aid` int(11) NOT NULL default '0', `bid` int(11) NOT NULL default '0', PRIMARY KEY (`aid`,`bid`));
-insert into t1 values (1,1),(1,2),(2,1),(2,2);
-insert into t2 values (1,2),(2,2);
-select * from t1 where t1.aid not in (select aid from t2 where bid=t1.bid);
-alter table t2 drop primary key;
-alter table t2 add key KEY1 (aid, bid);
-select * from t1 where t1.aid not in (select aid from t2 where bid=t1.bid);
-alter table t2 drop key KEY1;
-alter table t2 add primary key (bid, aid);
-select * from t1 where t1.aid not in (select aid from t2 where bid=t1.bid);
-drop table t1,t2;
-
-#
-# resolving fields of grouped outer SELECT
-#
-CREATE TABLE t1 (howmanyvalues bigint, avalue int);
-INSERT INTO t1 VALUES (1, 1),(2, 1),(2, 2),(3, 1),(3, 2),(3, 3),(4, 1),(4, 2),(4, 3),(4, 4);
-SELECT howmanyvalues, count(*) from t1 group by howmanyvalues;
-SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues = a.howmanyvalues) as mycount from t1 a group by a.howmanyvalues;
-CREATE INDEX t1_howmanyvalues_idx ON t1 (howmanyvalues);
-SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues+1 = a.howmanyvalues+1) as mycount from t1 a group by a.howmanyvalues;
-SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues = a.howmanyvalues) as mycount from t1 a group by a.howmanyvalues;
-SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues = a.avalue) as mycount from t1 a group by a.howmanyvalues;
-drop table t1;
-
-create table t1 (x int);
-select (select b.x from t1 as b where b.x=a.x) from t1 as a where a.x=2 group by a.x;
-drop table t1;
-
-#
-# Test of correct maybe_null flag returning by subquwery for temporary table
-# creation
-#
-CREATE TABLE `t1` ( `master` int(10) unsigned NOT NULL default '0', `map` smallint(6) unsigned NOT NULL default '0', `slave` int(10) unsigned NOT NULL default '0', `access` int(10) unsigned NOT NULL default '0', UNIQUE KEY `access_u` (`master`,`map`,`slave`));
-INSERT INTO `t1` VALUES (1,0,0,700),(1,1,1,400),(1,5,5,400),(1,12,12,400),(1,12,32,400),(4,12,32,400);
-CREATE TABLE `t2` ( `id` int(10) unsigned NOT NULL default '0', `pid` int(10) unsigned NOT NULL default '0', `map` smallint(6) unsigned NOT NULL default '0', `level` tinyint(4) unsigned NOT NULL default '0', `title` varchar(255) default NULL, PRIMARY KEY (`id`,`pid`,`map`), KEY `level` (`level`), KEY `id` (`id`,`map`)) ;
-INSERT INTO `t2` VALUES (6,5,12,7,'a'),(12,0,0,7,'a'),(12,1,0,7,'a'),(12,5,5,7,'a'),(12,5,12,7,'a');
--- error 1054
-SELECT b.sc FROM (SELECT (SELECT a.access FROM t1 a WHERE a.map = op.map AND a.slave = op.pid AND a.master = 1) ac FROM t2 op WHERE op.id = 12 AND op.map = 0) b;
-SELECT b.ac FROM (SELECT (SELECT a.access FROM t1 a WHERE a.map = op.map AND a.slave = op.pid AND a.master = 1) ac FROM t2 op WHERE op.id = 12 AND op.map = 0) b;
-drop tables t1,t2;
-
-#
-# Test for bug #6462. "Same request on same data returns different
-# results." a.k.a. "Proper cleanup of subqueries is missing for
-# SET and DO statements".
-#
-create table t1 (a int not null, b int not null, c int, primary key (a,b));
-insert into t1 values (1,1,1), (2,2,2), (3,3,3);
-set @b:= 0;
-# Let us check that subquery will use covering index
-explain select sum(a) from t1 where b > @b;
-# This should not crash -debug server due to failing assertion
-set @a:= (select sum(a) from t1 where b > @b);
-# And this should not falsely report index usage
-explain select a from t1 where c=2;
-# Same for DO statement
-do @a:= (select sum(a) from t1 where b > @b);
-explain select a from t1 where c=2;
-drop table t1;
-
-#
-# Subselect in non-select command just after connection
-#
-connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
-connection root;
-set @got_val= (SELECT 1 FROM (SELECT 'A' as my_col) as T1 ) ;
-
-#
-# primary query with temporary table and subquery with groupping
-#
-create table t1 (a int, b int);
-create table t2 (a int, b int);
-insert into t1 values (1,1),(1,2),(1,3),(2,4),(2,5);
-insert into t2 values (1,3),(2,1);
-select distinct a,b, (select max(b) from t2 where t1.b=t2.a) from t1 order by t1.b;
-drop table t1, t2;
-
-#
-# subqueries with full text search
-#
-create table t1 (id int);
-create table t2 (id int, body text, fulltext (body)) engine=myisam; # PBXT: Full-text engine required
-insert into t1 values(1),(2),(3);
-insert into t2 values (1,'test'), (2,'mysql'), (3,'test'), (4,'test');
-select count(distinct id) from t1 where id in (select id from t2 where match(body) against ('mysql' in boolean mode));
-drop table t2,t1;
-
-#
-# Equal operation under row and empty subquery
-#
-create table t1 (s1 int,s2 int);
-insert into t1 values (20,15);
-select * from t1 where (('a',null) <=> (select 'a',s2 from t1 where s1 = 0));
-drop table t1;
-
-#
-# ALL/ANY with NULL
-#
-create table t1 (s1 int);
-insert into t1 values (1),(null);
-select * from t1 where s1 < all (select s1 from t1);
-select s1, s1 < all (select s1 from t1) from t1;
-drop table t1;
-
-#
-# reference on changable fields from subquery
-#
-CREATE TABLE t1 (
- Code char(3) NOT NULL default '',
- Name char(52) NOT NULL default '',
- Continent enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America') NOT NULL default 'Asia',
- Region char(26) NOT NULL default '',
- SurfaceArea float(10,2) NOT NULL default '0.00',
- IndepYear smallint(6) default NULL,
- Population int(11) NOT NULL default '0',
- LifeExpectancy float(3,1) default NULL,
- GNP float(10,2) default NULL,
- GNPOld float(10,2) default NULL,
- LocalName char(45) NOT NULL default '',
- GovernmentForm char(45) NOT NULL default '',
- HeadOfState char(60) default NULL,
- Capital int(11) default NULL,
- Code2 char(2) NOT NULL default ''
-) ENGINE=MyISAM;
-INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX');
-INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS');
-INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF');
-INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','Micronesia/Caribbean',16.00,0,0,NULL,0.00,NULL,'United States Minor Outlying Islands','Dependent Territory of the US','George W. Bush',NULL,'UM');
-/*!40000 ALTER TABLE t1 ENABLE KEYS */;
-SELECT DISTINCT Continent AS c FROM t1 outr WHERE
- Code <> SOME ( SELECT Code FROM t1 WHERE Continent = outr.Continent AND
- Population < 200);
-drop table t1;
-
-#
-# Test for BUG#7885: Server crash when 'any' subselect compared to
-# non-existant field.
-#
-create table t1 (a1 int);
-create table t2 (b1 int);
---error 1054
-select * from t1 where a2 > any(select b1 from t2);
-select * from t1 where a1 > any(select b1 from t2);
-drop table t1,t2;
-
-
-#
-# Comparison subquery with * and row
-#
-create table t1 (a integer, b integer);
-select (select * from t1) = (select 1,2);
-select (select 1,2) = (select * from t1);
-# queries whih can be converted to IN
-select row(1,2) = ANY (select * from t1);
-select row(1,2) != ALL (select * from t1);
-drop table t1;
-
-#
-# Comparison subquery and row with nested rows
-#
-create table t1 (a integer, b integer);
--- error 1241
-select row(1,(2,2)) in (select * from t1 );
--- error 1241
-select row(1,(2,2)) = (select * from t1 );
--- error 1241
-select (select * from t1) = row(1,(2,2));
-drop table t1;
-
-#
-# Forward reference detection
-#
-create table t1 (a integer);
-insert into t1 values (1);
--- error 1247
-select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx ;
--- error 1247
-select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx;
-select 1 as xx, 1 = ALL ( select 1 from t1 where 1 = xx );
--- error 1247
-select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx;
--- error 1247
-select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx from DUAL;
-drop table t1;
-
-#
-# Test for BUG#8218
-#
-CREATE TABLE t1 (
- categoryId int(11) NOT NULL,
- courseId int(11) NOT NULL,
- startDate datetime NOT NULL,
- endDate datetime NOT NULL,
- createDate datetime NOT NULL,
- modifyDate timestamp NOT NULL,
- attributes text NOT NULL
-);
-INSERT INTO t1 VALUES (1,41,'2004-02-09','2010-01-01','2004-02-09','2004-02-09',''),
-(1,86,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''),
-(1,87,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''),
-(2,52,'2004-03-15','2004-10-01','2004-03-15','2004-09-17',''),
-(2,53,'2004-03-16','2004-10-01','2004-03-16','2004-09-17',''),
-(2,88,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''),
-(2,89,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''),
-(3,51,'2004-02-09','2010-01-01','2004-02-09','2004-02-09',''),
-(5,12,'2004-02-18','2010-01-01','2004-02-18','2004-02-18','');
-
-CREATE TABLE t2 (
- userId int(11) NOT NULL,
- courseId int(11) NOT NULL,
- date datetime NOT NULL
-);
-INSERT INTO t2 VALUES (5141,71,'2003-11-18'),
-(5141,72,'2003-11-25'),(5141,41,'2004-08-06'),
-(5141,52,'2004-08-06'),(5141,53,'2004-08-06'),
-(5141,12,'2004-08-06'),(5141,86,'2004-10-21'),
-(5141,87,'2004-10-21'),(5141,88,'2004-10-21'),
-(5141,89,'2004-10-22'),(5141,51,'2004-10-26');
-
-
-CREATE TABLE t3 (
- groupId int(11) NOT NULL,
- parentId int(11) NOT NULL,
- startDate datetime NOT NULL,
- endDate datetime NOT NULL,
- createDate datetime NOT NULL,
- modifyDate timestamp NOT NULL,
- ordering int(11)
-);
-INSERT INTO t3 VALUES (12,9,'1000-01-01','3999-12-31','2004-01-29','2004-01-29',NULL);
-
-CREATE TABLE t4 (
- id int(11) NOT NULL,
- groupTypeId int(11) NOT NULL,
- groupKey varchar(50) NOT NULL,
- name text,
- ordering int(11),
- description text,
- createDate datetime NOT NULL,
- modifyDate timestamp NOT NULL
-);
-INSERT INTO t4 VALUES (9,5,'stationer','stationer',0,'Stationer','2004-01-29','2004-01-29'),
-(12,5,'group2','group2',0,'group2','2004-01-29','2004-01-29');
-
-CREATE TABLE t5 (
- userId int(11) NOT NULL,
- groupId int(11) NOT NULL,
- createDate datetime NOT NULL,
- modifyDate timestamp NOT NULL
-);
-INSERT INTO t5 VALUES (5141,12,'2004-08-06','2004-08-06');
-
-select
- count(distinct t2.userid) pass,
- groupstuff.*,
- count(t2.courseid) crse,
- t1.categoryid,
- t2.courseid,
- date_format(date, '%b%y') as colhead
-from t2
-join t1 on t2.courseid=t1.courseid
-join
-(
- select
- t5.userid,
- parentid,
- parentgroup,
- childid,
- groupname,
- grouptypeid
- from t5
- join
- (
- select t4.id as parentid,
- t4.name as parentgroup,
- t4.id as childid,
- t4.name as groupname,
- t4.grouptypeid
- from t4
- ) as gin on t5.groupid=gin.childid
-) as groupstuff on t2.userid = groupstuff.userid
-group by
- groupstuff.groupname, colhead , t2.courseid;
-
-drop table t1, t2, t3, t4, t5;
-
-#
-# Transformation in left expression of subquery (BUG#8888)
-#
-create table t1 (a int);
-insert into t1 values (1), (2), (3);
-SELECT 1 FROM t1 WHERE (SELECT 1) in (SELECT 1);
-drop table t1;
-
-#
-# subselect into HAVING clause (code covarage improvement)
-#
-create table t1 (a int);
-create table t2 (a int);
-insert into t1 values (1),(2);
-insert into t2 values (0),(1),(2),(3);
-select a from t2 where a in (select a from t1);
-select a from t2 having a in (select a from t1);
-prepare stmt1 from "select a from t2 where a in (select a from t1)";
-execute stmt1;
-execute stmt1;
-deallocate prepare stmt1;
-prepare stmt1 from "select a from t2 having a in (select a from t1)";
-execute stmt1;
-execute stmt1;
-deallocate prepare stmt1;
-drop table t1, t2;
-
-#
-# single row subqueries and row operations (code covarage improvement)
-#
-create table t1 (a int, b int);
-insert into t1 values (1,2);
--- error 1241
-select 1 = (select * from t1);
--- error 1241
-select (select * from t1) = 1;
--- error 1241
-select (1,2) = (select a from t1);
--- error 1241
-select (select a from t1) = (1,2);
--- error 1241
-select (1,2,3) = (select * from t1);
--- error 1241
-select (select * from t1) = (1,2,3);
-drop table t1;
-
-#
-# Item_int_with_ref check (BUG#10020)
-#
-CREATE TABLE `t1` (
- `itemid` bigint(20) unsigned NOT NULL auto_increment,
- `sessionid` bigint(20) unsigned default NULL,
- `time` int(10) unsigned NOT NULL default '0',
- `type` set('A','D','E','F','G','I','L','N','U') collate latin1_general_ci NOT
-NULL default '',
- `data` text collate latin1_general_ci NOT NULL,
- PRIMARY KEY (`itemid`)
-) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
-INSERT INTO `t1` VALUES (1, 1, 1, 'D', '');
-CREATE TABLE `t2` (
- `sessionid` bigint(20) unsigned NOT NULL auto_increment,
- `pid` int(10) unsigned NOT NULL default '0',
- `date` int(10) unsigned NOT NULL default '0',
- `ip` varchar(15) collate latin1_general_ci NOT NULL default '',
- PRIMARY KEY (`sessionid`)
-) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
-INSERT INTO `t2` VALUES (1, 1, 1, '10.10.10.1');
-SELECT s.ip, count( e.itemid ) FROM `t1` e JOIN t2 s ON s.sessionid = e.sessionid WHERE e.sessionid = ( SELECT sessionid FROM t2 ORDER BY sessionid DESC LIMIT 1 ) GROUP BY s.ip HAVING count( e.itemid ) >0 LIMIT 0 , 30;
-drop tables t1,t2;
-
-# BUG#11821 : Select from subselect using aggregate function on an enum
-# segfaults:
-create table t1 (fld enum('0','1'));
-insert into t1 values ('1');
-select * from (select max(fld) from t1) as foo;
-drop table t1;
-
-#
-# Bug #11867: queries with ROW(,elems>) IN (SELECT DISTINCT <cols> FROM ...)
-#
-
-set @save_optimizer_switch=@@optimizer_switch;
-set @@optimizer_switch="partial_match_rowid_merge=off,partial_match_table_scan=off";
-SET optimizer_switch='semijoin_with_cache=off';
-
-CREATE TABLE t1 (one int, two int, flag char(1));
-CREATE TABLE t2 (one int, two int, flag char(1));
-INSERT INTO t1 VALUES(1,2,'Y'),(2,3,'Y'),(3,4,'Y'),(5,6,'N'),(7,8,'N');
-INSERT INTO t2 VALUES(1,2,'Y'),(2,3,'Y'),(3,4,'Y'),(5,6,'N'),(7,8,'N');
-
-SELECT * FROM t1
- WHERE ROW(one,two) IN (SELECT DISTINCT one,two FROM t2 WHERE flag = 'N');
-SELECT * FROM t1
- WHERE ROW(one,two) IN (SELECT DISTINCT one,two FROM t1 WHERE flag = 'N');
-
-insert into t2 values (null,null,'N');
-insert into t2 values (null,3,'0');
-insert into t2 values (null,5,'0');
-insert into t2 values (10,null,'0');
-insert into t1 values (10,3,'0');
-insert into t1 values (10,5,'0');
-insert into t1 values (10,10,'0');
-SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N') as 'test' from t1;
-SELECT one,two from t1 where ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N');
-SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N' group by one,two) as 'test' from t1;
-SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0') as 'test' from t1;
-SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1;
-explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0') as 'test' from t1;
-explain extended SELECT one,two from t1 where ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N');
-explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1;
-DROP TABLE t1,t2;
-
-set @@optimizer_switch=@save_optimizer_switch;
-
-
-#
-# Bug #12392: where cond with IN predicate for rows and NULL values in table
-#
-
-CREATE TABLE t1 (a char(5), b char(5));
-INSERT INTO t1 VALUES (NULL,'aaa'), ('aaa','aaa');
-
-SELECT * FROM t1 WHERE (a,b) IN (('aaa','aaa'), ('aaa','bbb'));
-
-DROP TABLE t1;
-
-#
-# Bug #11479: subquery over left join with an empty inner table
-#
-
-CREATE TABLE t1 (a int);
-CREATE TABLE t2 (a int, b int);
-CREATE TABLE t3 (b int NOT NULL);
-INSERT INTO t1 VALUES (1), (2), (3), (4);
-INSERT INTO t2 VALUES (1,10), (3,30);
-
-SELECT * FROM t2 LEFT JOIN t3 ON t2.b=t3.b
- WHERE t3.b IS NOT NULL OR t2.a > 10;
-SELECT * FROM t1
- WHERE t1.a NOT IN (SELECT a FROM t2 LEFT JOIN t3 ON t2.b=t3.b
- WHERE t3.b IS NOT NULL OR t2.a > 10);
-
-DROP TABLE t1,t2,t3;
-
-#
-# Bug#18503: Queries with a quantified subquery returning empty set may
-# return a wrong result.
-#
-CREATE TABLE t1 (f1 INT);
-CREATE TABLE t2 (f2 INT);
-INSERT INTO t1 VALUES (1);
-SELECT * FROM t1 WHERE f1 > ALL (SELECT f2 FROM t2);
-SELECT * FROM t1 WHERE f1 > ALL (SELECT f2 FROM t2 WHERE 1=0);
-INSERT INTO t2 VALUES (1);
-INSERT INTO t2 VALUES (2);
-SELECT * FROM t1 WHERE f1 > ALL (SELECT f2 FROM t2 WHERE f2=0);
-DROP TABLE t1, t2;
-
-#
-# Bug#16302: Quantified subquery without any tables gives wrong results
-#
-select 1 from dual where 1 < any (select 2);
-select 1 from dual where 1 < all (select 2);
-select 1 from dual where 2 > any (select 1);
-select 1 from dual where 2 > all (select 1);
-select 1 from dual where 1 < any (select 2 from dual);
-select 1 from dual where 1 < all (select 2 from dual where 1!=1);
-
-# BUG#20975 Wrong query results for subqueries within NOT
-create table t1 (s1 char);
-insert into t1 values (1),(2);
-
-select * from t1 where (s1 < any (select s1 from t1));
-select * from t1 where not (s1 < any (select s1 from t1));
-
-select * from t1 where (s1 < ALL (select s1+1 from t1));
-select * from t1 where not(s1 < ALL (select s1+1 from t1));
-
-select * from t1 where (s1+1 = ANY (select s1 from t1));
-select * from t1 where NOT(s1+1 = ANY (select s1 from t1));
-
-select * from t1 where (s1 = ALL (select s1/s1 from t1));
-select * from t1 where NOT(s1 = ALL (select s1/s1 from t1));
-drop table t1;
-
-#
-# Bug #16255: Subquery in where
-#
-create table t1 (
- retailerID varchar(8) NOT NULL,
- statusID int(10) unsigned NOT NULL,
- changed datetime NOT NULL,
- UNIQUE KEY retailerID (retailerID, statusID, changed)
-);
-
-INSERT INTO t1 VALUES("0026", "1", "2005-12-06 12:18:56");
-INSERT INTO t1 VALUES("0026", "2", "2006-01-06 12:25:53");
-INSERT INTO t1 VALUES("0037", "1", "2005-12-06 12:18:56");
-INSERT INTO t1 VALUES("0037", "2", "2006-01-06 12:25:53");
-INSERT INTO t1 VALUES("0048", "1", "2006-01-06 12:37:50");
-INSERT INTO t1 VALUES("0059", "1", "2006-01-06 12:37:50");
-
-select * from t1 r1
- where (r1.retailerID,(r1.changed)) in
- (SELECT r2.retailerId,(max(changed)) from t1 r2
- group by r2.retailerId);
-drop table t1;
-
-#
-# Bug #21180: Subselect with index for both WHERE and ORDER BY
-# produces empty result
-#
-create table t1(a int, primary key (a));
-insert into t1 values (10);
-
-create table t2 (a int primary key, b varchar(32), c int, unique key b(c, b));
-insert into t2(a, c, b) values (1,10,'359'), (2,10,'35988'), (3,10,'35989');
-
-explain SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r
- ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
- ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10;
-SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r
- ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
- ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10;
-
-explain SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r
- ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
- ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10;
-SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r
- ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
- ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10;
-
-drop table t1,t2;
-
-#
-# Bug #21853: assert failure for a grouping query with
-# an ALL/ANY quantified subquery in HAVING
-#
-
-CREATE TABLE t1 (
- field1 int NOT NULL,
- field2 int NOT NULL,
- field3 int NOT NULL,
- PRIMARY KEY (field1,field2,field3)
-);
-CREATE TABLE t2 (
- fieldA int NOT NULL,
- fieldB int NOT NULL,
- PRIMARY KEY (fieldA,fieldB)
-);
-
-INSERT INTO t1 VALUES
- (1,1,1), (1,1,2), (1,2,1), (1,2,2), (1,2,3), (1,3,1);
-INSERT INTO t2 VALUES (1,1), (1,2), (1,3);
-
-SELECT field1, field2, COUNT(*)
- FROM t1 GROUP BY field1, field2;
-
-SELECT field1, field2
- FROM t1
- GROUP BY field1, field2
- HAVING COUNT(*) >= ALL (SELECT fieldB
- FROM t2 WHERE fieldA = field1);
-SELECT field1, field2
- FROM t1
- GROUP BY field1, field2
- HAVING COUNT(*) < ANY (SELECT fieldB
- FROM t2 WHERE fieldA = field1);
-
-DROP TABLE t1, t2;
-
-#
-# Bug #23478: not top-level IN subquery returning a non-empty result set
-# with possible NULL values by index access from the outer query
-#
-
-set @save_optimizer_switch=@@optimizer_switch;
-set @@optimizer_switch="partial_match_rowid_merge=off,partial_match_table_scan=off";
-
-CREATE TABLE t1(a int, INDEX (a));
-INSERT INTO t1 VALUES (1), (3), (5), (7);
-INSERT INTO t1 VALUES (NULL);
-
-CREATE TABLE t2(a int);
-INSERT INTO t2 VALUES (1),(2),(3);
-
-EXPLAIN SELECT a, a IN (SELECT a FROM t1) FROM t2;
-SELECT a, a IN (SELECT a FROM t1) FROM t2;
-
-DROP TABLE t1,t2;
-
-set @@optimizer_switch=@save_optimizer_switch;
-
-#
-# Bug #11302: getObject() returns a String for a sub-query of type datetime
-#
-CREATE TABLE t1 (a DATETIME);
-INSERT INTO t1 VALUES ('1998-09-23'), ('2003-03-25');
-
-CREATE TABLE t2 AS SELECT
- (SELECT a FROM t1 WHERE a < '2000-01-01') AS sub_a
- FROM t1 WHERE a > '2000-01-01';
-SHOW CREATE TABLE t2;
-
-CREATE TABLE t3 AS (SELECT a FROM t1 WHERE a < '2000-01-01') UNION (SELECT a FROM t1 WHERE a > '2000-01-01');
-SHOW CREATE TABLE t3;
-
-DROP TABLE t1,t2,t3;
-
-#
-# Bug 24670: subquery witout tables but with a WHERE clause
-#
-
-CREATE TABLE t1 (a int);
-INSERT INTO t1 VALUES (1), (2);
-
-SELECT a FROM t1 WHERE (SELECT 1 FROM DUAL WHERE 1=0) > 0;
-SELECT a FROM t1 WHERE (SELECT 1 FROM DUAL WHERE 1=0) IS NULL;
-EXPLAIN SELECT a FROM t1 WHERE (SELECT 1 FROM DUAL WHERE 1=0) IS NULL;
-
-DROP TABLE t1;
-
-#
-# Bug 24653: sorting by expressions containing subselects
-# that return more than one row
-#
-
-CREATE TABLE t1 (a int);
-INSERT INTO t1 VALUES (2), (4), (1), (3);
-
-CREATE TABLE t2 (b int, c int);
-INSERT INTO t2 VALUES
- (2,1), (1,3), (2,1), (4,4), (2,2), (1,4);
-
-SELECT a FROM t1 ORDER BY (SELECT c FROM t2 WHERE b > 2 );
---error 1242
-SELECT a FROM t1 ORDER BY (SELECT c FROM t2 WHERE b > 1);
-SELECT a FROM t1 ORDER BY (SELECT c FROM t2 WHERE b > 2), a;
---error 1242
-SELECT a FROM t1 ORDER BY (SELECT c FROM t2 WHERE b > 1), a;
-
-SELECT b, MAX(c) FROM t2 GROUP BY b, (SELECT c FROM t2 WHERE b > 2);
---error 1242
-SELECT b, MAX(c) FROM t2 GROUP BY b, (SELECT c FROM t2 WHERE b > 1);
-
---sorted_result
-SELECT a FROM t1 GROUP BY a
- HAVING IFNULL((SELECT b FROM t2 WHERE b > 2),
- (SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b)) > 3;
---error 1242
-SELECT a FROM t1 GROUP BY a
- HAVING IFNULL((SELECT b FROM t2 WHERE b > 1),
- (SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b)) > 3;
---sorted_result
-SELECT a FROM t1 GROUP BY a
- HAVING IFNULL((SELECT b FROM t2 WHERE b > 4),
- (SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b)) > 3;
---error 1242
-SELECT a FROM t1 GROUP BY a
- HAVING IFNULL((SELECT b FROM t2 WHERE b > 4),
- (SELECT c FROM t2 WHERE c=a AND b > 1 ORDER BY b)) > 3;
---sorted_result
-SELECT a FROM t1
- ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 2),
- (SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b));
---error 1242
-SELECT a FROM t1
- ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 1),
- (SELECT c FROM t2 WHERE c=a AND b > 1 ORDER BY b));
---sorted_result
-SELECT a FROM t1
- ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 4),
- (SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b));
---error 1242
-SELECT a FROM t1
- ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 4),
- (SELECT c FROM t2 WHERE c=a AND b > 1 ORDER BY b));
-
-DROP TABLE t1,t2;
-
-# End of 4.1 tests
-
-#
-#decimal-related tests
-#
-create table t1 (df decimal(5,1));
-insert into t1 values(1.1);
-insert into t1 values(2.2);
-
-select * from t1 where df <= all (select avg(df) from t1 group by df);
-select * from t1 where df >= all (select avg(df) from t1 group by df);
-drop table t1;
-
-create table t1 (df decimal(5,1));
-insert into t1 values(1.1);
-select 1.1 * exists(select * from t1);
-drop table t1;
-
-CREATE TABLE t1 (
- grp int(11) default NULL,
- a decimal(10,2) default NULL);
-
-insert into t1 values (1, 1), (2, 2), (2, 3), (3, 4), (3, 5), (3, 6), (NULL, NULL);
-select * from t1;
-select min(a) from t1 group by grp;
-drop table t1;
-
-#
-# Test for bug #9338: lame substitution of c1 instead of c2
-#
-
-CREATE table t1 ( c1 integer );
-INSERT INTO t1 VALUES ( 1 );
-INSERT INTO t1 VALUES ( 2 );
-INSERT INTO t1 VALUES ( 3 );
-
-CREATE TABLE t2 ( c2 integer );
-INSERT INTO t2 VALUES ( 1 );
-INSERT INTO t2 VALUES ( 4 );
-INSERT INTO t2 VALUES ( 5 );
-
-SELECT * FROM t1 LEFT JOIN t2 ON c1 = c2 WHERE c2 IN (1);
-
-SELECT * FROM t1 LEFT JOIN t2 ON c1 = c2
- WHERE c2 IN ( SELECT c2 FROM t2 WHERE c2 IN ( 1 ) );
-
-DROP TABLE t1,t2;
-
-#
-# Test for bug #9516: wrong evaluation of not_null_tables attribute in SQ
-#
-CREATE TABLE t1 ( c1 integer );
-INSERT INTO t1 VALUES ( 1 );
-INSERT INTO t1 VALUES ( 2 );
-INSERT INTO t1 VALUES ( 3 );
-INSERT INTO t1 VALUES ( 6 );
-
-CREATE TABLE t2 ( c2 integer );
-INSERT INTO t2 VALUES ( 1 );
-INSERT INTO t2 VALUES ( 4 );
-INSERT INTO t2 VALUES ( 5 );
-INSERT INTO t2 VALUES ( 6 );
-
-CREATE TABLE t3 ( c3 integer );
-INSERT INTO t3 VALUES ( 7 );
-INSERT INTO t3 VALUES ( 8 );
-
-SELECT c1,c2 FROM t1 LEFT JOIN t2 ON c1 = c2
- WHERE EXISTS (SELECT c3 FROM t3 WHERE c2 IS NULL );
-
-DROP TABLE t1,t2,t3;
-
-#
-# Item_int_with_ref check (BUG#10020)
-#
-CREATE TABLE `t1` (
- `itemid` bigint(20) unsigned NOT NULL auto_increment,
- `sessionid` bigint(20) unsigned default NULL,
- `time` int(10) unsigned NOT NULL default '0',
- `type` set('A','D','E','F','G','I','L','N','U') collate latin1_general_ci NOT
-NULL default '',
- `data` text collate latin1_general_ci NOT NULL,
- PRIMARY KEY (`itemid`)
-) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
-INSERT INTO `t1` VALUES (1, 1, 1, 'D', '');
-CREATE TABLE `t2` (
- `sessionid` bigint(20) unsigned NOT NULL auto_increment,
- `pid` int(10) unsigned NOT NULL default '0',
- `date` int(10) unsigned NOT NULL default '0',
- `ip` varchar(15) collate latin1_general_ci NOT NULL default '',
- PRIMARY KEY (`sessionid`)
-) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
-INSERT INTO `t2` VALUES (1, 1, 1, '10.10.10.1');
-SELECT s.ip, count( e.itemid ) FROM `t1` e JOIN t2 s ON s.sessionid = e.sessionid WHERE e.sessionid = ( SELECT sessionid FROM t2 ORDER BY sessionid DESC LIMIT 1 ) GROUP BY s.ip HAVING count( e.itemid ) >0 LIMIT 0 , 30;
-drop tables t1,t2;
-
-#
-# Correct building of equal fields list (do not include outer
-# fields) (BUG#6384)
-#
-CREATE TABLE t1 (EMPNUM CHAR(3));
-CREATE TABLE t2 (EMPNUM CHAR(3) );
-INSERT INTO t1 VALUES ('E1'),('E2');
-INSERT INTO t2 VALUES ('E1');
-DELETE FROM t1
-WHERE t1.EMPNUM NOT IN
- (SELECT t2.EMPNUM
- FROM t2
- WHERE t1.EMPNUM = t2.EMPNUM);
-select * from t1;
-DROP TABLE t1,t2;
-
-#
-# Test for bug #11487: range access in a subquery
-#
-
-CREATE TABLE t1(select_id BIGINT, values_id BIGINT);
-INSERT INTO t1 VALUES (1, 1);
-CREATE TABLE t2 (select_id BIGINT, values_id BIGINT,
- PRIMARY KEY(select_id,values_id));
-INSERT INTO t2 VALUES (0, 1), (0, 2), (0, 3), (1, 5);
-
-SELECT values_id FROM t1
-WHERE values_id IN (SELECT values_id FROM t2
- WHERE select_id IN (1, 0));
-SELECT values_id FROM t1
-WHERE values_id IN (SELECT values_id FROM t2
- WHERE select_id BETWEEN 0 AND 1);
-SELECT values_id FROM t1
-WHERE values_id IN (SELECT values_id FROM t2
- WHERE select_id = 0 OR select_id = 1);
-
-DROP TABLE t1, t2;
-
-# BUG#11821 : Select from subselect using aggregate function on an enum
-# segfaults:
-create table t1 (fld enum('0','1'));
-insert into t1 values ('1');
-select * from (select max(fld) from t1) as foo;
-drop table t1;
-
-#
-# Test for bug #11762: subquery with an aggregate function in HAVING
-#
-
-CREATE TABLE t1 (a int, b int);
-CREATE TABLE t2 (c int, d int);
-CREATE TABLE t3 (e int);
-
-INSERT INTO t1 VALUES
- (1,10), (2,10), (1,20), (2,20), (3,20), (2,30), (4,40);
-INSERT INTO t2 VALUES
- (2,10), (2,20), (4,10), (5,10), (3,20), (2,40);
-INSERT INTO t3 VALUES (10), (30), (10), (20) ;
-
-SELECT a, MAX(b), MIN(b) FROM t1 GROUP BY a;
-SELECT * FROM t2;
-SELECT * FROM t3;
-
-SELECT a FROM t1 GROUP BY a
- HAVING a IN (SELECT c FROM t2 WHERE MAX(b)>20);
-SELECT a FROM t1 GROUP BY a
- HAVING a IN (SELECT c FROM t2 WHERE MAX(b)<d);
-SELECT a FROM t1 GROUP BY a
- HAVING a IN (SELECT c FROM t2 WHERE MAX(b)>d);
-SELECT a FROM t1 GROUP BY a
- HAVING a IN (SELECT c FROM t2
- WHERE d >= SOME(SELECT e FROM t3 WHERE MAX(b)=e));
-SELECT a FROM t1 GROUP BY a
- HAVING a IN (SELECT c FROM t2
- WHERE EXISTS(SELECT e FROM t3 WHERE MAX(b)=e AND e <= d));
-SELECT a FROM t1 GROUP BY a
- HAVING a IN (SELECT c FROM t2
- WHERE d > SOME(SELECT e FROM t3 WHERE MAX(b)=e));
-SELECT a FROM t1 GROUP BY a
- HAVING a IN (SELECT c FROM t2
- WHERE EXISTS(SELECT e FROM t3 WHERE MAX(b)=e AND e < d));
-SELECT a FROM t1 GROUP BY a
- HAVING a IN (SELECT c FROM t2
- WHERE MIN(b) < d AND
- EXISTS(SELECT e FROM t3 WHERE MAX(b)=e AND e <= d));
-
-SELECT a, SUM(a) FROM t1 GROUP BY a;
-
-SELECT a FROM t1
- WHERE EXISTS(SELECT c FROM t2 GROUP BY c HAVING SUM(a) = c) GROUP BY a;
-SELECT a FROM t1 GROUP BY a
- HAVING EXISTS(SELECT c FROM t2 GROUP BY c HAVING SUM(a) = c);
-
-SELECT a FROM t1
- WHERE a < 3 AND
- EXISTS(SELECT c FROM t2 GROUP BY c HAVING SUM(a) != c) GROUP BY a;
-SELECT a FROM t1
- WHERE a < 3 AND
- EXISTS(SELECT c FROM t2 GROUP BY c HAVING SUM(a) != c);
-
-SELECT t1.a FROM t1 GROUP BY t1.a
- HAVING t1.a < ALL(SELECT t2.c FROM t2 GROUP BY t2.c
- HAVING EXISTS(SELECT t3.e FROM t3 GROUP BY t3.e
- HAVING SUM(t1.a+t2.c) < t3.e/4));
-SELECT t1.a FROM t1 GROUP BY t1.a
- HAVING t1.a > ALL(SELECT t2.c FROM t2
- WHERE EXISTS(SELECT t3.e FROM t3 GROUP BY t3.e
- HAVING SUM(t1.a+t2.c) < t3.e/4));
--- error 1111
-SELECT t1.a FROM t1 GROUP BY t1.a
- HAVING t1.a > ALL(SELECT t2.c FROM t2
- WHERE EXISTS(SELECT t3.e FROM t3
- WHERE SUM(t1.a+t2.c) < t3.e/4));
--- error 1111
-SELECT t1.a from t1 GROUP BY t1.a HAVING AVG(SUM(t1.b)) > 20;
-
-SELECT t1.a FROM t1 GROUP BY t1.a
- HAVING t1.a IN (SELECT t2.c FROM t2 GROUP BY t2.c
- HAVING AVG(t2.c+SUM(t1.b)) > 20);
-SELECT t1.a FROM t1 GROUP BY t1.a
- HAVING t1.a IN (SELECT t2.c FROM t2 GROUP BY t2.c
- HAVING AVG(SUM(t1.b)) > 20);
-
-SELECT t1.a, SUM(b) AS sum FROM t1 GROUP BY t1.a
- HAVING t1.a IN (SELECT t2.c FROM t2 GROUP BY t2.c
- HAVING t2.c+sum > 20);
-
-DROP TABLE t1,t2,t3;
-
-#
-# Test for bug #16603: GROUP BY in a row subquery with a quantifier
-# when an index is defined on the grouping field
-
-CREATE TABLE t1 (a varchar(5), b varchar(10));
-INSERT INTO t1 VALUES
- ('AAA', 5), ('BBB', 4), ('BBB', 1), ('CCC', 2),
- ('CCC', 7), ('AAA', 2), ('AAA', 4), ('BBB', 3), ('AAA', 8);
-
-SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a);
-EXPLAIN
-SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a);
-
-ALTER TABLE t1 ADD INDEX(a);
-
-SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a);
-EXPLAIN
-SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a);
-
-DROP TABLE t1;
-
-#
-# Bug#17366: Unchecked Item_int results in server crash
-#
-create table t1( f1 int,f2 int);
-insert into t1 values (1,1),(2,2);
-select tt.t from (select 'crash1' as t, f2 from t1) as tt left join t1 on tt.t = 'crash2' and tt.f2 = t1.f2 where tt.t = 'crash1';
-drop table t1;
-
-#
-# Bug #18306: server crash on delete using subquery.
-#
-
-create table t1 (c int, key(c));
-insert into t1 values (1142477582), (1142455969);
-create table t2 (a int, b int);
-insert into t2 values (2, 1), (1, 0);
-delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1;
-drop table t1, t2;
-
-#
-# Bug #7549: Missing error message for invalid view selection with subquery
-#
-
-CREATE TABLE t1 (a INT);
-
---error 1054
-CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
---error 1054
-CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1);
---error 1054
-SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1);
-
-DROP TABLE t1;
-
-#
-# Bug#19077: A nested materialized derived table is used before being populated.
-#
-create table t1 (i int, j bigint);
-insert into t1 values (1, 2), (2, 2), (3, 2);
-select * from (select min(i) from t1 where j=(select * from (select min(j) from t1) t2)) t3;
-drop table t1;
-
-#
-# Bug#19700: subselect returning BIGINT always returned it as SIGNED
-#
-CREATE TABLE t1 (i BIGINT UNSIGNED);
-INSERT INTO t1 VALUES (10000000000000000000); # > MAX SIGNED BIGINT 9323372036854775807
-INSERT INTO t1 VALUES (1);
-
-CREATE TABLE t2 (i BIGINT UNSIGNED);
-INSERT INTO t2 VALUES (10000000000000000000); # same as first table
-INSERT INTO t2 VALUES (1);
-
-/* simple test */
-SELECT t1.i FROM t1 JOIN t2 ON t1.i = t2.i;
-
-/* subquery test */
-SELECT t1.i FROM t1 WHERE t1.i = (SELECT MAX(i) FROM t2);
-
-/* subquery test with cast*/
-SELECT t1.i FROM t1 WHERE t1.i = CAST((SELECT MAX(i) FROM t2) AS UNSIGNED);
-
-DROP TABLE t1;
-DROP TABLE t2;
-
-#
-# Bug#20519: subselect with LIMIT M, N
-#
-
-CREATE TABLE t1 (
- id bigint(20) unsigned NOT NULL auto_increment,
- name varchar(255) NOT NULL,
- PRIMARY KEY (id)
-);
-INSERT INTO t1 VALUES
- (1, 'Balazs'), (2, 'Joe'), (3, 'Frank');
-
-CREATE TABLE t2 (
- id bigint(20) unsigned NOT NULL auto_increment,
- mid bigint(20) unsigned NOT NULL,
- date date NOT NULL,
- PRIMARY KEY (id)
-);
-INSERT INTO t2 VALUES
- (1, 1, '2006-03-30'), (2, 2, '2006-04-06'), (3, 3, '2006-04-13'),
- (4, 2, '2006-04-20'), (5, 1, '2006-05-01');
-
-SELECT *,
- (SELECT date FROM t2 WHERE mid = t1.id
- ORDER BY date DESC LIMIT 0, 1) AS date_last,
- (SELECT date FROM t2 WHERE mid = t1.id
- ORDER BY date DESC LIMIT 3, 1) AS date_next_to_last
- FROM t1;
-SELECT *,
- (SELECT COUNT(*) FROM t2 WHERE mid = t1.id
- ORDER BY date DESC LIMIT 1, 1) AS date_count
- FROM t1;
-SELECT *,
- (SELECT date FROM t2 WHERE mid = t1.id
- ORDER BY date DESC LIMIT 0, 1) AS date_last,
- (SELECT date FROM t2 WHERE mid = t1.id
- ORDER BY date DESC LIMIT 1, 1) AS date_next_to_last
- FROM t1;
-DROP TABLE t1,t2;
-
-#
-# Bug#20869: subselect with range access by DESC
-#
-
-CREATE TABLE t1 (
- i1 int(11) NOT NULL default '0',
- i2 int(11) NOT NULL default '0',
- t datetime NOT NULL default '0000-00-00 00:00:00',
- PRIMARY KEY (i1,i2,t)
-);
-INSERT INTO t1 VALUES
-(24,1,'2005-03-03 16:31:31'),(24,1,'2005-05-27 12:40:07'),
-(24,1,'2005-05-27 12:40:08'),(24,1,'2005-05-27 12:40:10'),
-(24,1,'2005-05-27 12:40:25'),(24,1,'2005-05-27 12:40:30'),
-(24,2,'2005-03-03 13:43:05'),(24,2,'2005-03-03 16:23:31'),
-(24,2,'2005-03-03 16:31:30'),(24,2,'2005-05-27 12:37:02'),
-(24,2,'2005-05-27 12:40:06');
-
-CREATE TABLE t2 (
- i1 int(11) NOT NULL default '0',
- i2 int(11) NOT NULL default '0',
- t datetime default NULL,
- PRIMARY KEY (i1)
-);
-INSERT INTO t2 VALUES (24,1,'2006-06-20 12:29:40');
-
-EXPLAIN
-SELECT * FROM t1,t2
- WHERE t1.t = (SELECT t1.t FROM t1
- WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1
- ORDER BY t1.t DESC LIMIT 1);
-SELECT * FROM t1,t2
- WHERE t1.t = (SELECT t1.t FROM t1
- WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1
- ORDER BY t1.t DESC LIMIT 1);
-
-DROP TABLE t1, t2;
-
-#
-# Bug#14654 : Cannot select from the same table twice within a UNION
-# statement
-#
-CREATE TABLE t1 (i INT);
-
-(SELECT i FROM t1) UNION (SELECT i FROM t1);
-SELECT sql_no_cache * FROM t1 WHERE NOT EXISTS
- (
- (SELECT i FROM t1) UNION
- (SELECT i FROM t1)
- );
-
-#TODO:not supported
---error ER_PARSE_ERROR
-SELECT * FROM t1
-WHERE NOT EXISTS (((SELECT i FROM t1) UNION (SELECT i FROM t1)));
-
-#TODO:not supported
---error 1064
-explain select ((select t11.i from t1 t11) union (select t12.i from t1 t12))
- from t1;
-
-explain select * from t1 where not exists
- ((select t11.i from t1 t11) union (select t12.i from t1 t12));
-
-DROP TABLE t1;
-
-#
-# Bug#21798: memory leak during query execution with subquery in column
-# list using a function
-#
-CREATE TABLE t1 (a VARCHAR(250), b INT auto_increment, PRIMARY KEY (b));
-insert into t1 (a) values (FLOOR(rand() * 100));
-insert into t1 (a) select FLOOR(rand() * 100) from t1;
-insert into t1 (a) select FLOOR(rand() * 100) from t1;
-insert into t1 (a) select FLOOR(rand() * 100) from t1;
-insert into t1 (a) select FLOOR(rand() * 100) from t1;
-insert into t1 (a) select FLOOR(rand() * 100) from t1;
-insert into t1 (a) select FLOOR(rand() * 100) from t1;
-insert into t1 (a) select FLOOR(rand() * 100) from t1;
-insert into t1 (a) select FLOOR(rand() * 100) from t1;
-insert into t1 (a) select FLOOR(rand() * 100) from t1;
-insert into t1 (a) select FLOOR(rand() * 100) from t1;
-insert into t1 (a) select FLOOR(rand() * 100) from t1;
-insert into t1 (a) select FLOOR(rand() * 100) from t1;
-insert into t1 (a) select FLOOR(rand() * 100) from t1;
-
-SELECT a,
- (SELECT REPEAT(' ',250) FROM t1 i1
- WHERE i1.b=t1.a ORDER BY RAND() LIMIT 1) AS a
-FROM t1 ORDER BY a LIMIT 5;
-DROP TABLE t1;
-
-#
-# Bug #21540: Subqueries with no from and aggregate functions return
-# wrong results
-CREATE TABLE t1 (a INT, b INT);
-CREATE TABLE t2 (a INT);
-INSERT INTO t2 values (1);
-INSERT INTO t1 VALUES (1,1),(1,2),(2,3),(3,4);
-SELECT (SELECT COUNT(DISTINCT t1.b) from t2) FROM t1 GROUP BY t1.a;
-SELECT (SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3)
- FROM t1 GROUP BY t1.a;
-SELECT COUNT(DISTINCT t1.b), (SELECT COUNT(DISTINCT t1.b)) FROM t1 GROUP BY t1.a;
-SELECT COUNT(DISTINCT t1.b),
- (SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3)
- FROM t1 GROUP BY t1.a;
-SELECT (
- SELECT (
- SELECT COUNT(DISTINCT t1.b)
- )
-)
-FROM t1 GROUP BY t1.a;
-SELECT (
- SELECT (
- SELECT (
- SELECT COUNT(DISTINCT t1.b)
- )
- )
- FROM t1 GROUP BY t1.a LIMIT 1)
-FROM t1 t2
-GROUP BY t2.a;
-DROP TABLE t1,t2;
-
-#
-# Bug #21727: Correlated subquery that requires filesort:
-# slow with big sort_buffer_size
-#
-
-CREATE TABLE t1 (a int, b int auto_increment, PRIMARY KEY (b));
-CREATE TABLE t2 (x int auto_increment, y int, z int,
- PRIMARY KEY (x), FOREIGN KEY (y) REFERENCES t1 (b));
-
-disable_query_log;
-begin;
-let $1=3000;
-while ($1)
-{
- eval INSERT INTO t1(a) VALUES(RAND()*1000);
- eval SELECT MAX(b) FROM t1 INTO @id;
- let $2=10;
- while ($2)
- {
- eval INSERT INTO t2(y,z) VALUES(@id,RAND()*1000);
- dec $2;
- }
- dec $1;
-}
-commit;
-enable_query_log;
-
-SET SESSION sort_buffer_size = 32 * 1024;
-SELECT SQL_NO_CACHE COUNT(*)
- FROM (SELECT a, b, (SELECT x FROM t2 WHERE y=b ORDER BY z DESC LIMIT 1) c
- FROM t1) t;
-
-SET SESSION sort_buffer_size = 8 * 1024 * 1024;
-SELECT SQL_NO_CACHE COUNT(*)
- FROM (SELECT a, b, (SELECT x FROM t2 WHERE y=b ORDER BY z DESC LIMIT 1) c
- FROM t1) t;
-
-DROP TABLE t2,t1;
-
-#
-# Bug #25219: EXIST subquery with UNION over a mix of
-# correlated and uncorrelated selects
-#
-
-CREATE TABLE t1 (id char(4) PRIMARY KEY, c int);
-CREATE TABLE t2 (c int);
-
-INSERT INTO t1 VALUES ('aa', 1);
-INSERT INTO t2 VALUES (1);
-
-SELECT * FROM t1
- WHERE EXISTS (SELECT c FROM t2 WHERE c=1
- UNION
- SELECT c from t2 WHERE c=t1.c);
-
-INSERT INTO t1 VALUES ('bb', 2), ('cc', 3), ('dd',1);
-
-SELECT * FROM t1
- WHERE EXISTS (SELECT c FROM t2 WHERE c=1
- UNION
- SELECT c from t2 WHERE c=t1.c);
-
-INSERT INTO t2 VALUES (2);
-CREATE TABLE t3 (c int);
-INSERT INTO t3 VALUES (1);
-
-SELECT * FROM t1
- WHERE EXISTS (SELECT t2.c FROM t2 JOIN t3 ON t2.c=t3.c WHERE t2.c=1
- UNION
- SELECT c from t2 WHERE c=t1.c);
-
-DROP TABLE t1,t2,t3;
-
-#
-# Bug#23800: Outer fields in correlated subqueries is used in a temporary
-# table created for sorting.
-#
-CREATE TABLE t1(f1 int);
-CREATE TABLE t2(f2 int, f21 int, f3 timestamp);
-INSERT INTO t1 VALUES (1),(1),(2),(2);
-INSERT INTO t2 VALUES (1,1,"2004-02-29 11:11:11"), (2,2,"2004-02-29 11:11:11");
-SELECT ((SELECT f2 FROM t2 WHERE f21=f1 LIMIT 1) * COUNT(f1)) AS sq FROM t1 GROUP BY f1;
-SELECT (SELECT SUM(1) FROM t2 ttt GROUP BY t2.f3 LIMIT 1) AS tt FROM t2;
-PREPARE stmt1 FROM 'SELECT ((SELECT f2 FROM t2 WHERE f21=f1 LIMIT 1) * COUNT(f1)) AS sq FROM t1 GROUP BY f1';
-EXECUTE stmt1;
-EXECUTE stmt1;
-DEALLOCATE PREPARE stmt1;
-SELECT f2, AVG(f21),
- (SELECT t.f3 FROM t2 AS t WHERE t2.f2=t.f2 AND t.f3=MAX(t2.f3)) AS test
- FROM t2 GROUP BY f2;
-DROP TABLE t1,t2;
-CREATE TABLE t1 (a int, b INT, c CHAR(10) NOT NULL);
-INSERT INTO t1 VALUES
- (1,1,'a'), (1,2,'b'), (1,3,'c'), (1,4,'d'), (1,5,'e'),
- (2,1,'f'), (2,2,'g'), (2,3,'h'), (3,4,'i'), (3,3,'j'),
- (3,2,'k'), (3,1,'l'), (1,9,'m');
-SELECT a, MAX(b),
- (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b)) AS test
- FROM t1 GROUP BY a;
-DROP TABLE t1;
-
-#
-# Bug#21904 (parser problem when using IN with a double "(())")
-#
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t2;
-DROP TABLE IF EXISTS t1xt2;
---enable_warnings
-
-CREATE TABLE t1 (
- id_1 int(5) NOT NULL,
- t varchar(4) DEFAULT NULL
-);
-
-CREATE TABLE t2 (
- id_2 int(5) NOT NULL,
- t varchar(4) DEFAULT NULL
-);
-
-CREATE TABLE t1xt2 (
- id_1 int(5) NOT NULL,
- id_2 int(5) NOT NULL
-);
-
-INSERT INTO t1 VALUES (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd');
-
-INSERT INTO t2 VALUES (2, 'bb'), (3, 'cc'), (4, 'dd'), (12, 'aa');
-
-INSERT INTO t1xt2 VALUES (2, 2), (3, 3), (4, 4);
-
-# subselect returns 0 rows
-
-SELECT DISTINCT t1.id_1 FROM t1 WHERE
-(12 IN (SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1));
-
-SELECT DISTINCT t1.id_1 FROM t1 WHERE
-(12 IN ((SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1)));
-
-SELECT DISTINCT t1.id_1 FROM t1 WHERE
-(12 IN (((SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1))));
-
-SELECT DISTINCT t1.id_1 FROM t1 WHERE
-(12 NOT IN (SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1));
-
-SELECT DISTINCT t1.id_1 FROM t1 WHERE
-(12 NOT IN ((SELECT t1xt2.id_2 FROM t1xt2 where t1.id_1 = t1xt2.id_1)));
-
-SELECT DISTINCT t1.id_1 FROM t1 WHERE
-(12 NOT IN (((SELECT t1xt2.id_2 FROM t1xt2 where t1.id_1 = t1xt2.id_1))));
-
-insert INTO t1xt2 VALUES (1, 12);
-
-# subselect returns 1 row
-
-SELECT DISTINCT t1.id_1 FROM t1 WHERE
-(12 IN (SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1));
-
-SELECT DISTINCT t1.id_1 FROM t1 WHERE
-(12 IN ((SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1)));
-
-SELECT DISTINCT t1.id_1 FROM t1 WHERE
-(12 IN (((SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1))));
-
-SELECT DISTINCT t1.id_1 FROM t1 WHERE
-(12 NOT IN (SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1));
-
-SELECT DISTINCT t1.id_1 FROM t1 WHERE
-(12 NOT IN ((SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1)));
-
-SELECT DISTINCT t1.id_1 FROM t1 WHERE
-(12 NOT IN (((SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1))));
-
-insert INTO t1xt2 VALUES (2, 12);
-
-# subselect returns more than 1 row
-
-SELECT DISTINCT t1.id_1 FROM t1 WHERE
-(12 IN (SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1));
-
-SELECT DISTINCT t1.id_1 FROM t1 WHERE
-(12 IN ((SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1)));
-
-SELECT DISTINCT t1.id_1 FROM t1 WHERE
-(12 IN (((SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1))));
-
-SELECT DISTINCT t1.id_1 FROM t1 WHERE
-(12 NOT IN (SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1));
-
-SELECT DISTINCT t1.id_1 FROM t1 WHERE
-(12 NOT IN ((SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1)));
-
-SELECT DISTINCT t1.id_1 FROM t1 WHERE
-(12 NOT IN (((SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1))));
-
-DROP TABLE t1;
-DROP TABLE t2;
-DROP TABLE t1xt2;
-
-#
-# Bug #26728: derived table with concatanation of literals in select list
-#
-
-CREATE TABLE t1 (a int);
-INSERT INTO t1 VALUES (3), (1), (2);
-
-SELECT 'this is ' 'a test.' AS col1, a AS col2 FROM t1;
-SELECT * FROM (SELECT 'this is ' 'a test.' AS col1, a AS t2 FROM t1) t;
-
-DROP table t1;
-
-#
-# Bug #27257: COUNT(*) aggregated in outer query
-#
-
-CREATE TABLE t1 (a int, b int);
-CREATE TABLE t2 (m int, n int);
-INSERT INTO t1 VALUES (2,2), (2,2), (3,3), (3,3), (3,3), (4,4);
-INSERT INTO t2 VALUES (1,11), (2,22), (3,32), (4,44), (4,44);
-
-SELECT COUNT(*), a,
- (SELECT m FROM t2 WHERE m = count(*) LIMIT 1)
- FROM t1 GROUP BY a;
-
-SELECT COUNT(*), a,
- (SELECT MIN(m) FROM t2 WHERE m = count(*))
- FROM t1 GROUP BY a;
-
-SELECT COUNT(*), a
- FROM t1 GROUP BY a
- HAVING (SELECT MIN(m) FROM t2 WHERE m = count(*)) > 1;
-
-DROP TABLE t1,t2;
-
-#
-# Bug #27229: GROUP_CONCAT in subselect with COUNT() as an argument
-#
-
-CREATE TABLE t1 (a int, b int);
-CREATE TABLE t2 (m int, n int);
-INSERT INTO t1 VALUES (2,2), (2,2), (3,3), (3,3), (3,3), (4,4);
-INSERT INTO t2 VALUES (1,11), (2,22), (3,32), (4,44), (4,44);
-
-SELECT COUNT(*) c, a,
- (SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a)
- FROM t1 GROUP BY a;
-
-SELECT COUNT(*) c, a,
- (SELECT GROUP_CONCAT(COUNT(a)+1) FROM t2 WHERE m = a)
- FROM t1 GROUP BY a;
-
-DROP table t1,t2;
-
-#
-# Bug#27321: Wrong subquery result in a grouping select
-#
-CREATE TABLE t1 (a int, b INT, d INT, c CHAR(10) NOT NULL, PRIMARY KEY (a, b));
-INSERT INTO t1 VALUES (1,1,0,'a'), (1,2,0,'b'), (1,3,0,'c'), (1,4,0,'d'),
-(1,5,0,'e'), (2,1,0,'f'), (2,2,0,'g'), (2,3,0,'h'), (3,4,0,'i'), (3,3,0,'j'),
-(3,2,0,'k'), (3,1,0,'l'), (1,9,0,'m'), (1,0,10,'n'), (2,0,5,'o'), (3,0,7,'p');
-
-SELECT a, MAX(b),
- (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b + 0)) as test
- FROM t1 GROUP BY a;
-SELECT a x, MAX(b),
- (SELECT t.c FROM t1 AS t WHERE x=t.a AND t.b=MAX(t1.b + 0)) as test
- FROM t1 GROUP BY a;
-SELECT a, AVG(b),
- (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=AVG(t1.b)) AS test
- FROM t1 WHERE t1.d=0 GROUP BY a;
-
-SELECT tt.a,
- (SELECT (SELECT c FROM t1 as t WHERE t1.a=t.a AND t.d=MAX(t1.b + tt.a)
- LIMIT 1) FROM t1 WHERE t1.a=tt.a GROUP BY a LIMIT 1) as test
- FROM t1 as tt;
-
-SELECT tt.a,
- (SELECT (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.d=MAX(t1.b + tt.a)
- LIMIT 1)
- FROM t1 WHERE t1.a=tt.a GROUP BY a LIMIT 1) as test
- FROM t1 as tt GROUP BY tt.a;
-
-SELECT tt.a, MAX(
- (SELECT (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.d=MAX(t1.b + tt.a)
- LIMIT 1)
- FROM t1 WHERE t1.a=tt.a GROUP BY a LIMIT 1)) as test
- FROM t1 as tt GROUP BY tt.a;
-
-DROP TABLE t1;
-#
-# Bug #27348: SET FUNCTION used in a subquery from WHERE condition
-#
-
-CREATE TABLE t1 (a int, b int);
-INSERT INTO t1 VALUES (2,22),(1,11),(2,22);
-
-SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 0 GROUP BY a;
-SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 1 GROUP BY a;
-
-SELECT a FROM t1 t0
- WHERE (SELECT COUNT(t0.b) FROM t1 t WHERE t.b>20) GROUP BY a;
-
-SET @@sql_mode='ansi';
---error 1111
-SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 0 GROUP BY a;
---error 1111
-SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 1 GROUP BY a;
-
---error 1111
-SELECT a FROM t1 t0
- WHERE (SELECT COUNT(t0.b) FROM t1 t WHERE t.b>20) GROUP BY a;
-
-SET @@sql_mode=default;
-
-DROP TABLE t1;
-
-#
-# Bug #27363: nested aggregates in outer, subquery / sum(select
-# count(outer))
-#
-CREATE TABLE t1 (a INT); INSERT INTO t1 values (1),(1),(1),(1);
-CREATE TABLE t2 (x INT); INSERT INTO t1 values (1000),(1001),(1002);
-
---error ER_INVALID_GROUP_FUNC_USE
-SELECT SUM( (SELECT COUNT(a) FROM t2) ) FROM t1;
---error ER_INVALID_GROUP_FUNC_USE
-SELECT SUM( (SELECT SUM(COUNT(a)) FROM t2) ) FROM t1;
-SELECT COUNT(1) FROM DUAL;
-
---error ER_INVALID_GROUP_FUNC_USE
-SELECT SUM( (SELECT AVG( (SELECT t1.a FROM t2) ) FROM DUAL) ) FROM t1;
-
---error ER_INVALID_GROUP_FUNC_USE
-SELECT
- SUM( (SELECT AVG( (SELECT COUNT(*) FROM t1 t HAVING t1.a < 12) ) FROM t2) )
-FROM t1;
-
---error ER_INVALID_GROUP_FUNC_USE
-SELECT t1.a as XXA,
- SUM( (SELECT AVG( (SELECT COUNT(*) FROM t1 t HAVING XXA < 12) ) FROM t2) )
-FROM t1;
-
-DROP TABLE t1,t2;
-
-#
-# Bug #27807: Server crash when executing subquery with EXPLAIN
-#
-CREATE TABLE t1 (a int, b int, KEY (a));
-INSERT INTO t1 VALUES (1,1),(2,1);
-EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b);
-DROP TABLE t1;
-
-#
-# Bug #28377: grouping query with a correlated subquery in WHERE condition
-#
-
-CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id));
-INSERT INTO t1 VALUES
- (3,'FL'), (2,'GA'), (4,'FL'), (1,'GA'), (5,'NY'), (7,'FL'), (6,'NY');
-CREATE TABLE t2 (id int NOT NULL, INDEX idx(id));
-INSERT INTO t2 VALUES (7), (5), (1), (3);
-
-SELECT id, st FROM t1
- WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id);
-SELECT id, st FROM t1
- WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id)
- GROUP BY id;
-
-SELECT id, st FROM t1
- WHERE st IN ('GA','FL') AND NOT EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id);
-SELECT id, st FROM t1
- WHERE st IN ('GA','FL') AND NOT EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id)
- GROUP BY id;
-
-DROP TABLE t1,t2;
-
-#
-# Bug #28728: crash with EXPLAIN EXTENDED for a query with a derived table
-# over a grouping subselect
-#
-
-CREATE TABLE t1 (a int);
-
-INSERT INTO t1 VALUES (1), (2);
-
-EXPLAIN EXTENDED
-SELECT * FROM (SELECT count(*) FROM t1 GROUP BY a) as res;
-
-DROP TABLE t1;
-
-#
-# Bug #28811: crash for query containing subquery with ORDER BY and LIMIT 1
-#
-
-CREATE TABLE t1 (
- a varchar(255) default NULL,
- b timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
- INDEX idx(a,b)
-);
-CREATE TABLE t2 (
- a varchar(255) default NULL
-);
-
-INSERT INTO t1 VALUES ('abcdefghijk','2007-05-07 06:00:24');
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO `t1` VALUES ('asdf','2007-02-08 01:11:26');
-INSERT INTO `t2` VALUES ('abcdefghijk');
-INSERT INTO `t2` VALUES ('asdf');
-
-SET session sort_buffer_size=8192;
-
-SELECT (SELECT 1 FROM t1 WHERE t1.a=t2.a ORDER BY t1.b LIMIT 1) AS d1 FROM t2;
-
-DROP TABLE t1,t2;
-
-
-#
-# Bug #27333: subquery grouped for aggregate of outer query / no aggregate
-# of subquery
-#
-CREATE TABLE t1 (a INTEGER, b INTEGER);
-CREATE TABLE t2 (x INTEGER);
-INSERT INTO t1 VALUES (1,11), (2,22), (2,22);
-INSERT INTO t2 VALUES (1), (2);
-
-# wasn't failing, but should
---error ER_SUBQUERY_NO_1_ROW
-SELECT a, COUNT(b), (SELECT COUNT(b) FROM t2) FROM t1 GROUP BY a;
-
-# fails as it should
---error ER_SUBQUERY_NO_1_ROW
-SELECT a, COUNT(b), (SELECT COUNT(b)+0 FROM t2) FROM t1 GROUP BY a;
-
-SELECT (SELECT SUM(t1.a)/AVG(t2.x) FROM t2) FROM t1;
-DROP TABLE t1,t2;
-
-# second test case from 27333
-CREATE TABLE t1 (a INT, b INT);
-INSERT INTO t1 VALUES (1, 2), (1,3), (1,4), (2,1), (2,2);
-
-# returns no rows, when it should
-SELECT a1.a, COUNT(*) FROM t1 a1 WHERE a1.a = 1
-AND EXISTS( SELECT a2.a FROM t1 a2 WHERE a2.a = a1.a)
-GROUP BY a1.a;
-DROP TABLE t1;
-
-#test cases from 29297
-CREATE TABLE t1 (a INT);
-CREATE TABLE t2 (a INT);
-INSERT INTO t1 VALUES (1),(2);
-INSERT INTO t2 VALUES (1),(2);
-SELECT (SELECT SUM(t1.a) FROM t2 WHERE a=0) FROM t1;
---error ER_SUBQUERY_NO_1_ROW
-SELECT (SELECT SUM(t1.a) FROM t2 WHERE a!=0) FROM t1;
-SELECT (SELECT SUM(t1.a) FROM t2 WHERE a=1) FROM t1;
-DROP TABLE t1,t2;
-
-#
-# Bug #31884: Assertion + crash in subquery in the SELECT clause.
-#
-
-CREATE TABLE t1 (a1 INT, a2 INT);
-CREATE TABLE t2 (b1 INT, b2 INT);
-
-INSERT INTO t1 VALUES (100, 200);
-INSERT INTO t1 VALUES (101, 201);
-INSERT INTO t2 VALUES (101, 201);
-INSERT INTO t2 VALUES (103, 203);
-
-SELECT ((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL FROM t1;
-DROP TABLE t1, t2;
-
-#
-# Bug #28076: inconsistent binary/varbinary comparison
-#
-
-CREATE TABLE t1 (s1 BINARY(5), s2 VARBINARY(5));
-INSERT INTO t1 VALUES (0x41,0x41), (0x42,0x42), (0x43,0x43);
-
-SELECT s1, s2 FROM t1 WHERE s2 IN (SELECT s1 FROM t1);
-SELECT s1, s2 FROM t1 WHERE (s2, 10) IN (SELECT s1, 10 FROM t1);
-
-CREATE INDEX I1 ON t1 (s1);
-CREATE INDEX I2 ON t1 (s2);
-
-SELECT s1, s2 FROM t1 WHERE s2 IN (SELECT s1 FROM t1);
-SELECT s1, s2 FROM t1 WHERE (s2, 10) IN (SELECT s1, 10 FROM t1);
-
-TRUNCATE t1;
-INSERT INTO t1 VALUES (0x41,0x41);
-SELECT * FROM t1 WHERE s1 = (SELECT s2 FROM t1);
-
-DROP TABLE t1;
-
-CREATE TABLE t1 (a1 VARBINARY(2) NOT NULL DEFAULT '0', PRIMARY KEY (a1));
-CREATE TABLE t2 (a2 BINARY(2) default '0', INDEX (a2));
-CREATE TABLE t3 (a3 BINARY(2) default '0');
-INSERT INTO t1 VALUES (1),(2),(3),(4);
-INSERT INTO t2 VALUES (1),(2),(3);
-INSERT INTO t3 VALUES (1),(2),(3);
-SELECT LEFT(t2.a2, 1) FROM t2,t3 WHERE t3.a3=t2.a2;
-SELECT t1.a1, t1.a1 in (SELECT t2.a2 FROM t2,t3 WHERE t3.a3=t2.a2) FROM t1;
-DROP TABLE t1,t2,t3;
-
-CREATE TABLE t1 (a1 BINARY(3) PRIMARY KEY, b1 VARBINARY(3));
-CREATE TABLE t2 (a2 VARBINARY(3) PRIMARY KEY);
-CREATE TABLE t3 (a3 VARBINARY(3) PRIMARY KEY);
-INSERT INTO t1 VALUES (1,10), (2,20), (3,30), (4,40);
-INSERT INTO t2 VALUES (2), (3), (4), (5);
-INSERT INTO t3 VALUES (10), (20), (30);
-SELECT LEFT(t1.a1,1) FROM t1,t3 WHERE t1.b1=t3.a3;
-SELECT a2 FROM t2 WHERE t2.a2 IN (SELECT t1.a1 FROM t1,t3 WHERE t1.b1=t3.a3);
-DROP TABLE t1, t2, t3;
-
-#
-# Bug #30788: Inconsistent retrieval of char/varchar
-#
-
-SET @save_optimizer_switch=@@optimizer_switch;
-SET optimizer_switch='semijoin_with_cache=off';
-SET optimizer_switch='materialization=off';
-
-CREATE TABLE t1 (a CHAR(1), b VARCHAR(10));
-INSERT INTO t1 VALUES ('a', 'aa');
-INSERT INTO t1 VALUES ('a', 'aaa');
-SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1);
-CREATE INDEX I1 ON t1 (a);
-CREATE INDEX I2 ON t1 (b);
-EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1);
-SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1);
-
-CREATE TABLE t2 (a VARCHAR(1), b VARCHAR(10));
-INSERT INTO t2 SELECT * FROM t1;
-CREATE INDEX I1 ON t2 (a);
-CREATE INDEX I2 ON t2 (b);
-EXPLAIN SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2);
-SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2);
-EXPLAIN
-SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500);
-SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500);
-
-DROP TABLE t1,t2;
-
-SET optimizer_switch= @save_optimizer_switch;
-
-#
-# Bug #32400: Complex SELECT query returns correct result only on some
-# occasions
-#
-
-CREATE TABLE t1(a INT, b INT);
-INSERT INTO t1 VALUES (1,1), (1,2), (2,3), (2,4);
-
---error ER_BAD_FIELD_ERROR
-EXPLAIN
-SELECT a AS out_a, MIN(b) FROM t1
-WHERE b > (SELECT MIN(b) FROM t1 WHERE a = out_a)
-GROUP BY a;
-
---error ER_BAD_FIELD_ERROR
-SELECT a AS out_a, MIN(b) FROM t1
-WHERE b > (SELECT MIN(b) FROM t1 WHERE a = out_a)
-GROUP BY a;
-
-EXPLAIN
-SELECT a AS out_a, MIN(b) FROM t1 t1_outer
-WHERE b > (SELECT MIN(b) FROM t1 WHERE a = t1_outer.a)
-GROUP BY a;
-
-SELECT a AS out_a, MIN(b) FROM t1 t1_outer
-WHERE b > (SELECT MIN(b) FROM t1 WHERE a = t1_outer.a)
-GROUP BY a;
-
-DROP TABLE t1;
-
-
-#
-# Bug #32036: EXISTS within a WHERE clause with a UNION crashes MySQL 5.122
-#
-
-CREATE TABLE t1 (a INT);
-CREATE TABLE t2 (a INT);
-
-INSERT INTO t1 VALUES (1),(2);
-INSERT INTO t2 VALUES (1),(2);
-
-SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
-EXPLAIN EXTENDED
-SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
-
-
-EXPLAIN EXTENDED
-SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION
- (SELECT 1 FROM t2 WHERE t1.a = t2.a));
-
-DROP TABLE t1,t2;
-
-#
-# Bug#33675: Usage of an uninitialized memory by filesort in a subquery
-# caused server crash.
-#
-create table t1(f11 int, f12 int);
-create table t2(f21 int unsigned not null, f22 int, f23 varchar(10));
-insert into t1 values(1,1),(2,2), (3, 3);
-let $i=10000;
---disable_query_log
---disable_warnings
-begin;
-while ($i)
-{
- eval insert into t2 values (-1 , $i/5000 + 1, '$i');
- dec $i;
-}
-commit;
---enable_warnings
---enable_query_log
-set session sort_buffer_size= 33*1024;
-select count(*) from t1 where f12 =
-(select f22 from t2 where f22 = f12 order by f21 desc, f22, f23 limit 1);
-
-drop table t1,t2;
-
---echo End of 5.0 tests.
-
-#
-# Bug #27348: SET FUNCTION used in a subquery from WHERE condition
-#
-
-CREATE TABLE t1 (a int, b int);
-INSERT INTO t1 VALUES (2,22),(1,11),(2,22);
-
-SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 0 GROUP BY a;
-SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 1 GROUP BY a;
-
-SELECT a FROM t1 t0
- WHERE (SELECT COUNT(t0.b) FROM t1 t WHERE t.b>20) GROUP BY a;
-
-SET @@sql_mode='ansi';
---error 1111
-SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 0 GROUP BY a;
---error 1111
-SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 1 GROUP BY a;
-
---error 1111
-SELECT a FROM t1 t0
- WHERE (SELECT COUNT(t0.b) FROM t1 t WHERE t.b>20) GROUP BY a;
-
-SET @@sql_mode=default;
-DROP TABLE t1;
-
-#
-# Bug#20835 (literal string with =any values)
-#
-CREATE TABLE t1 (s1 char(1));
-INSERT INTO t1 VALUES ('a');
-SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1);
-DROP TABLE t1;
-
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/sum_distinct.test b/mysql-test/suite/pbxt/t/sum_distinct.test
deleted file mode 100644
index ce470dbe68d..00000000000
--- a/mysql-test/suite/pbxt/t/sum_distinct.test
+++ /dev/null
@@ -1,99 +0,0 @@
-#
-# Various tests for SUM(DISTINCT ...)
-#
---disable_warnings
-DROP TABLE IF EXISTS t1, t2;
---enable_warnings
-
-CREATE TABLE t1 (
- id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
- gender CHAR(1),
- name VARCHAR(20)
-);
-
-# According to ANSI SQL, SUM(DISTINCT ...) should return NULL for empty
-# record set
-
-SELECT SUM(DISTINCT LENGTH(name)) s1 FROM t1;
-
-# According to ANSI SQL, SUM(DISTINCT ...) should return NULL for records sets
-# entirely consisting of NULLs
-
-INSERT INTO t1 (gender, name) VALUES (NULL, NULL);
-INSERT INTO t1 (gender, name) VALUES (NULL, NULL);
-INSERT INTO t1 (gender, name) VALUES (NULL, NULL);
-
-SELECT SUM(DISTINCT LENGTH(name)) s1 FROM t1;
-
-
-# Filling table with t1
-
-INSERT INTO t1 (gender, name) VALUES ('F', 'Helen'), ('F', 'Anastasia'),
-('F', 'Katherine'), ('F', 'Margo'), ('F', 'Magdalene'), ('F', 'Mary');
-
-CREATE TABLE t2 SELECT name FROM t1;
-
-SELECT (SELECT SUM(DISTINCT LENGTH(name)) FROM t1) FROM t2;
-
-DROP TABLE t2;
-
-INSERT INTO t1 (gender, name) VALUES ('F', 'Eva'), ('F', 'Sofia'),
-('F', 'Sara'), ('F', 'Golda'), ('F', 'Toba'), ('F', 'Victory'),
-('F', 'Faina'), ('F', 'Miriam'), ('F', 'Beki'), ('F', 'America'),
-('F', 'Susan'), ('F', 'Glory'), ('F', 'Priscilla'), ('F', 'Rosmary'),
-('F', 'Rose'), ('F', 'Margareth'), ('F', 'Elizabeth'), ('F', 'Meredith'),
-('F', 'Julie'), ('F', 'Xenia'), ('F', 'Zena'), ('F', 'Olga'),
-('F', 'Brunhilda'), ('F', 'Nataly'), ('F', 'Lara'), ('F', 'Svetlana'),
-('F', 'Grethem'), ('F', 'Irene');
-
-SELECT
- SUM(DISTINCT LENGTH(name)) s1,
- SUM(DISTINCT SUBSTRING(NAME, 1, 3)) s2,
- SUM(DISTINCT LENGTH(SUBSTRING(name, 1, 4))) s3
-FROM t1;
-
-SELECT
- SUM(DISTINCT LENGTH(g1.name)) s1,
- SUM(DISTINCT SUBSTRING(g2.name, 1, 3)) s2,
- SUM(DISTINCT LENGTH(SUBSTRING(g3.name, 1, 4))) s3
-FROM t1 g1, t1 g2, t1 g3;
-
-SELECT
- SUM(DISTINCT LENGTH(g1.name)) s1,
- SUM(DISTINCT SUBSTRING(g2.name, 1, 3)) s2,
- SUM(DISTINCT LENGTH(SUBSTRING(g3.name, 1, 4))) s3
-FROM t1 g1, t1 g2, t1 g3 GROUP BY LENGTH(SUBSTRING(g3.name, 5, 10));
-
-# here we explicitly request summing through temporary table (so
-# Item_sum_sum_distinct::copy_or_same() is called)
-
-SELECT SQL_BUFFER_RESULT
- SUM(DISTINCT LENGTH(name)) s1,
- SUM(DISTINCT SUBSTRING(NAME, 1, 3)) s2,
- SUM(DISTINCT LENGTH(SUBSTRING(name, 1, 4))) s3
-FROM t1;
-
-SELECT SQL_BUFFER_RESULT
- SUM(DISTINCT LENGTH(g1.name)) s1,
- SUM(DISTINCT SUBSTRING(g2.name, 1, 3)) s2,
- SUM(DISTINCT LENGTH(SUBSTRING(g3.name, 1, 4))) s3
-FROM t1 g1, t1 g2, t1 g3 GROUP BY LENGTH(SUBSTRING(g3.name, 5, 10));
-
-# this test demonstrates that strings are automatically converted to numbers
-# before summing
-
-SET @l=1;
-UPDATE t1 SET name=CONCAT(name, @l:=@l+1);
-
-SELECT SUM(DISTINCT RIGHT(name, 1)) FROM t1;
-
-# this is a test case for ordinary t1
-
-SELECT SUM(DISTINCT id) FROM t1;
-SELECT SUM(DISTINCT id % 11) FROM t1;
-
-DROP TABLE t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/temp_table.test b/mysql-test/suite/pbxt/t/temp_table.test
deleted file mode 100644
index 71ff086f60a..00000000000
--- a/mysql-test/suite/pbxt/t/temp_table.test
+++ /dev/null
@@ -1,183 +0,0 @@
-# mysqltest should be fixed
--- source include/not_embedded.inc
-#
-# Test of temporary tables
-#
-
---disable_warnings
-drop table if exists t1,t2;
-drop view if exists v1;
---enable_warnings
-
-CREATE TABLE t1 (c int not null, d char (10) not null);
-insert into t1 values(1,""),(2,"a"),(3,"b");
-CREATE TEMPORARY TABLE t1 (a int not null, b char (10) not null);
-insert into t1 values(4,"e"),(5,"f"),(6,"g");
-alter table t1 rename t2;
-select * from t1;
-select * from t2;
-CREATE TABLE t2 (x int not null, y int not null);
-alter table t2 rename t1;
-select * from t1;
-create TEMPORARY TABLE t2 engine=heap select * from t1;
-create TEMPORARY TABLE IF NOT EXISTS t2 (a int) engine=heap;
-
-# This should give errors
---error 1050
-CREATE TEMPORARY TABLE t1 (a int not null, b char (10) not null);
---error 1050
-ALTER TABLE t1 RENAME t2;
-
-select * from t2;
-alter table t2 add primary key (a,b);
-drop table t1,t2;
-select * from t1;
-drop table t2;
-create temporary table t1 engine=myisam select *,2 as "e" from t1; # PBXT cannot handle INSERT/SELECT with temp
-select * from t1;
-drop table t1;
-drop table t1;
-
-#
-# Test CONCAT_WS with temporary tables
-#
-
-CREATE TABLE t1 (pkCrash INTEGER PRIMARY KEY,strCrash VARCHAR(255));
-INSERT INTO t1 ( pkCrash, strCrash ) VALUES ( 1, '1');
-SELECT CONCAT_WS(pkCrash, strCrash) FROM t1;
-drop table t1;
-create temporary table t1 select 1 as 'x';
-drop table t1;
-CREATE TABLE t1 (x INT);
-INSERT INTO t1 VALUES (1), (2), (3);
-CREATE TEMPORARY TABLE tmp engine=myisam SELECT *, NULL FROM t1; # PBXT cannot handle INSERT/SELECT with temp
-drop table t1;
-
-#
-# Problem with ELT
-#
-create temporary table t1 (id int(10) not null unique);
-create temporary table t2 (id int(10) not null primary key,
-val int(10) not null);
-
-# put in some initial values
-insert into t1 values (1),(2),(4);
-insert into t2 values (1,1),(2,1),(3,1),(4,2);
-
-# do a query using ELT, a join and an ORDER BY.
-select one.id, two.val, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id order by one.id;
-drop table t1,t2;
-
-#
-# Test of failed ALTER TABLE on temporary table
-#
-create temporary table t1 (a int not null);
-insert into t1 values (1),(1);
--- error 1062
-alter table t1 add primary key (a);
-drop table t1;
-
-#
-# In MySQL 4.0.4 doing a GROUP BY on a NULL column created a disk based
-# temporary table when a memory based one would be good enough.
-
-CREATE TABLE t1 (
- d datetime default NULL
-) ENGINE=MyISAM;
-
-
-INSERT INTO t1 VALUES ('2002-10-24 14:50:32'),('2002-10-24 14:50:33'),('2002-10-24 14:50:34'),('2002-10-24 14:50:34'),('2002-10-24 14:50:34'),('2002-10-24 14:50:35'),('2002-10-24 14:50:35'),('2002-10-24 14:50:35'),('2002-10-24 14:50:35'),('2002-10-24 14:50:36'),('2002-10-24 14:50:36'),('2002-10-24 14:50:36'),('2002-10-24 14:50:36'),('2002-10-24 14:50:37'),('2002-10-24 14:50:37'),('2002-10-24 14:50:37'),('2002-10-24 14:50:37'),('2002-10-24 14:50:38'),('2002-10-24 14:50:38'),('2002-10-24 14:50:38'),('2002-10-24 14:50:39'),('2002-10-24 14:50:39'),('2002-10-24 14:50:39'),('2002-10-24 14:50:39'),('2002-10-24 14:50:40'),('2002-10-24 14:50:40'),('2002-10-24 14:50:40');
-
-flush status;
-select * from t1 group by d;
-show status like "created_tmp%tables";
-drop table t1;
-
-# Fix for BUG#8921: Check that temporary table is ingored by view commands.
-create temporary table v1 as select 'This is temp. table' A;
-create view v1 as select 'This is view' A;
-select * from v1;
-show create table v1;
-show create view v1;
-drop view v1;
-select * from v1;
-create view v1 as select 'This is view again' A;
-select * from v1;
-drop table v1;
-select * from v1;
-drop view v1;
-
-# Bug #8497: tmpdir with extra slashes would cause failures
-#
-create table t1 (a int, b int, index(a), index(b));
-create table t2 (c int auto_increment, d varchar(255), primary key (c));
-insert into t1 values (3,1),(3,2);
-insert into t2 values (NULL, 'foo'), (NULL, 'bar');
-select d, c from t1 left join t2 on b = c where a = 3 order by d;
-drop table t1, t2;
-
-
-#
-# BUG#21096: locking issue ; temporary table conflicts.
-#
-# The problem was that on DROP TEMPORARY table name lock was acquired,
-# which should not be done.
-#
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-CREATE TABLE t1 (i INT);
-
-LOCK TABLE t1 WRITE;
-
-connect (conn1, localhost, root,,);
-
-CREATE TEMPORARY TABLE t1 (i INT);
-
---echo The following command should not block
-DROP TEMPORARY TABLE t1;
-
-disconnect conn1;
-connection default;
-
-DROP TABLE t1;
-
-#
-# Check that it's not possible to drop a base table with
-# DROP TEMPORARY statement.
-#
-CREATE TABLE t1 (i INT);
-CREATE TEMPORARY TABLE t2 (i INT);
-
---error 1051
-DROP TEMPORARY TABLE t2, t1;
-
-# Table t2 should have been dropped.
---error 1146
-SELECT * FROM t2;
-# But table t1 should still be there.
-SELECT * FROM t1;
-
-DROP TABLE t1;
-
-
---echo End of 4.1 tests.
-
-
-#
-# Test truncate with temporary tables
-#
-
-create temporary table t1 (a int);
-insert into t1 values (4711);
-select * from t1;
-truncate t1;
-insert into t1 values (42);
-select * from t1;
-drop table t1;
-
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/truncate.test b/mysql-test/suite/pbxt/t/truncate.test
deleted file mode 100644
index e28115f1164..00000000000
--- a/mysql-test/suite/pbxt/t/truncate.test
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# Test of truncate
-#
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (a integer, b integer,c1 CHAR(10));
-insert into t1 (a) values (1),(2);
-truncate table t1;
-select count(*) from t1;
-insert into t1 values(1,2,"test");
-select count(*) from t1;
-delete from t1;
-select * from t1;
-drop table t1;
-# The following should fail
---error 1146
-select count(*) from t1;
-create temporary table t1 (n int);
-insert into t1 values (1),(2),(3);
-truncate table t1;
-select * from t1;
-drop table t1;
---error 1146
-truncate non_existing_table;
-
-#
-# test autoincrement with TRUNCATE; verifying difference with DELETE
-#
-
-create table t1 (a integer auto_increment primary key);
-insert into t1 (a) values (NULL),(NULL);
-truncate table t1;
-insert into t1 (a) values (NULL),(NULL);
-SELECT * from t1;
-delete from t1;
-insert into t1 (a) values (NULL),(NULL);
-SELECT * from t1;
-drop table t1;
-
-# Verifying that temp tables are handled the same way
-
-create temporary table t1 (a integer auto_increment primary key);
-insert into t1 (a) values (NULL),(NULL);
-truncate table t1;
-insert into t1 (a) values (NULL),(NULL);
-SELECT * from t1;
-delete from t1;
-insert into t1 (a) values (NULL),(NULL);
-SELECT * from t1;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/type_binary.test b/mysql-test/suite/pbxt/t/type_binary.test
deleted file mode 100644
index 097d05beed6..00000000000
--- a/mysql-test/suite/pbxt/t/type_binary.test
+++ /dev/null
@@ -1,105 +0,0 @@
-# check 0x00 padding
-create table t1 (s1 binary(3));
-insert into t1 values (0x61), (0x6120), (0x612020);
-select hex(s1) from t1;
-drop table t1;
-
-# check that 0x00 is not stripped in val_str
-create table t1 (s1 binary(2), s2 varbinary(2));
-insert into t1 values (0x4100,0x4100);
-select length(concat('*',s1,'*',s2,'*')) from t1;
-delete from t1;
-insert into t1 values (0x4120,0x4120);
-select length(concat('*',s1,'*',s2,'*')) from t1;
-drop table t1;
-
-# check that trailing 0x00 and 0x20 do matter on comparison
-create table t1 (s1 varbinary(20), s2 varbinary(20));
-show create table t1;
-insert into t1 values (0x41,0x4100),(0x41,0x4120),(0x4100,0x4120);
-select hex(s1), hex(s2) from t1;
-select count(*) from t1 where s1 < s2;
-drop table t1;
-
-# check that trailing 0x00 do matter on filesort
-create table t1 (s1 varbinary(2), s2 varchar(1));
-insert into t1 values (0x41,'a'), (0x4100,'b'), (0x41,'c'), (0x4100,'d');
-select hex(s1),s2 from t1 order by s1,s2;
-drop table t1;
-
-# check that 0x01 is padded to 0x0100 and thus we get a duplicate value
-create table t1 (s1 binary(2) primary key);
-insert into t1 values (0x01);
-insert into t1 values (0x0120);
---error ER_DUP_ENTRY
-insert into t1 values (0x0100);
-select hex(s1) from t1 order by s1;
-# check index search
-select hex(s1) from t1 where s1=0x01;
-select hex(s1) from t1 where s1=0x0120;
-select hex(s1) from t1 where s1=0x0100;
-select count(distinct s1) from t1;
-alter table t1 drop primary key;
-# check non-indexed search
-select hex(s1) from t1 where s1=0x01;
-select hex(s1) from t1 where s1=0x0120;
-select hex(s1) from t1 where s1=0x0100;
-select count(distinct s1) from t1;
-drop table t1;
-
-# check that 0x01 is not padded, and all three values are unique
-create table t1 (s1 varbinary(2) primary key);
-insert into t1 values (0x01);
-insert into t1 values (0x0120);
-insert into t1 values (0x0100);
-select hex(s1) from t1 order by s1;
-# check index search
-select hex(s1) from t1 where s1=0x01;
-select hex(s1) from t1 where s1=0x0120;
-select hex(s1) from t1 where s1=0x0100;
-select count(distinct s1) from t1;
-alter table t1 drop primary key;
-# check non-indexed search
-select hex(s1) from t1 where s1=0x01;
-select hex(s1) from t1 where s1=0x0120;
-select hex(s1) from t1 where s1=0x0100;
-select count(distinct s1) from t1;
-drop table t1;
-
-# check that cast appends trailing zeros
-select hex(cast(0x10 as binary(2)));
-
-#
-# Bug #14299: BINARY space truncation should cause warning or error
-#
-create table t1 (b binary(2), vb varbinary(2));
-insert into t1 values(0x4120, 0x4120);
-insert into t1 values(0x412020, 0x412020);
-drop table t1;
-create table t1 (c char(2), vc varchar(2));
-insert into t1 values(0x4120, 0x4120);
-insert into t1 values(0x412020, 0x412020);
-drop table t1;
-
-set @old_sql_mode= @@sql_mode, sql_mode= 'traditional';
-create table t1 (b binary(2), vb varbinary(2));
-insert into t1 values(0x4120, 0x4120);
---error ER_DATA_TOO_LONG
-insert into t1 values(0x412020, NULL);
---error ER_DATA_TOO_LONG
-insert into t1 values(NULL, 0x412020);
-drop table t1;
-set @@sql_mode= @old_sql_mode;
-
-#
-# Bug#14171: Wrong default value for a BINARY field
-#
-create table t1(f1 int, f2 binary(2) not null, f3 char(2) not null);
-insert into t1 set f1=1;
-select hex(f2), hex(f3) from t1;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
---echo End of 5.0 tests
diff --git a/mysql-test/suite/pbxt/t/type_bit.test b/mysql-test/suite/pbxt/t/type_bit.test
deleted file mode 100644
index aaae858f4dc..00000000000
--- a/mysql-test/suite/pbxt/t/type_bit.test
+++ /dev/null
@@ -1,278 +0,0 @@
-#
-# testing of the BIT column type
-#
-
-select 0 + b'1';
-select 0 + b'0';
-select 0 + b'000001';
-select 0 + b'000011';
-select 0 + b'000101';
-select 0 + b'000000';
-select 0 + b'10000000';
-select 0 + b'11111111';
-select 0 + b'10000001';
-select 0 + b'1000000000000000';
-select 0 + b'1111111111111111';
-select 0 + b'1000000000000001';
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
---error 1439
-create table t1 (a bit(65));
-
-create table t1 (a bit(0));
-show create table t1;
-drop table t1;
-
-create table t1 (a bit(64));
-insert into t1 values
-(b'1111111111111111111111111111111111111111111111111111111111111111'),
-(b'1000000000000000000000000000000000000000000000000000000000000000'),
-(b'0000000000000000000000000000000000000000000000000000000000000001'),
-(b'1010101010101010101010101010101010101010101010101010101010101010'),
-(b'0101010101010101010101010101010101010101010101010101010101010101');
-select hex(a) from t1;
-drop table t1;
-
-create table t1 (a bit);
-insert into t1 values (b'0'), (b'1'), (b'000'), (b'100'), (b'001');
-select hex(a) from t1;
---error ER_DUP_ENTRY
-alter table t1 add unique (a);
-drop table t1;
-
-create table t1 (a bit(2));
-insert into t1 values (b'00'), (b'01'), (b'10'), (b'100');
-select a+0 from t1;
-alter table t1 add key (a);
-explain select a+0 from t1;
-select a+0 from t1;
-drop table t1;
-
-create table t1 (a bit(7), b bit(9), key(a, b));
-insert into t1 values
-(94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),
-(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),
-(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),
-(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),
-(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),
-(44, 307), (68, 454), (57, 135);
-explain select a+0 from t1;
-select a+0 from t1;
-explain select b+0 from t1;
-select b+0 from t1;
-explain select a+0, b+0 from t1;
-select a+0, b+0 from t1;
-explain select a+0, b+0 from t1 where a > 40 and b > 200 order by 1;
-select a+0, b+0 from t1 where a > 40 and b > 200 order by 1;
-explain select a+0, b+0 from t1 where a > 40 and a < 70 order by 2;
-select a+0, b+0 from t1 where a > 40 and a < 70 order by 2;
-set @@max_length_for_sort_data=0;
-select a+0, b+0 from t1 where a > 40 and a < 70 order by 2;
-select hex(min(a)) from t1;
-select hex(min(b)) from t1;
-select hex(min(a)), hex(max(a)), hex(min(b)), hex(max(b)) from t1;
-drop table t1;
-
-create table t1 (a int not null, b bit, c bit(9), key(a, b, c));
-insert into t1 values
-(4, NULL, 1), (4, 0, 3), (2, 1, 4), (1, 1, 100), (4, 0, 23), (4, 0, 54),
-(56, 0, 22), (4, 1, 100), (23, 0, 1), (4, 0, 34);
-select a+0, b+0, c+0 from t1;
-select hex(min(b)) from t1 where a = 4;
-select hex(min(c)) from t1 where a = 4 and b = 0;
-select hex(max(b)) from t1;
-select a+0, b+0, c+0 from t1 where a = 4 and b = 0 limit 2;
-select a+0, b+0, c+0 from t1 where a = 4 and b = 1;
-select a+0, b+0, c+0 from t1 where a = 4 and b = 1 and c=100;
-select a+0, b+0, c+0 from t1 order by b desc;
-select a+0, b+0, c+0 from t1 order by c;
-drop table t1;
-
-create table t1(a bit(2), b bit(2));
-insert into t1 (a) values (0x01), (0x03), (0x02);
-update t1 set b= concat(a);
-select a+0, b+0 from t1;
-drop table t1;
-
-# Some magic numbers
-
-create table t1 (a bit(7), key(a));
-insert into t1 values (44), (57);
-select a+0 from t1;
-drop table t1;
-
-#
-# Test conversion to and from strings
-#
-create table t1 (a bit(3), b bit(12));
-insert into t1 values (7,(1<<12)-2), (0x01,0x01ff);
-select hex(a),hex(b) from t1;
-select hex(concat(a)),hex(concat(b)) from t1;
-drop table t1;
-
-#
-# Bug #9571: problem with primary key creation
-#
-
-create table t1(a int, b bit not null);
-alter table t1 add primary key (a);
-drop table t1;
-
-#
-# myisam <-> heap
-#
-
-create table t1 (a bit(19), b bit(5));
-insert into t1 values (1000, 10), (3, 8), (200, 6), (2303, 2), (12345, 4), (1, 0);
-select a+0, b+0 from t1;
-alter table t1 engine=heap;
-select a+0, b+0 from t1;
-alter table t1 add key(a, b);
-select a+0, b+0 from t1;
-alter table t1 engine=myisam;
-select a+0, b+0 from t1;
-create table t2 engine=heap select * from t1;
-select a+0, b+0 from t2;
-drop table t1;
-create table t1 select * from t2;
-select a+0, b+0 from t1;
-drop table t1, t2;
-
-#
-# Bug #10179: problem with NULLs and default values
-#
-
-create table t1 (a int, b time, c tinyint, d bool, e char(10), f bit(1),
- g bit(1) NOT NULL default 1, h char(1) default 'a');
-insert into t1 set a=1;
-select hex(g), h from t1;
-drop table t1;
-
-create table t1 (a int, b time, c tinyint, d bool, e char(10), f bit(1),
- g bit(1) NOT NULL default 1);
-insert into t1 set a=1;
-select hex(g) from t1;
-drop table t1;
-
-create table t1 (a int, b time, c tinyint, d bool, e char(10), f bit(1),
- h char(1) default 'a') engine=myisam;
-insert into t1 set a=1;
-select h from t1;
-drop table t1;
-
-#
-# Bug #10539
-#
-
-create table t1 (a bit(8)) engine=heap;
-insert into t1 values ('1111100000');
-select a+0 from t1;
-drop table t1;
-
-#
-# Bug #11091: union
-#
-
-create table t1 (a bit(7));
-insert into t1 values (120), (0), (111);
-select a+0 from t1 union select a+0 from t1;
-select a+0 from t1 union select NULL;
-select NULL union select a+0 from t1;
-create table t2 select a from t1 union select a from t1;
-select a+0 from t2;
-show create table t2;
-drop table t1, t2;
-
-#
-# Bug #11572: view
-#
-
-create table t1 (id1 int(11), b1 bit(1));
-create table t2 (id2 int(11), b2 bit(1));
-insert into t1 values (1, 1), (2, 0), (3, 1);
-insert into t2 values (2, 1), (3, 0), (4, 0);
-create algorithm=undefined view v1 as
- select b1+0, b2+0 from t1, t2 where id1 = id2 and b1 = 0
- union
- select b1+0, b2+0 from t1, t2 where id1 = id2 and b2 = 1;
-select * from v1;
-drop table t1, t2;
-drop view v1;
-
-#
-# Bug #10617: bulk-insert
-#
-
-create table t1(a bit(4));
-insert into t1(a) values (1), (2), (5), (4), (3);
-insert into t1 select * from t1;
-select a+0 from t1;
-drop table t1;
-
-#
-# join
-#
-
-create table t1 (a1 int(11), b1 bit(2));
-create table t2 (a2 int(11), b2 bit(2));
-insert into t1 values (1, 1), (2, 0), (3, 1), (4, 2);
-insert into t2 values (2, 1), (3, 0), (4, 1), (5, 2);
-select a1, a2, b1+0, b2+0 from t1 join t2 on a1 = a2;
-select a1, a2, b1+0, b2+0 from t1 join t2 on a1 = a2 order by a1;
-select a1, a2, b1+0, b2+0 from t1 join t2 on b1 = b2;
-select sum(a1), b1+0, b2+0 from t1 join t2 on b1 = b2 group by b1 order by 1;
-select 1 from t1 join t2 on b1 = b2 group by b1 order by 1;
-select b1+0,sum(b1), sum(b2) from t1 join t2 on b1 = b2 group by b1 order by 1;
-drop table t1, t2;
-
-#
-# Bug #13601: Wrong field length reported for BIT fields
-#
-create table t1 (a bit(7));
-insert into t1 values (0x60);
---enable_metadata
-select * from t1;
---disable_metadata
-drop table t1;
-
-#
-# Bug#15583: BIN()/OCT()/CONV() do not work with BIT values
-#
-create table bug15583(b BIT(8), n INT);
-insert into bug15583 values(128, 128);
-insert into bug15583 values(null, null);
-insert into bug15583 values(0, 0);
-insert into bug15583 values(255, 255);
-select hex(b), bin(b), oct(b), hex(n), bin(n), oct(n) from bug15583;
-select hex(b)=hex(n) as should_be_onetrue, bin(b)=bin(n) as should_be_onetrue, oct(b)=oct(n) as should_be_onetrue from bug15583;
-select hex(b + 0), bin(b + 0), oct(b + 0), hex(n), bin(n), oct(n) from bug15583;
-select conv(b, 10, 2), conv(b + 0, 10, 2) from bug15583;
-drop table bug15583;
-
-#
-# Bug #22271: data casting may affect data stored in the next column(s?)
-#
-
-create table t1(a bit(1), b smallint unsigned);
-insert into t1 (b, a) values ('2', '1');
-select hex(a), b from t1;
-drop table t1;
-
-#
-# type was not properly initalized, which caused key_copy to fail
-#
-
-create table t1(bit_field bit(2), int_field int, key a(bit_field));
-insert into t1 values (1,2);
-handler t1 open as t1;
-handler t1 read a=(1);
-handler t1 close;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
---echo End of 5.0 tests
diff --git a/mysql-test/suite/pbxt/t/type_date.test b/mysql-test/suite/pbxt/t/type_date.test
deleted file mode 100644
index 6a034c89ab5..00000000000
--- a/mysql-test/suite/pbxt/t/type_date.test
+++ /dev/null
@@ -1,128 +0,0 @@
-#
-# test of problem with date fields
-#
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-create table t1 (a char(16), b date, c datetime);
-insert into t1 SET a='test 2000-01-01', b='2000-01-01', c='2000-01-01';
-select * from t1 where c = '2000-01-01';
-select * from t1 where b = '2000-01-01';
-drop table t1;
-
-#
-# problem with date conversions
-#
-
-CREATE TABLE t1 (name char(6),cdate date);
-INSERT INTO t1 VALUES ('name1','1998-01-01');
-INSERT INTO t1 VALUES ('name2','1998-01-01');
-INSERT INTO t1 VALUES ('name1','1998-01-02');
-INSERT INTO t1 VALUES ('name2','1998-01-02');
-CREATE TABLE t2 (cdate date, note char(6));
-INSERT INTO t2 VALUES ('1998-01-01','note01');
-INSERT INTO t2 VALUES ('1998-01-02','note02');
-select name,t1.cdate,note from t1,t2 where t1.cdate=t2.cdate and t1.cdate='1998-01-01';
-drop table t1,t2;
-
-#
-# Date and BETWEEN
-#
-
-CREATE TABLE t1 ( datum DATE );
-INSERT INTO t1 VALUES ( "2000-1-1" );
-INSERT INTO t1 VALUES ( "2000-1-2" );
-INSERT INTO t1 VALUES ( "2000-1-3" );
-INSERT INTO t1 VALUES ( "2000-1-4" );
-INSERT INTO t1 VALUES ( "2000-1-5" );
-SELECT * FROM t1 WHERE datum BETWEEN cast("2000-1-2" as date) AND cast("2000-1-4" as date);
-SELECT * FROM t1 WHERE datum BETWEEN cast("2000-1-2" as date) AND datum - INTERVAL 100 DAY;
-DROP TABLE t1;
-
-#
-# test of max(date) and having
-#
-
-CREATE TABLE t1 (
- user_id char(10),
- summa int(11),
- rdate date
-);
-INSERT INTO t1 VALUES ('aaa',100,'1998-01-01');
-INSERT INTO t1 VALUES ('aaa',200,'1998-01-03');
-INSERT INTO t1 VALUES ('bbb',50,'1998-01-02');
-INSERT INTO t1 VALUES ('bbb',200,'1998-01-04');
-select max(rdate) as s from t1 where rdate < '1998-01-03' having s> "1998-01-01";
-select max(rdate) as s from t1 having s="1998-01-04";
-select max(rdate+0) as s from t1 having s="19980104";
-drop table t1;
-
-#
-# Test of date and not null
-#
-
-create table t1 (date date);
-insert into t1 values ("2000-08-10"),("2000-08-11");
-select date_add(date,INTERVAL 1 DAY),date_add(date,INTERVAL 1 SECOND) from t1;
-drop table t1;
-
-#
-# Test problem with DATE_FORMAT
-#
-
-CREATE TABLE t1(AFIELD INT);
-INSERT INTO t1 VALUES(1);
-CREATE TABLE t2(GMT VARCHAR(32));
-INSERT INTO t2 VALUES('GMT-0800');
-SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) FROM t1, t2 GROUP BY t1.AFIELD;
-INSERT INTO t1 VALUES(1);
-SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)), DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) FROM t1,t2 GROUP BY t1.AFIELD;
-drop table t1,t2;
-
-#
-# Multiple SELECT DATE_FORMAT gave incorrect results (Bug #4036)
-#
-
-CREATE TABLE t1 (f1 time default NULL, f2 time default NULL);
-INSERT INTO t1 (f1, f2) VALUES ('09:00', '12:00');
-SELECT DATE_FORMAT(f1, "%l.%i %p") , DATE_FORMAT(f2, "%l.%i %p") FROM t1;
-DROP TABLE t1;
-
-#
-# Bug 4937: different date -> string conversion when using SELECT ... UNION
-# and INSERT ... SELECT ... UNION
-#
-
-CREATE TABLE t1 (f1 DATE);
-CREATE TABLE t2 (f2 VARCHAR(8));
-CREATE TABLE t3 (f2 CHAR(8));
-
-INSERT INTO t1 VALUES ('1978-11-26');
-INSERT INTO t2 SELECT f1+0 FROM t1;
-INSERT INTO t2 SELECT f1+0 FROM t1 UNION SELECT f1+0 FROM t1;
-INSERT INTO t3 SELECT f1+0 FROM t1;
-INSERT INTO t3 SELECT f1+0 FROM t1 UNION SELECT f1+0 FROM t1;
-SELECT * FROM t2;
-SELECT * FROM t3;
-
-DROP TABLE t1, t2, t3;
-
-# Test that setting YEAR to invalid string results in default value, not
-# 2000. (Bug #6067)
-CREATE TABLE t1 (y YEAR);
-INSERT INTO t1 VALUES ('abc');
-SELECT * FROM t1;
-DROP TABLE t1;
-
-#
-# Bug#21677: Wrong result when comparing a DATE and a DATETIME in BETWEEN
-#
-create table t1(start_date date, end_date date);
-insert into t1 values ('2000-01-01','2000-01-02');
-select 1 from t1 where cast('2000-01-01 12:01:01' as datetime) between start_date and end_date;
-drop table t1;
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/type_datetime.test b/mysql-test/suite/pbxt/t/type_datetime.test
deleted file mode 100644
index 4dd95d7535e..00000000000
--- a/mysql-test/suite/pbxt/t/type_datetime.test
+++ /dev/null
@@ -1,140 +0,0 @@
-#
-# testing different DATETIME ranges
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (t datetime);
-insert into t1 values (101),(691231),(700101),(991231),(10000101),(99991231),(101000000),(691231000000),(700101000000),(991231235959),(10000101000000),(99991231235959),(20030100000000),(20030000000000);
-select * from t1;
-delete from t1 where t > 0;
-optimize table t1;
-check table t1;
-delete from t1;
-insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030100000000"),("20030000000000");
-
-# Strange dates
-insert into t1 values ("2003-003-03");
-
-# Bug #7308: ISO-8601 date format not handled correctly
-insert into t1 values ("20030102T131415"),("2001-01-01T01:01:01"), ("2001-1-1T1:01:01");
-select * from t1;
-
-# Test some wrong dates
-truncate table t1;
-insert into t1 values("2003-0303 12:13:14");
-select * from t1;
-drop table t1;
-
-#
-# Test insert of now() and curtime()
-#
-
-CREATE TABLE t1 (a timestamp, b date, c time, d datetime);
-insert into t1 (b,c,d) values(now(),curtime(),now());
-select date_format(a,"%Y-%m-%d")=b,right(a+0,6)=c+0,a=d+0 from t1;
-drop table t1;
-
-#
-# Test of datetime and not null
-#
-
-CREATE TABLE t1 (a datetime not null);
-insert into t1 values (0);
-select * from t1 where a is null;
-drop table t1;
-
-#
-# Test with bug when propagating DATETIME to integer and WHERE optimization
-#
-
-create table t1 (id int, dt datetime);
-insert into t1 values (1,"2001-08-14 00:00:00"),(2,"2001-08-15 00:00:00"),(3,"2001-08-16 00:00:00"),(4,"2003-09-15 01:20:30");
-select * from t1 where dt='2001-08-14 00:00:00' and dt = if(id=1,'2001-08-14 00:00:00','1999-08-15');
-create index dt on t1 (dt);
-select * from t1 where dt > 20021020;
-select * from t1 ignore index (dt) where dt > 20021020;
-drop table t1;
-
-#
-# Test of datetime optimization
-#
-
-CREATE TABLE `t1` (
- `date` datetime NOT NULL default '0000-00-00 00:00:00',
- `numfacture` int(6) unsigned NOT NULL default '0',
- `expedition` datetime NOT NULL default '0000-00-00 00:00:00',
- PRIMARY KEY (`numfacture`),
- KEY `date` (`date`),
- KEY `expedition` (`expedition`)
-) ENGINE=MyISAM;
-
-INSERT INTO t1 (expedition) VALUES ('0001-00-00 00:00:00');
-SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00';
-INSERT INTO t1 (numfacture,expedition) VALUES ('1212','0001-00-00 00:00:00');
-SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00';
-EXPLAIN SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00';
-drop table t1;
-create table t1 (a datetime not null, b datetime not null);
-insert into t1 values (now(), now());
-insert into t1 values (now(), now());
-select * from t1 where a is null or b is null;
-drop table t1;
-
-#
-# Let us check if we properly treat wrong datetimes and produce proper
-# warnings (for both strings and numbers)
-#
-create table t1 (t datetime);
-insert into t1 values (20030102030460),(20030102036301),(20030102240401),
- (20030132030401),(20031302030401),(100001202030401);
-select * from t1;
-delete from t1;
-insert into t1 values
- ("2003-01-02 03:04:60"),("2003-01-02 03:63:01"),("2003-01-02 24:04:01"),
- ("2003-01-32 03:04:01"),("2003-13-02 03:04:01"), ("10000-12-02 03:04:00");
-select * from t1;
-delete from t1;
-insert into t1 values ("0000-00-00 00:00:00 some trailer"),("2003-01-01 00:00:00 some trailer");
-select * from t1 order by t;
-drop table t1;
-
-#
-# Test for bug #7297 "Two digit year should be interpreted correctly even
-# with zero month and day"
-#
-create table t1 (dt datetime);
-# These dates should be treated as dates in 21st century
-insert into t1 values ("12-00-00"), ("00-00-00 01:00:00");
-# Zero dates are still special :/
-insert into t1 values ("00-00-00"), ("00-00-00 00:00:00");
-select * from t1;
-drop table t1;
-
-# End of 4.1 tests
-
-#
-# Bug#21475: Wrongly applied constant propagation leads to a false comparison.
-#
-CREATE TABLE t1(a DATETIME NOT NULL);
-INSERT INTO t1 VALUES ('20060606155555');
-SELECT a FROM t1 WHERE a=(SELECT MAX(a) FROM t1) AND (a="20060606155555");
-PREPARE s FROM 'SELECT a FROM t1 WHERE a=(SELECT MAX(a) FROM t1) AND (a="20060606155555")';
-EXECUTE s;
-DROP PREPARE s;
-DROP TABLE t1;
-
-
-#
-# Bug 19491 (CAST DATE AS DECIMAL returns incorrect result
-#
-SELECT CAST(CAST('2006-08-10' AS DATE) AS DECIMAL(20,6));
-SELECT CAST(CAST('2006-08-10 10:11:12' AS DATETIME) AS DECIMAL(20,6));
-SELECT CAST(CAST('2006-08-10 10:11:12' AS DATETIME) + INTERVAL 14 MICROSECOND AS DECIMAL(20,6));
-SELECT CAST(CAST('10:11:12.098700' AS TIME) AS DECIMAL(20,6));
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/type_decimal.test b/mysql-test/suite/pbxt/t/type_decimal.test
deleted file mode 100644
index f1ac16f97b0..00000000000
--- a/mysql-test/suite/pbxt/t/type_decimal.test
+++ /dev/null
@@ -1,400 +0,0 @@
-# bug in decimal() with negative numbers by kaido@tradenet.ee
-
---disable_warnings
-DROP TABLE IF EXISTS t1, t2;
---enable_warnings
-SET SQL_WARNINGS=1;
-
-CREATE TABLE t1 (
- id int(11) NOT NULL auto_increment,
- datatype_id int(11) DEFAULT '0' NOT NULL,
- min_value decimal(20,10) DEFAULT '0.0000000000' NOT NULL,
- max_value decimal(20,10) DEFAULT '0.0000000000' NOT NULL,
- valuename varchar(20),
- forecolor int(11),
- backcolor int(11),
- PRIMARY KEY (id),
- UNIQUE datatype_id (datatype_id, min_value, max_value)
-);
-INSERT INTO t1 VALUES ( '1', '4', '0.0000000000', '0.0000000000', 'Ei saja', '0', '16776960');
-INSERT INTO t1 VALUES ( '2', '4', '1.0000000000', '1.0000000000', 'Sajab', '16777215', '255');
-INSERT INTO t1 VALUES ( '3', '1', '2.0000000000', '49.0000000000', '', '0', '16777215');
-INSERT INTO t1 VALUES ( '60', '11', '0.0000000000', '0.0000000000', 'Rikkis', '16777215', '16711680');
-INSERT INTO t1 VALUES ( '4', '12', '1.0000000000', '1.0000000000', 'nork sadu', '65280', '14474460');
-INSERT INTO t1 VALUES ( '5', '12', '2.0000000000', '2.0000000000', 'keskmine sadu', '255', '14474460');
-INSERT INTO t1 VALUES ( '6', '12', '3.0000000000', '3.0000000000', 'tugev sadu', '127', '14474460');
-INSERT INTO t1 VALUES ( '43', '39', '6.0000000000', '6.0000000000', 'lobjakas', '13107327', '16763080');
-INSERT INTO t1 VALUES ( '40', '39', '2.0000000000', '2.0000000000', 'vihm', '8355839', '16777215');
-INSERT INTO t1 VALUES ( '53', '1', '-35.0000000000', '-5.0000000000', '', '0', '16777215');
-INSERT INTO t1 VALUES ( '41', '39', '3.0000000000', '3.0000000000', 'klm vihm', '120', '16763080');
-INSERT INTO t1 VALUES ( '12', '21', '21.0000000000', '21.0000000000', 'Kuiv', '13158600', '16777215');
-INSERT INTO t1 VALUES ( '13', '21', '13.0000000000', '13.0000000000', 'Mrg', '5263615', '16777215');
-INSERT INTO t1 VALUES ( '14', '21', '22.0000000000', '22.0000000000', 'Niiske', '9869055', '16777215');
-INSERT INTO t1 VALUES ( '19', '21', '33.0000000000', '33.0000000000', 'Mrg', '5263615', '16777215');
-INSERT INTO t1 VALUES ( '15', '21', '23.0000000000', '23.0000000000', 'Mrg', '5263615', '16777215');
-INSERT INTO t1 VALUES ( '16', '21', '31.0000000000', '31.0000000000', 'Kuiv', '13158600', '16777215');
-INSERT INTO t1 VALUES ( '17', '21', '12.0000000000', '12.0000000000', 'Niiske', '9869055', '16777215');
-INSERT INTO t1 VALUES ( '18', '21', '32.0000000000', '32.0000000000', 'Niiske', '9869055', '16777215');
-INSERT INTO t1 VALUES ( '20', '21', '331.0000000000', '331.0000000000', 'Hrmatise hoiatus!', '14448840', '13158600');
-INSERT INTO t1 VALUES ( '21', '21', '11.0000000000', '11.0000000000', 'Kuiv', '13158600', '16777215');
-INSERT INTO t1 VALUES ( '22', '33', '21.0000000000', '21.0000000000', 'Pilves, kuiv', '8355711', '12632256');
-INSERT INTO t1 VALUES ( '23', '33', '13.0000000000', '13.0000000000', 'Sajab, mrg', '0', '8355839');
-INSERT INTO t1 VALUES ( '24', '33', '22.0000000000', '22.0000000000', 'Pilves, niiske', '8355711', '12632319');
-INSERT INTO t1 VALUES ( '29', '33', '33.0000000000', '33.0000000000', 'Selge, mrg', '16777215', '8355839');
-INSERT INTO t1 VALUES ( '25', '33', '23.0000000000', '23.0000000000', 'Pilves, mrg', '8355711', '8355839');
-INSERT INTO t1 VALUES ( '26', '33', '31.0000000000', '31.0000000000', 'Selge, kuiv', '16777215', '12632256');
-INSERT INTO t1 VALUES ( '27', '33', '12.0000000000', '12.0000000000', 'Sajab, niiske', '0', '12632319');
-INSERT INTO t1 VALUES ( '28', '33', '32.0000000000', '32.0000000000', 'Selge, niiske', '16777215', '12632319');
-INSERT INTO t1 VALUES ( '30', '33', '331.0000000000', '331.0000000000', 'Hrmatis! selge,kuiv', '16711680', '12632256');
-INSERT INTO t1 VALUES ( '31', '33', '11.0000000000', '11.0000000000', 'Sajab, kuiv', '0', '12632256');
-INSERT INTO t1 VALUES ( '32', '11', '1.0000000000', '1.0000000000', 'Korras', '16777215', '49152');
-INSERT INTO t1 VALUES ( '33', '21', '335.0000000000', '335.0000000000', 'Hrmatis!', '14448840', '11842740');
-INSERT INTO t1 VALUES ( '34', '21', '134.0000000000', '134.0000000000', 'Hoiatus, M+S!', '255', '13158600');
-INSERT INTO t1 VALUES ( '35', '21', '133.0000000000', '133.0000000000', 'Hoiatus, mrg!', '5263615', '13158600');
-INSERT INTO t1 VALUES ( '36', '21', '135.0000000000', '135.0000000000', 'Hrmatis!', '14448840', '11842740');
-INSERT INTO t1 VALUES ( '37', '21', '334.0000000000', '334.0000000000', 'Hrmatise hoiatus!', '14448840', '13158600');
-INSERT INTO t1 VALUES ( '38', '21', '132.0000000000', '132.0000000000', 'Hoiatus, niiske!', '9869055', '13158600');
-INSERT INTO t1 VALUES ( '39', '39', '1.0000000000', '1.0000000000', 'ei saja', '11206570', '16777215');
-INSERT INTO t1 VALUES ( '44', '39', '4.0000000000', '5.0000000000', 'lumi', '16711680', '16763080');
-INSERT INTO t1 VALUES ( '45', '12', '0.0000000000', '0.0000000000', '', '16777215', '14474460');
-INSERT INTO t1 VALUES ( '46', '39', '8.0000000000', '8.0000000000', 'rahe', '9830400', '16763080');
-INSERT INTO t1 VALUES ( '47', '39', '9.0000000000', '9.0000000000', 'tp ebaselge', '12582912', '16777215');
-INSERT INTO t1 VALUES ( '48', '39', '7.0000000000', '7.0000000000', 'lumetuisk', '7209070', '16763080');
-INSERT INTO t1 VALUES ( '142', '15', '2.0000000000', '49.0000000000', '', '0', '16777215');
-INSERT INTO t1 VALUES ( '52', '1', '-4.9000000000', '-0.1000000000', '', '0', '15774720');
-INSERT INTO t1 VALUES ( '141', '15', '-4.9000000000', '-0.1000000000', '', '0', '15774720');
-INSERT INTO t1 VALUES ( '55', '8', '0.0000000000', '0.0000000000', '', '0', '16777215');
-INSERT INTO t1 VALUES ( '56', '8', '0.0100000000', '0.1000000000', '', '0', '16770560');
-INSERT INTO t1 VALUES ( '57', '8', '0.1100000000', '25.0000000000', '', '0', '15774720');
-INSERT INTO t1 VALUES ( '58', '2', '90.0000000000', '94.9000000000', '', NULL, '16770560');
-INSERT INTO t1 VALUES ( '59', '6', '0.0000000000', '360.0000000000', '', NULL, '16777215');
-INSERT INTO t1 VALUES ( '61', '21', '38.0000000000', '38.0000000000', 'Niiske', '9869055', '16777215');
-INSERT INTO t1 VALUES ( '62', '38', '500.0000000000', '999.0000000000', '', '0', '16770560');
-INSERT INTO t1 VALUES ( '63', '38', '1000.0000000000', '2000.0000000000', '', '0', '16777215');
-INSERT INTO t1 VALUES ( '64', '17', '0.0000000000', '0.0000000000', '', NULL, '16777215');
-INSERT INTO t1 VALUES ( '65', '17', '0.1000000000', '10.0000000000', '', NULL, '16770560');
-INSERT INTO t1 VALUES ( '67', '21', '412.0000000000', '412.0000000000', 'Niiske', '9869055', '16777215');
-INSERT INTO t1 VALUES ( '68', '21', '413.0000000000', '413.0000000000', 'Mrg', '5263615', '16777215');
-INSERT INTO t1 VALUES ( '69', '21', '113.0000000000', '113.0000000000', 'Mrg', '5263615', '16777215');
-INSERT INTO t1 VALUES ( '70', '21', '416.0000000000', '416.0000000000', 'Lumine!', '16711680', '11842740');
-INSERT INTO t1 VALUES ( '71', '38', '0.0000000000', '499.0000000000', '', NULL, '16711680');
-INSERT INTO t1 VALUES ( '72', '22', '-49.0000000000', '49.0000000000', '', NULL, '16777215');
-INSERT INTO t1 VALUES ( '73', '13', '0.0000000000', '9.9000000000', '', NULL, '16777215');
-INSERT INTO t1 VALUES ( '74', '13', '10.0000000000', '14.9000000000', '', NULL, '16770560');
-INSERT INTO t1 VALUES ( '75', '7', '0.0000000000', '50.0000000000', '', NULL, '16777215');
-INSERT INTO t1 VALUES ( '76', '18', '0.0000000000', '0.0000000000', '', NULL, '16777215');
-INSERT INTO t1 VALUES ( '77', '18', '0.1000000000', '10.0000000000', '', NULL, '16770560');
-INSERT INTO t1 VALUES ( '78', '19', '300.0000000000', '400.0000000000', '', NULL, '16777215');
-INSERT INTO t1 VALUES ( '79', '19', '0.0000000000', '299.0000000000', '', NULL, '16770560');
-INSERT INTO t1 VALUES ( '80', '23', '0.0000000000', '100.0000000000', '', NULL, '16777215');
-INSERT INTO t1 VALUES ( '81', '24', '0.0000000000', '200.0000000000', '', NULL, '16777215');
-INSERT INTO t1 VALUES ( '82', '26', '0.0000000000', '0.0000000000', '', NULL, '16777215');
-INSERT INTO t1 VALUES ( '83', '26', '0.1000000000', '5.0000000000', '', NULL, '16776960');
-INSERT INTO t1 VALUES ( '84', '21', '422.0000000000', '422.0000000000', 'Niiske', '9869055', '16777215');
-INSERT INTO t1 VALUES ( '85', '21', '411.0000000000', '411.0000000000', 'Saju hoiat.,kuiv!', '16777215', '13158600');
-INSERT INTO t1 VALUES ( '86', '21', '423.0000000000', '423.0000000000', 'Mrg', '5263615', '16777215');
-INSERT INTO t1 VALUES ( '144', '16', '-49.0000000000', '-5.0000000000', '', NULL, '16777215');
-INSERT INTO t1 VALUES ( '88', '16', '2.0000000000', '49.0000000000', '', NULL, '16777215');
-INSERT INTO t1 VALUES ( '89', '21', '338.0000000000', '338.0000000000', 'Hrm.hoiatus, N+S!', '16744319', '13158600');
-INSERT INTO t1 VALUES ( '90', '21', '332.0000000000', '332.0000000000', 'Hrm.hoiat., niiske!', '16744319', '13158600');
-INSERT INTO t1 VALUES ( '91', '21', '114.0000000000', '114.0000000000', 'Hoiatus, M+S!', '255', '13158600');
-INSERT INTO t1 VALUES ( '92', '21', '117.0000000000', '117.0000000000', 'Hoiatus, J!', '14448840', '16711680');
-INSERT INTO t1 VALUES ( '93', '21', '116.0000000000', '116.0000000000', 'Lumine!', '16711680', '11842740');
-INSERT INTO t1 VALUES ( '94', '21', '414.0000000000', '414.0000000000', 'Hoiatus, M+S!', '255', '13158600');
-INSERT INTO t1 VALUES ( '95', '21', '325.0000000000', '325.0000000000', 'Hrmatis!', '14448840', '11842740');
-INSERT INTO t1 VALUES ( '96', '21', '321.0000000000', '321.0000000000', 'Hrmatise hoiatus!', '14448840', '13158600');
-INSERT INTO t1 VALUES ( '97', '21', '328.0000000000', '328.0000000000', 'Hrm.hoiatus, N+S!', '16744319', '13158600');
-INSERT INTO t1 VALUES ( '98', '21', '28.0000000000', '28.0000000000', 'Niiske ja sool', '9869055', '16777215');
-INSERT INTO t1 VALUES ( '99', '21', '118.0000000000', '118.0000000000', 'Hoiatus, N+S!', '9869055', '13158600');
-INSERT INTO t1 VALUES ( '100', '21', '418.0000000000', '418.0000000000', 'Hoiatus, N+S!', '9869055', '13158600');
-INSERT INTO t1 VALUES ( '101', '21', '322.0000000000', '322.0000000000', 'Hrm.hoiat., niiske!', '16744319', '13158600');
-INSERT INTO t1 VALUES ( '102', '21', '428.0000000000', '428.0000000000', 'Hoiatus, N+S!', '9869055', '13158600');
-INSERT INTO t1 VALUES ( '103', '21', '432.0000000000', '432.0000000000', 'Hoiatus, niiske!', '7895240', '13158600');
-INSERT INTO t1 VALUES ( '104', '21', '421.0000000000', '421.0000000000', 'Saju hoiat.,kuiv!', '16777215', '13158600');
-INSERT INTO t1 VALUES ( '105', '21', '24.0000000000', '24.0000000000', 'Mrg ja sool', '255', '16777215');
-INSERT INTO t1 VALUES ( '106', '21', '438.0000000000', '438.0000000000', 'Hoiatus, N+S!', '9869055', '13158600');
-INSERT INTO t1 VALUES ( '107', '21', '112.0000000000', '112.0000000000', 'Hoiatus, niiske!', '9869055', '13158600');
-INSERT INTO t1 VALUES ( '108', '21', '34.0000000000', '34.0000000000', 'Mrg ja sool', '255', '16777215');
-INSERT INTO t1 VALUES ( '109', '21', '434.0000000000', '434.0000000000', 'Hoiatus, M+S!', '255', '13158600');
-INSERT INTO t1 VALUES ( '110', '21', '124.0000000000', '124.0000000000', 'Hoiatus, M+S!', '255', '13158600');
-INSERT INTO t1 VALUES ( '111', '21', '424.0000000000', '424.0000000000', 'Hoiatus, M+S!', '255', '13158600');
-INSERT INTO t1 VALUES ( '112', '21', '123.0000000000', '123.0000000000', 'Hoiatus, mrg!', '5263615', '13158600');
-INSERT INTO t1 VALUES ( '140', '15', '-49.0000000000', '-5.0000000000', '', '0', '16777215');
-INSERT INTO t1 VALUES ( '114', '21', '18.0000000000', '18.0000000000', 'Niiske ja sool', '9869055', '16777215');
-INSERT INTO t1 VALUES ( '115', '21', '122.0000000000', '122.0000000000', 'Hoiatus, niiske!', '9869055', '13158600');
-INSERT INTO t1 VALUES ( '116', '21', '14.0000000000', '14.0000000000', 'Mrg ja sool', '255', '16777215');
-INSERT INTO t1 VALUES ( '117', '21', '311.0000000000', '311.0000000000', 'Hrmatise hoiatus!', '14448840', '13158600');
-INSERT INTO t1 VALUES ( '121', '2', '95.0000000000', '100.0000000000', '', NULL, '15774720');
-INSERT INTO t1 VALUES ( '118', '2', '0.0000000000', '89.9000000000', '', NULL, '16777215');
-INSERT INTO t1 VALUES ( '119', '21', '16.0000000000', '16.0000000000', 'Lumine!', '16711680', '11842740');
-INSERT INTO t1 VALUES ( '120', '21', '26.0000000000', '26.0000000000', 'Lumine!', '16711680', '11842740');
-INSERT INTO t1 VALUES ( '122', '13', '15.0000000000', '50.0000000000', '', NULL, '15774720');
-INSERT INTO t1 VALUES ( '123', '5', '0.0000000000', '9.9000000000', '', NULL, '16777215');
-INSERT INTO t1 VALUES ( '124', '5', '10.0000000000', '14.9000000000', '', NULL, '16770560');
-INSERT INTO t1 VALUES ( '125', '5', '15.0000000000', '50.0000000000', '', NULL, '15774720');
-INSERT INTO t1 VALUES ( '126', '21', '128.0000000000', '128.0000000000', 'Hoiatus, N+S!', '9869055', '13158600');
-INSERT INTO t1 VALUES ( '127', '21', '318.0000000000', '318.0000000000', 'Hrm.hoiatus, N+S!', '16744319', '13158600');
-INSERT INTO t1 VALUES ( '128', '21', '312.0000000000', '312.0000000000', 'Hrm.hoiat., niiske!', '16744319', '13158600');
-INSERT INTO t1 VALUES ( '129', '21', '126.0000000000', '126.0000000000', 'Lumine!', '16711680', '11842740');
-INSERT INTO t1 VALUES ( '130', '21', '324.0000000000', '324.0000000000', 'Hrmatise hoiatus!', '14448840', '13158600');
-INSERT INTO t1 VALUES ( '131', '21', '316.0000000000', '316.0000000000', 'Lumine!', '16711680', '11842740');
-INSERT INTO t1 VALUES ( '132', '1', '0.0000000000', '1.9000000000', '', NULL, '16769024');
-INSERT INTO t1 VALUES ( '134', '3', '-50.0000000000', '50.0000000000', '', NULL, '16777215');
-INSERT INTO t1 VALUES ( '135', '8', '26.0000000000', '2000.0000000000', '', '9868950', '15774720');
-INSERT INTO t1 VALUES ( '136', '21', '426.0000000000', '426.0000000000', 'Lumine!', '16711680', '11842740');
-INSERT INTO t1 VALUES ( '137', '21', '127.0000000000', '127.0000000000', 'Hoiatus, J!', '14448840', '16711680');
-INSERT INTO t1 VALUES ( '138', '21', '121.0000000000', '121.0000000000', 'Kuiv', '13158600', '16777215');
-INSERT INTO t1 VALUES ( '139', '21', '326.0000000000', '326.0000000000', 'Lumine!', '16711680', '11842740');
-INSERT INTO t1 VALUES ( '143', '16', '-4.9000000000', '-0.1000000000', '', NULL, '15774720');
-INSERT INTO t1 VALUES ( '145', '15', '0.0000000000', '1.9000000000', '', '0', '16769024');
-INSERT INTO t1 VALUES ( '146', '16', '0.0000000000', '1.9000000000', '', '0', '16769024');
-select * from t1 where min_value<=1 and max_value>=-1 and datatype_id=16;
-select * from t1 where min_value<=-1 and max_value>=-1 and datatype_id=16;
-drop table t1;
-
-#
-# Test of correct handling leading zero and +/- signs
-# then values are passed as strings
-# Also test overflow handling in this case
-#
-
-create table t1 (a decimal(10,2));
-insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0");
-insert into t1 values ("-.1"),("+.1"),(".1");
-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");
-insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
-insert into t1 values ("1e+4294967296"),("1e-4294967296");
-insert into t1 values ("1e+18446744073709551615"),("1e+18446744073709551616"),("1e-9223372036854775807"),("1e-9223372036854775809");
-insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
-select * from t1;
-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");
-insert into t1 values ("-.1"),("+.1"),(".1");
-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");
-insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
-insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
-select * from t1;
-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");
-insert into t1 values ("-.1"),("+.1"),(".1");
-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");
-insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
-insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
-select * from t1;
-drop table t1;
-
-
-create table t1 (a decimal(10,2));
-# The -0.0 needs to be quoted as not all platforms supports this
-insert into t1 values (0.0),("-0.0"),(+0.0),(01.0),(+01.0),(-01.0);
-insert into t1 values (-.1),(+.1),(.1);
-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);
-insert into t1 values (1e+100),(1e-100),(-1e+100);
-insert into t1 values (123.4e0),(123.4e+2),(123.4e-2),(123e1),(123e+0);
-insert into t1 values (MID("987",1,2)),("987 "),("987.6e+2 ");
-select * from t1;
-drop table t1;
-
-#
-# Test correct handling of overflowed decimal values
-#
-
-create table t1 (a decimal);
-insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+12345678901'),(99999999999999);
-select * from t1;
-drop table t1;
-create table t1 (a decimal unsigned);
-insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999);
-select * from t1;
-drop table t1;
-create table t1 (a decimal zerofill);
-insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999);
-select * from t1;
-drop table t1;
-create table t1 (a decimal unsigned zerofill);
-insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999);
-select * from t1;
-drop table t1;
-
-# Exponent overflow bug
-create table t1(a decimal(10,0));
-insert into t1 values ("1e4294967295");
-select * from t1;
-delete from t1;
-insert into t1 values("1e4294967297");
-select * from t1;
-drop table t1;
-
-#
-# Test of wrong decimal type
-#
-
---error 1064
-CREATE TABLE t1 (a_dec DECIMAL(-1,0));
---error 1064
-CREATE TABLE t1 (a_dec DECIMAL(-2,1));
---error 1064
-CREATE TABLE t1 (a_dec DECIMAL(-1,1));
---error 1427
-CREATE TABLE t1 (a_dec DECIMAL(0,11));
-
-#
-# Zero prepend overflow bug
-#
---disable_warnings
-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;
-drop table t1;
-create table t1(a decimal(7,3) unsigned);
-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;
-drop table t1;
-create table t1(a decimal(7,3) zerofill);
-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');
---enable_warnings
-select * from t1;
-drop table t1;
-
-#
-# Bug #7589: a problem with update from column
-#
-
-create table t1(a decimal(10,5), b decimal(10,1));
-insert into t1 values(123.12345, 123.12345);
-update t1 set b=a;
-select * from t1;
-drop table t1;
-
---echo End of 4.1 tests
-
-#
-# Test for BUG#8397: decimal type in subselects (Item_cache_decimal)
-#
-CREATE TABLE t1
-(EMPNUM CHAR(3) NOT NULL,
-HOURS DECIMAL(5));
-CREATE TABLE t2
-(EMPNUM CHAR(3) NOT NULL,
-HOURS BIGINT);
-
-INSERT INTO t1 VALUES ('E1',40);
-INSERT INTO t1 VALUES ('E8',NULL);
-INSERT INTO t2 VALUES ('E1',40);
-
-SELECT EMPNUM FROM t1 WHERE HOURS IN (SELECT HOURS FROM t2);
-SELECT EMPNUM FROM t1 WHERE HOURS IN (SELECT HOURS FROM t1);
-
-DROP TABLE t1,t2;
-
-#
-# Test limits of decimal
-#
-create table t1 (d decimal(64,0));
-insert into t1 values (1);
-select * from t1;
-drop table t1;
-create table t1 (d decimal(5));
-show create table t1;
-drop table t1;
-create table t1 (d decimal);
-show create table t1;
-drop table t1;
---error 1426
-create table t1 (d decimal(66,0));
-
-#
-# Test example from manual
-#
-
-CREATE TABLE t1 (i INT, d1 DECIMAL(9,2), d2 DECIMAL(9,2));
-INSERT INTO t1 VALUES (1, 101.40, 21.40), (1, -80.00, 0.00),
-(2, 0.00, 0.00), (2, -13.20, 0.00), (2, 59.60, 46.40),
-(2, 30.40, 30.40), (3, 37.00, 7.40), (3, -29.60, 0.00),
-(4, 60.00, 15.40), (4, -10.60, 0.00), (4, -34.00, 0.00),
-(5, 33.00, 0.00), (5, -25.80, 0.00), (5, 0.00, 7.20),
-(6, 0.00, 0.00), (6, -51.40, 0.00);
-
-SELECT i, SUM(d1) AS a, SUM(d2) AS b FROM t1 GROUP BY i HAVING a <> b;
-SELECT i, ROUND(SUM(d1), 2) AS a, ROUND(SUM(d2), 2) AS b FROM t1 GROUP BY i
-HAVING a <> b;
-drop table t1;
-
-#
-# A test case for Bug#4956 "strange result, insert into longtext, parameter
-# with numeric value": ensure that conversion is done identically no matter
-# where the input data comes from.
-#
-create table t1 (c1 varchar(100), c2 longtext);
-insert into t1 set c1= 'non PS, 1.0 as constant', c2=1.0;
-prepare stmt from "insert into t1 set c1='PS, 1.0 as constant ', c2=1.0";
-execute stmt;
-set @a=1.0;
-insert into t1 set c1='non PS, 1.0 in parameter', c2=@a;
-prepare stmt from "insert into t1 set c1='PS, 1.0 in parameter ', c2=?";
-execute stmt using @a;
-select * from t1;
-deallocate prepare stmt;
-drop table t1;
-
-#
-# A test case for Bug#5673 "Rounding problem in 4.0.21 inserting decimal
-# value into a char field": this is a regression bug in 4.0 tree caused by
-# a fix for some other decimal conversion issue. The patch never was
-# approved to get into 4.0 (maybe because it was considered too intrusive)
-#
-
-create table t1 (
- strippedproductid char(15) not null default '',
- zlevelprice decimal(10,2) default null,
- primary key (strippedproductid)
-);
-
-create table t2 (
- productid char(15) not null default '',
- zlevelprice char(21) default null,
- primary key (productid)
-);
-
-insert into t1 values ('002trans','49.99');
-insert into t1 values ('003trans','39.98');
-insert into t1 values ('004trans','31.18');
-
-insert INTO t2 SELECT * FROM t1;
-
-select * from t2;
-drop table t1, t2;
-
-#
-# Bug #17826 'type_decimal' fails with ps-protocol
-#
-create table t1 (f1 decimal(5));
-insert into t1 values (40);
-flush tables;
-select f1 from t1 where f1 in (select f1 from t1);
-drop table t1;
-
-#
-# Bug#22183: Unhandled NULL caused server crash
-#
-create table t1 as
- select from_days(s) as date,t
- from (select 1 as s,'t' as t union select null, null ) as sub1;
-select group_concat(t) from t1 group by week(date)/10;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/type_enum.test b/mysql-test/suite/pbxt/t/type_enum.test
deleted file mode 100644
index ec562f377f6..00000000000
--- a/mysql-test/suite/pbxt/t/type_enum.test
+++ /dev/null
@@ -1,172 +0,0 @@
-#
-# Problem with many enums
-#
-
---disable_warnings
-DROP TABLE if exists t1;
---enable_warnings
-
-CREATE TABLE t1 (
- field enum('001001','001004','001010','001018','001019','001020','001021','001027','001028','001029','001030','001031','001100','002003','002004','002005','002007','002008','002009','002012','002013','002014','003002','003003','003004','003005','003006','003007','003008','003009','003010','003011','003012','003013','003014','003015','003016','003017','003018','003019','004002','004003','004005','004006','004007','004008','004010','004012','004014','004016','004017','004020','004021','004022','004023','004024','004025','004026','006002','006004','006006','006010','006011','006012','006013','006014','007001','007002','007003','007004','007005','007006','007007','007008','007009','007010','007011','007012','007013','007014','007015','007016','007017','007018','007019','007020','007021','007022','007023','007024','007025','007026','007027','007028','007029','007030','007031','007032','007033','007034','007035','007036','007037','007038','007039','007040','007043','007044','009001','009002','009004','009005','009006','009007','009008','009009','009010','009011','009012','009013','010002','010003','010004','010005','010006','010007','010008','010009','010010','010011','010012','010013','010015','010016','010017','010018','010019','010020','010021','010022','010023','010024','010025','010026','010027','010028','011001','011002','011003','011004','011006','011012','011013','011014','011015','011016','012017','012018','012019','012023','012027','012028','012029','012030','012031','012032','012033','012034','012035','012036','012037','012038','012039','014001','016002','016003','016004','016007','016010','016011','016016','016019','016020','016021','016022','016023','016024','016026','016027','016028','016029','016030','016031','016032','016033','016034','017002','018001','019002','019004','020001','020003','020004','020005','020006','020007','020008','020009','022001','022002','022003','023001','023002','023003','023004','023005','023006','023007','023008','023010','023011','023012','023017','023019','023020','023021','023025','023026','023027','023028','023029','023030','023031','023032','023033','023034','023035','025001','025003','025004','025005','025006','025007','025008','025009','025010','025011','025012','025013','025014','025015','025016','025017','025018','025019','025020','025021','025022','025023','025024','025025','025026','025027','025028','025029','025030','025031','025032','025033','025034','025035','025036','025037','025038','025039','025040','025041','025042','025043','025044','025045','025046','025047','025048','025049','025050','025051','025052','025053','025054','025055','025056','025057','025058','025059','025060','025061','025062','025063','027001','027002','027011','035008','035012','036001','037001','037003','037004','037005','037006','037007','037008','037009','038004','038005','038006','038007','038009','039001','039002','039003','039004','039005','039006','046001','046002','046003','046004','046005','046007','046008','046009','046010','046011','046012','046013','046014','047001','047002','048001','051001','051002','051003','051004','052001','052002','052005','053015','053016','053019','053020','053023','053024','053026','053028','053029','053033','053034','053036','053037','053038','053039','053041','053042','053043','053045','053046','053047','053048','053051','053052','053054','053055','053056','053057','053068','053069','053070','053073','053074','053075','053086','053094','053095','053096','053097','053098','053099','053100','053101','053102','053103','053104','053105','053107','053122','053123','053124','053125','053127','053128','054001','054002','054003','054004','054005','054006','054007','054009','054010','056001','056002','056003','056004','056005','056006','056009','056010','056011','056016','056017','056018','056019','056020','056021','056022','057001','057002','057003','057004','058002','058003','058004','058005','060001','060003','060004','060005','060006','060007','061002','061003','061004','061005','061006','069006','069007','069010','069011','069012','069013','069014','069015','069016','069017','069018','069020','069021','069022','069023','069024','071002','071003','071004','071005','071006','071008','071011','071013','071020','071021','071022','072001','073001','073002','073003','073004','074001','074002','074003','074004','074005','074006','074007','074008','074009','074010','074011','074012','075001','075007','076101','076102','076103','077001','077002','077003','077004','077006','077007','077008','077009','078005','079002','079003','079004','079005','079006','079007','081001','082006','082007','082011','082013','082014','082015','082016','082017','082021','082022','082023','082024','082025','082026','082027','082028','082029','082030','082031','082032','082033','082034','082035','082036','082037','082038','082039','082040','082041','082042','082043','082044','084001','084002','084003','084004','084005','084007','084008','084009','084011','084013','084014','084016','084017','084027','084031','084032','084033','084035','084036','084037','084038','084039','084040','084041','084042','084043','084044','084045','084046','084047','084048','084049','084050','084051','085001','085002','085003','085004','085005','085006','085007','085009','085011','085012','085013','085014','085015','085016','085017','085018','085019','085020','085021','085022','085023','085028','085029','085030','085031','085033','085034','085035','085036','085037','085038','085040','085041','085042','085043','085044','085045','085046','085047','085048','085063','085064','085065','085068','085070','085071','085073','085082','085083','085086','085088','085089','085090','085091','085092','085093','085094','085095','085096','085097','085098','085099','085100','085101','085102','085103','085104','085105','085106','085107','085108','085109','085110','085111','085112','085113','085115','085119','085120','085121','085122','085123','085124','085125','085126','085127','085128','085129','085130','085132','085133','085134','085135','085136','085137','086001','086002','086003','086004','086005','088001','088003','088005','088006','088007','088008','088009','089001','090001','090002','090003','090004','090005','090006','090007','090008','090009','090010','090013','090015','090016','090017','090018','090019','090022','090027','090028','091001','091002','091005','091008','091009','091010','091011','091012','091013','091014','091015','091016','091017','091018','093001','093003','093098','093100','093102','093104','093141','093142','093146','093151','093153','093167','093168','093176','094001','094002','094004','094005','095004','099001','099002','100001','101001','102002','102003','105001','105002','106001','113001','113002','113003','113004','113005','113006','113007','113008','113009','113010','113011','113012','113013','113014','113015','113016','113017','113018','113019','113020','113021','113022','113023','113024','113025','113026','113027','113028','114001','115001','115002','115003','115004','115005','115006','115007','115008','115009','115010','115011','115012','115013','115014','115015','115016','115017','115018','115020','115021','115022','115023','115025','115026','115027','115028','115029','115030','115031','115032','115033','115034','115035','115036','115039','115040','115041','115042','115043','115044','115045','115046','115047','115048','115049','115050','115051','115052','115053','115054','115055','115056','115057','115059','115060','115061','115062','115063','115064','115065','115066','115067','115068','115069','115070','115071','115072','115073','115075','115076','115081','115082','115085','115086','115087','115088','115095','115096','115097','115098','115099','115101','115102','115103','115104','115105','115106','115108','115109','115110','115111','115112','115113','115114','115115','115116','115117','115118','115119','115120','115121','115122','116001','116002','116003','116004','116005','116006','116007','116008','116009','116010','116011','116012','117001','117002','117003','123001','124010','124014','124015','124019','124024','124025','124026','124027','124028','124029','124030','124031','124032','124033','124035','124036','124037','124038','124039','124040','124041','124042','124043','124044','124045','124046','124047','124048','124049','124050','124051','124052','124053','124054','124055','124056','124057','124058','124059','124060','124061','124062','124063','124064','124065','126001','126002','126003','126004','126005','126006','126007','126008','126009','126010','126011','126012','130001','132001','132002','132003','133001','133008','133009','133010','133011','133012','133013','133014','133015','133016','133017','133018','133019','133020','133021','133022','133023','133024','133025','133027','133028','133029','133030','133031','134001','135001','135002','135003','135004','135005','135006','135007','135008','135009','135010','136001','137009','137010','137011','137012','137013','137014','137015','137016','137017','137018','137019','138001','138002','138003','138004','139001','139003','140001','141001','141002','141003','141006','141007','141008','141009','141011','141012','141014','141015','141016','141017','141018','141019','141020','141021','141022','141023','141024','141025','141026','141027','141028','142001','142002','142003','142004','142005','142006','142007','142008','142010','142011','142012','144001','145001','145002','145003','145004','145005','145006','145007','145008','145009','145010','145011','145012','145013','145014','145015','145016','147001','150003','150005','150009','150013','150014','150015','150016','150017','150020','150021','152001','152002','152003','152004','152005','152006','152007','154001','154002','154003','155001','155002','155003','155004','155005','155006','159001','159002','159003','159004','160001','160002','160003','161001','162001','162002','162003','162004','162007','162010','162011','162012','163001','163002','163003','163005','163010','163011','163014','163015','163016','165001','165002','165003','165004','165005','165006','165007','165008','165009','165010','165011','165012','165013','165014','165015','165016','165017','165018','165019','165020','165021','165022','165023','165024','165025','165026','165027','165028','165029','165030','165031','165032','165033','165034','165035','165036','167001','168001','168002','168003','168004','168005','168007','168008','168009','168010','168011','168012','168013','168014','169001','169002','169003','169007','169008','169009','169010','170001','171001','171002','171003','171004','171005','171006','171007','171008','171009','172001','174001','174002','174003','176001','176002','176003','177001','177002','179001','179002','179003','179004','179005','179006','179007','179008','179009','179010','179011','179012','179013','179014','179015','179016','179017','179018','179019','179020','179021','179022','179023','179024','179025','179026','179027','179028','179029','179030','179031','179032','179033','179034','179035','179036','179037','179038','179039','179040','179041','179042','179043','179044','179045','179046','179047','180001','180010','180012','180013','180014','180015','180016','180017','180018','180019','180020','180021','180022','180023','180024','180025','180026','180027','180028','180030','180031','180032','180033','180034','180035','180036','180037','180038','180039','180041','180042','180043','180044','180045','180046','180047','180048','180049','180050','180051','180052','180053','180054','180055','180056','180057','180058','180059','180060','180061','180062','180063','180064','180065','180066','180067','180068','180069','180070','180071','182001','184001','184002','184005','184006','184007','184008','184009','184010','184011','185001','185003','187001','188001','188002','188003','188004','188005','188006','188007','188008','188009','188010','188011','191001','191002','192002','194001','194002','194003','194004','194005','194006','194007','195001','195002','195003','195004','195005','195006','195007','196001','196002','197001','197002','197003','197004','197005','197006','198001','198003','198004','198005','198006','198007','198008','198009','198010','198011','198012','198013','198014','198015','198016','198017','201001','201002','201005','202001','203001','203002','203003','203017','203018','203019','204001','204002','204003','205001','208001','208002','208003','208004','208005','209001','209002','209003','210001','210002','210003','210004','210005','210006','210007','210008','210009','210010','210011','210012','210013','211017','212001','212002','212003','212004','212005','212006','212007','212008','212009','212010','212011','212012','212013','218001','218003','218004','218006','218007','218008','218009','218011','218015','218016','218017','218018','218019','218020','218021','218022','218023','218024','218025','218026','218027','218028','218029','218030','218031','218032','218033','218034','218035','218036','221001','221002','221003','221004','221005','221006','221007','221008','221009','221010','221011','221012','221013','223001','223002','223003','224001','224002','224003','224006','224007','224008','225001','225002','225003','225004','225005','225006','225007','225008','225009','225010','225011','225012','225013','226001','226002','226003','226004','226005','226006','226007','226008','226009','227001','227002','227003','227004','227005','227006','227007','227008','227009','227010','227011','227012','227013','227014','227015','227016','227017','227018','227019','227020','227021','227022','227023','227024','227025','227026','227027','227028','227029','227030','227031','227032','227033','227034','227035','227036','227037','227038','227039','227040','227041','227042','227043','227044','227045','227046','227047','227048','227049','227050','227051','227052','227053','227054','227055','227056','227057','227058','227059','227060','227061','227062','227063','227064','227065','227066','227067','227068','227069','227070','227071','227072','227073','227074','227075','227076','227077','227078','227079','227080','227081','227082','227083','227084','227085','227086','227087','227088','227089','227090','227091','227092','227093','227094','227095','227096','227097','227098','227099','227100','227101','227102','227103','227104','227105','227106','227107','227108','227109','227110','227111','227112','227113','227114','227115','227116','227117','227118','227119','227120','227122','227123','227124','227125','227126','227127','227128','227129','227130','227131','227132','227133','227134','227135','227136','227137','227138','227139','227140','227141','227142','227143','227144','227145','227146','227147','227148','227149','227150','227151','227152','228001','229001','229002','229003','229004','229005','230001','230002','232001','233001','233002','233003','233004','233005','233006','233007','233008','234001','234002','234003','234004','234005','234006','234007','234008','234009','234010','234011','234012','234013','234014','234015','234016','234017','234018','234019','234020','234021','234022','234023','234024','234025','234026','234027','234028','234029','234030','235001','235002','235003','235004','235005','236001','236002','236003','237001','238002','238003','238004','238005','238006','238007','238008','333013','333014','333015','333016','333017','333018','333019','333020','333021','333022','333023','333024','333025','333030','333031','333032','333033','333034','333035','334001','334002','334003','334004','334005','334006','334007','336004','337001','337002','337003','337004','339001','339002','343001','344001','344002','344003','344004','344005','345001','345002','345003','347001','347002','348001','348002','348003','348004','348005','349001','349002','349003','350001','353001','353002','353003','353004','355001','355002','355003','355004','355005','355006','356001','358001','359001','359002','360001','360002','360003','360004','360005','366001','366002','366003','366004','369001','373001','373002','373003','373004','373005','373006','373007','373008','373009','373010','373011','373012','373013','373014','373015','373016','373017','373018','373019','373020','373021','374001','374002','374003','374004','374005','374006','374007','374008','374009','374010','374011','374012','374013','374014','374015','374016','376001','376002','376003','376004','376005','376006','376007','376008','376009','376010','376011','376012','376013','376016','376017','376018','376019','376020','376021','379003','382001','382002','383001','384001','384002','385001','385002','386001','386002','386003','386004','386005','386006','386007','386008','386009','386010','386011','386012','386013','386014','387001','389001','389002','389003','389004','392001','393001','393002','393003','393004','395001','396001','397001','397002','399001','399002','399003','400001','400002','401001','401002','401003','402001','402002','402003','402004','402005','403001','403002','403003','504001','504002','504004','504005','504006','504007','504008','504009','504010','504011','504012','504013','504014','504017','504018','504019','504021','504022','504023','504024','504025','506001','506002','508001','508002','511001','511002','511003','511004','511005','511006','511007','511008','511009','511010','511011','511012','511013','511014','511017','511018','511020','511021','511022','511024','511028','511029','513001','513002','513003','513004','514001','515001','515002','515003','515007','515008','515009','515010','515011','515012','515013','515014','515015','518001','518002','518003','520001','520002','521001','521002','521003','521004','521005','521006','521007','521008','521009','521010','521011','521012','521013','521014','521015','521016','523001','523002','523003','523004','523005','523006','523007','524001','700001','701001','701002','701003','702001','702002','702003','702004','702005','702006','702007','702008','703001','703002','703003','704001','704002','704003','704004','705001','706001','706002','707001','707002','707003','708001','709001','709002','710001','710002','711001','711002','712001','713001','713002','714001','714002','715001','716001','718001','718002','719001','719002','991001','991002','991003','991004','991005','991006','991007','991008','992001','995001','996001','996002','996003','998001','998002','998003','998004','998005','998006','998007','999001','999002','011017','011018','034001','034002','071010','208006','239001','519001','519003','126013','184012','053071','374017','374018','374019','374020','374021','404001','405002','405001','405003','405007','405006','405005','405004','240011','240010','240009','240008','240007','240006','240005','240004','240003','240002','240001','240012','240013','240014','240015','240016','240017','357001','235006','235007','712002','355008','355007','056023','999999','046015','019005','126014','241003','241002','241001','240018','240020','240019','242001','242002','242003','242004','242005','242006','089002','406001','406002','406003','406004','406005','406006','243001','243002','243003','243004','243005','243006','243007','243008','010030','010029','407001','407006','407005','407004','407003','407002','408001','366005','133032','016035','077010','996004','025064','011019','407007','407008','407009','409001','115123','504026','039007','039009','039008','039010','039011','039012','180072','240021','240023','408002','405008','235008','525001','525002','525003','525004','410001','410002','410003','410004','410005','410006','410007','410008','410009','410010','410011','410012','410013','410014','410015','410016','344006','240031','240030','240029','240028','240027','240026','240025','240024','240034','240033','240032','410017','410018','411001','411002','411003','411004','411005','411006','411007','411008','203020','203021','203022','412001','412002','412003','412004','069025','244001','244002','244009','244008','244007','244006','244005','244004','244003','244015','244014','244013','244012','244011','244010','244016','244017','240042','240041','240040','240039','240038','240037','240036','240035','405009','405010','240043','504034','504033','504032','504031','504030','504029','504028','504027','504042','504041','504040','504039','504038','504037','504036','504035','800001','410019','410020','410021','244018','244019','244020','399004','413001','504043','198018','198019','344007','082045','010031','010032','010033','010034','010035','504044','515016','801002','801003','801004','801005','802001','801001','414001','414002','414003','141029','141030','803001','803002','803003','803004','803005','803006','803007','803008','803009','803010','803011','803012','803013','803014','803015','803016','803017','410022','410023','803018','803019','803020','415002','415001','244021','011020','011023','011022','011021','025065','165037','165038','165039','416001','416002','416003','417001','418001','504045','803022','803021','240022','419001','420001','804010','804009','804008','804007','804006','804005','804004','804003','804002','804001','804020','804019','804018','804017','804016','804015','804014','804013','804012','804011','804024','804021','804023','804022','511019','511016','511015','511032','511031','511030','511027','511026','511025','511033','511023','133034','133033','169011','344008','344009','244022','244026','244025','244030','244023','244024','244027','244028','244029','244031','082046','082047','082048','126015','126016','416004','416005','421001','421002','016037','016036','115124','115125','115126','240049','240048','240047','240046','240045','240044','244032','244033','422001','422002','422003','422004','422005','184013','239002','805001','805002','805003','805004','805005','056024','423001','344010','235009','212014','056025','056026','802002','244034','244035','244036','244037','244038','244039','515017','504046','203015','245002','245001','071023','056027','056028','056029','056030','056031','056032','424001','056034','056033','805006','805007','805008','805009','805010','422008','422007','422006','422010','422009','422011','209004','150022','150023','100002','056035','023036','185004','185005','246001','247001','247002','425001','416006','165042','165041','165040','165043','010040','010039','010038','010037','010036','422012','422013','422014','422015','426000','248001','248002','248003','248004','248005','249001','249002','249003','249004','249005','249006','250007','250001','250002','250003','250004','250005','250006','250008','250009','250010','250011','250012','250013','251001','251002','422016','422017','422018','806001','806002','116013','235010','235011','091026','091027','091028','091029','091019','091020','091021','091022','091023','091024','091025','252001','243009','249007','249008','249009','011024','011025','427001','428002','428001','169012','429001','429002','429003') DEFAULT '001001' NOT NULL,
- KEY field (field)
-);
-INSERT INTO t1 VALUES ('001001'),('001001'),('001001'),('001001'),('001001'),('001001'),('001001'),('001001'),('001001'),('001010'),('001010'),('001010'),('001010'),('001010'),('001018'),('001018'),('001018'),('001018'),('001018'),('001018'),('001020'),('001020'),('001020'),('001020'),('001020'),('001020'),('001020'),('001020'),('001021'),('001021'),('001021'),('001021'),('001021'),('001021'),('001027'),('001027'),('001028'),('001030'),('001030'),('001030'),('001030'),('001031'),('001031'),('001031'),('001031'),('001031'),('001100'),('001100'),('002003'),('002003'),('002003'),('002003'),('002003'),('002003'),('002003'),('002003'),('002003'),('002004'),('002004'),('002004'),('002004'),('002004'),('002004'),('002004'),('002004'),('002004'),('002005'),('002005'),('002005'),('002005'),('002005'),('002005'),('002005'),('002005'),('002007'),('002007'),('002007'),('002007'),('002007'),('002007'),('002007'),('002008'),('002008'),('002008'),('002008'),('002008'),('002008'),('002008'),('002008'),('002009'),('002009'),('002009'),('002009'),('002009'),('002009'),('002009'),('002009'),('002012'),('002012'),('002012'),('002012'),('002012'),('002012'),('002012'),('002013'),('002013'),('002013'),('002013'),('002013'),('002013'),('002013'),('002013'),('002013'),('002014'),('002014'),('002014'),('002014'),('002014'),('002014'),('002014'),('002014'),('003002'),('003002'),('003002'),('003002'),('003002'),('003002'),('003003'),('003003'),('003003'),('003003'),('003003'),('003003'),('003004'),('003004'),('003004'),('003004'),('003004'),('003004'),('003005'),('003005'),('003005'),('003005'),('003005'),('003005'),('003005'),('003005'),('003005'),('003006'),('003006'),('003006'),('003006'),('003006'),('003006'),('003006'),('003006'),('003007'),('003007'),('003007'),('003007'),('003007'),('003008'),('003008'),('003008'),('003008'),('003008'),('003008'),('003009'),('003009'),('003009'),('003009'),('003009'),('003009'),('003009'),('003009'),('003009'),('003010'),('003010'),('003010'),('003010'),('003010'),('003010'),('003010'),('003010'),('003010'),('003011'),('003011'),('003011'),('003011'),('003011'),('003011'),('003011'),('003011'),('003012'),('003012'),('003012'),('003012'),('003012'),('003012'),('003012'),('003012'),('003013'),('003013'),('003013'),('003013'),('003013'),('003013'),('003013'),('003013'),('003014'),('003014'),('003014'),('003014'),('003014'),('003014'),('003014'),('003014'),('003015'),('003015'),('003015'),('003015'),('003015'),('003015'),('003016'),('003016'),('003016'),('003016'),('003016'),('003016'),('003017'),('003017'),('003017'),('003017'),('003017'),('003018'),('003018'),('003018'),('003018'),('003018'),('003019'),('003019'),('004003'),('004005'),('004005'),('004005'),('004005'),('004005'),('004005'),('004006'),('004008'),('004010'),('004012'),('004012'),('004014'),('004014'),('004014'),('004014'),('004014'),('004016'),('004017'),('004017'),('004017'),('004017'),('004017'),('004017'),('004017'),('004017'),('004020'),('004020'),('004020'),('004020'),('004020'),('004020'),('004021'),('004021'),('004021'),('004021'),('004021'),('004021'),('004021'),('004022'),('004023'),('004023'),('004023'),('004023'),('004023'),('004023'),('004023'),('004025'),('004026'),('004026'),('004026'),('004026'),('004026'),('006004'),('006006'),('006010'),('006010'),('006010'),('006010'),('006010'),('006010'),('006010'),('006011'),('006011'),('006011'),('006011'),('006011'),('006011'),('006012'),('006012'),('006012'),('006012'),('006012'),('006012'),('006014'),('006014'),('006014'),('007001'),('007001'),('007002'),('007003'),('007005'),('007007'),('007008'),('007009'),('007011'),('007012'),('007013'),('007015'),('007016'),('007017'),('007018'),('007019'),('007019'),('007020'),('007021'),('007021'),('007022'),('007023'),('007023'),('007025'),('007025'),('007025'),('007027'),('007029'),('007031'),('007031'),('007032'),('007034'),('007034'),('007036'),('007036'),('007036'),('007037'),('007037'),('007038'),('007040'),('007040'),('007040'),('007043'),('009001'),('009001'),('009001'),('009001'),('009001'),('009001'),('009001'),('009002'),('009002'),('009002'),('009002'),('009002'),('009004'),('009004'),('009004'),('009004'),('009005'),('009005'),('009005'),('009005'),('009005'),('009005'),('009005'),('009005'),('009006'),('009006'),('009006'),('009006'),('009007'),('009007'),('009007'),('009007'),('009007'),('009007'),('009008'),('009010'),('009010'),('009010'),('009010'),('009010'),('009010'),('009011'),('009011'),('009011'),('009011'),('009011'),('009012'),('009013'),('009013'),('009013'),('010002'),('010002'),('010002'),('010002'),('010002'),('010002'),('010002'),('010002'),('010003'),('010003'),('010003'),('010003'),('010003'),('010003'),('010003'),('010003'),('010003'),('010004'),('010004'),('010004'),('010004'),('010004'),('010004'),('010004'),('010004'),('010004'),('010005'),('010005'),('010005'),('010005'),('010006'),('010006'),('010006'),('010006'),('010006'),('010006'),('010006'),('010006'),('010006'),('010007'),('010007'),('010007'),('010007'),('010007'),('010007'),('010008'),('010008'),('010008'),('010008'),('010008'),('010008'),('010008'),('010009'),('010009'),('010009'),('010009'),('010009'),('010009'),('010010'),('010010'),('010010'),('010010'),('010010'),('010010'),('010010'),('010011'),('010011'),('010011'),('010011'),('010011'),('010011'),('010011'),('010011'),('010012'),('010012'),('010012'),('010012'),('010012'),('010012'),('010012'),('010013'),('010013'),('010013'),('010013'),('010013'),('010013'),('010015'),('010016'),('010016'),('010016'),('010016'),('010016'),('010016'),('010016'),('010016'),('010017'),('010017'),('010017'),('010017'),('010017'),('010017'),('010018'),('010018'),('010018'),('010018'),('010018'),('010018'),('010018'),('010018'),('010018'),('010019'),('010019'),('010019'),('010019'),('010019'),('010019'),('010020'),('010020'),('010020'),('010021'),('010021'),('010021'),('010021'),('010021'),('010021'),('010022'),('010022'),('010022'),('010022'),('010022'),('010022'),('010022'),('010022'),('010023'),('010023'),('010023'),('010023'),('010023'),('010023'),('010023'),('010023'),('010026'),('010027'),('010028'),('010028'),('011001'),('011001'),('011001'),('011001'),('011001'),('011001'),('011001'),('011002'),('011002'),('011002'),('011002'),('011002'),('011002'),('011002'),('011003'),('011003'),('011003'),('011003'),('011003'),('011003'),('011003'),('011003'),('011004'),('011004'),('011004'),('011004'),('011004'),('011004'),('011004'),('011006'),('011006'),('011006'),('011006'),('011006'),('011006'),('011006'),('011012'),('011012'),('011012'),('011013'),('011013'),('011013'),('011013'),('011013'),('011013'),('011014'),('011014'),('011014'),('011014'),('011015'),('011015'),('011015'),('011015'),('011015'),('011016'),('011016'),('011016'),('011016'),('011016'),('012017'),('012017'),('012027'),('012027'),('012032'),('012034'),('012036'),('012036'),('012037'),('012037'),('012038'),('012039'),('014001'),('014001'),('016016'),('016016'),('016016'),('016019'),('016020'),('016020'),('016020'),('016020'),('016020'),('016020'),('016020'),('016020'),('016021'),('016021'),('016021'),('016021'),('016021'),('016021'),('016021'),('016022'),('016022'),('016022'),('016023'),('016023'),('016023'),('016024'),('016024'),('016024'),('016024'),('016024'),('016024'),('016024'),('016026'),('016026'),('016026'),('016026'),('016026'),('016026'),('016028'),('016028'),('016028'),('016028'),('016028'),('016028'),('016028'),('016029'),('016029'),('016030'),('016031'),('016032'),('016032'),('016032'),('016032'),('016032'),('016032'),('016032'),('016033'),('016033'),('016033'),('016033'),('016033'),('016034'),('016034'),('016034'),('016034'),('016034'),('017002'),('017002'),('017002'),('017002'),('017002'),('018001'),('018001'),('018001'),('018001'),('018001'),('018001'),('018001'),('018001'),('019002'),('019002'),('019002'),('019002'),('019002'),('019002'),('019004'),('019004'),('019004'),('019004'),('019004'),('019004'),('020001'),('020001'),('020001'),('020001'),('020004'),('020006'),('020006'),('020006'),('020006'),('020006'),('020006'),('020008'),('020009'),('020009'),('020009'),('020009'),('020009'),('022001'),('022001'),('022001'),('022001'),('022002'),('022002'),('022002'),('022002'),('022003'),('022003'),('022003'),('022003'),('023001'),('023002'),('023002'),('023002'),('023002'),('023002'),('023002'),('023003'),('023003'),('023003'),('023003'),('023004'),('023004'),('023005'),('023005'),('023006'),('023006'),('023006'),('023006'),('023006'),('023006'),('023007'),('023007'),('023010'),('023010'),('023011'),('023011'),('023017'),('023019'),('023019'),('023019'),('023020'),('023020'),('023025'),('023025'),('023025'),('023026'),('023026'),('023026'),('023027'),('023027'),('023027'),('023028'),('023028'),('023029'),('023029'),('023030'),('023030'),('023032'),('023033'),('023033'),('023033'),('023033'),('023033'),('023033'),('023034'),('023035'),('023035'),('025001'),('025001'),('025001'),('025001'),('025001'),('025001'),('025001'),('025003'),('025003'),('025004'),('025004'),('025005'),('025005'),('025007'),('025007'),('025008'),('025008'),('025009'),('025010'),('025010'),('025010'),('025011'),('025011'),('025012'),('025012'),('025013'),('025013'),('025013'),('025014'),('025015'),('025016'),('025018'),('025018'),('025019'),('025019'),('025020'),('025020'),('025021'),('025022'),('025022'),('025023'),('025023'),('025024'),('025025'),('025025'),('025026'),('025026'),('025027'),('025027'),('025027'),('025028'),('025030'),('025031'),('025033'),('025034'),('025035'),('025037'),('025041'),('025042'),('025043'),('025046'),('025048'),('025048'),('025048'),('025049'),('025049'),('025049'),('025050'),('025050'),('025050'),('025051'),('025051'),('025052'),('025052'),('025052'),('025053'),('025053'),('025054'),('025054'),('025054'),('025054'),('025055'),('025056'),('025056'),('025056'),('025056'),('025056'),('025056'),('025056'),('025056'),('025056'),('025057'),('025057'),('025058'),('025058'),('025060'),('025060'),('025061'),('025062'),('025063'),('027001'),('027002'),('027011'),('036001'),('036001'),('036001'),('036001'),('036001'),('037003'),('037006'),('037007'),('037008'),('037008'),('038009'),('039001'),('039001'),('039001'),('039001'),('039001'),('039001'),('039002'),('039002'),('039002'),('039002'),('039002'),('039003'),('039003'),('039003'),('039003'),('039003'),('039003'),('039004'),('039004'),('039004'),('039004'),('039004'),('039005'),('039005'),('039005'),('039005'),('039005'),('039006'),('039006'),('039006'),('039006'),('046001'),('046001'),('046001'),('046001'),('046001'),('046001'),('046001'),('046001'),('046002'),('046002'),('046002'),('046002'),('046002'),('046002'),('046002'),('046002'),('046003'),('046003'),('046003'),('046003'),('046003'),('046003'),('046003'),('046005'),('046005'),('046005'),('046005'),('046005'),('046005'),('046005'),('046007'),('046007'),('046007'),('046007'),('046007'),('046007'),('046008'),('046008'),('046008'),('046008'),('046008'),('046009'),('046009'),('046009'),('046010'),('046012'),('046012'),('046012'),('046013'),('046014'),('046014'),('046014'),('047001'),('047001'),('047001'),('047001'),('047001'),('047001'),('047001'),('047001'),('047002'),('047002'),('047002'),('047002'),('047002'),('047002'),('047002'),('047002'),('048001'),('048001'),('048001'),('048001'),('048001'),('048001'),('048001'),('048001'),('051003'),('051003'),('051003'),('051003'),('051003'),('051004'),('051004'),('051004'),('051004'),('052001'),('052001'),('052001'),('052001'),('052001'),('052001'),('052001'),('052001'),('052002'),('052002'),('052005'),('052005'),('052005'),('052005'),('052005'),('052005'),('053016'),('053019'),('053019'),('053023'),('053023'),('053023'),('053023'),('053024'),('053024'),('053024'),('053026'),('053026'),('053026'),('053026'),('053028'),('053028'),('053029'),('053029'),('053029'),('053029'),('053033'),('053033'),('053033'),('053045'),('053046'),('053051'),('053051'),('053051'),('053054'),('053054'),('053054'),('053054'),('053057'),('053069'),('053069'),('053097'),('053107'),('053125'),('053125'),('053127'),('054001'),('054001'),('054001'),('054001'),('054001'),('054001'),('054001'),('054002'),('054002'),('054002'),('054002'),('054002'),('054002'),('054003'),('054003'),('054003'),('054003'),('054003'),('054003'),('054003'),('054004'),('054004'),('054004'),('054004'),('054004'),('054004'),('054004'),('054006'),('054006'),('054006'),('054007'),('054007'),('054007'),('054007'),('054007'),('054009'),('054009'),('054009'),('054009'),('054010'),('054010'),('054010'),('054010'),('054010'),('054010'),('054010'),('056001'),('056001'),('056001'),('056001'),('056001'),('056001'),('056001'),('056001'),('056001'),('056002'),('056002'),('056002'),('056002'),('056002'),('056002'),('056002'),('056002'),('056003'),('056003'),('056003'),('056003'),('056003'),('056003'),('056004'),('056004'),('056004'),('056004'),('056004'),('056004'),('056004'),('056005'),('056005'),('056005'),('056005'),('056005'),('056005'),('056005'),('056005'),('056005'),('056006'),('056006'),('056006'),('056006'),('056006'),('056006'),('056006'),('056006'),('056006'),('056009'),('056009'),('056009'),('056011'),('056016'),('056016'),('056016'),('056016'),('056016'),('056016'),('056016'),('056017'),('056017'),('056017'),('056017'),('056017'),('056017'),('056017'),('056017'),('056017'),('056018'),('056018'),('056018'),('056018'),('056018'),('056018'),('056019'),('056019'),('056019'),('056019'),('056019'),('056019'),('056019'),('056019'),('056020'),('056020'),('056020'),('056020'),('056022'),('056022'),('056022'),('056022'),('056022'),('057003'),('057003'),('057004'),('058002'),('058002'),('058002'),('058002'),('058003'),('058003'),('058003'),('058003'),('058004'),('058004'),('058004'),('058005'),('058005'),('058005'),('060001'),('060001'),('060001'),('060001'),('060001'),('060004'),('060004'),('060004'),('060004'),('060004'),('060004'),('060005'),('060005'),('060005'),('060005'),('060005'),('060005'),('060007'),('060007'),('060007'),('060007'),('060007'),('060007'),('060007'),('061004'),('061004'),('061004'),('061004'),('061004'),('061004'),('061006'),('061006'),('061006'),('061006'),('061006'),('061006'),('069006'),('069006'),('069006'),('069006'),('069006'),('069006'),('069006'),('069006'),('069006'),('069007'),('069007'),('069007'),('069007'),('069007'),('069007'),('069007'),('069007'),('069010'),('069010'),('069010'),('069010'),('069010'),('069010'),('069011'),('069012'),('069012'),('069012'),('069012'),('069012'),('069012'),('069012'),('069012'),('069012'),('069012'),('069013'),('069013'),('069013'),('069013'),('069013'),('069013'),('069013'),('069013'),('069013'),('069014'),('069014'),('069014'),('069014'),('069014'),('069014'),('069014'),('069014'),('069014'),('069015'),('069015'),('069015'),('069015'),('069015'),('069015'),('069015'),('069015'),('069015'),('069015'),('069016'),('069016'),('069016'),('069016'),('069016'),('069018'),('069018'),('069018'),('069018'),('069018'),('069018'),('069018'),('069018'),('069018'),('069020'),('069020'),('069020'),('069020'),('069021'),('069023'),('071002'),('071002'),('071002'),('071002'),('071002'),('071003'),('071003'),('071003'),('071003'),('071003'),('071004'),('071004'),('071004'),('071004'),('071004'),('071005'),('071005'),('071005'),('071005'),('071005'),('071005'),('071006'),('071006'),('071006'),('071006'),('071008'),('071008'),('071008'),('071008'),('071008'),('071008'),('071011'),('071011'),('071011'),('071011'),('071011'),('071020'),('071020'),('071020'),('071020'),('071020'),('071021'),('071022'),('071022'),('071022'),('072001'),('072001'),('074001'),('074002'),('074002'),('074002'),('074002'),('074002'),('074002'),('074002'),('074002'),('074003'),('074003'),('074003'),('074003'),('074003'),('074003'),('074003'),('074003'),('074004'),('074004'),('074004'),('074004'),('074004'),('074004'),('074004'),('074004'),('074005'),('074005'),('074005'),('074005'),('074005'),('074005'),('074005'),('074005'),('074006'),('074006'),('074006'),('074006'),('074006'),('074006'),('074006'),('074006'),('074007'),('074007'),('074007'),('074007'),('074007'),('074007'),('074007'),('074007'),('074008'),('074008'),('074008'),('074008'),('074008'),('074008'),('074008'),('074008'),('074009'),('074009'),('074009'),('074009'),('074009'),('074009'),('074009'),('074009'),('074010'),('074010'),('074010'),('074010'),('074010'),('074010'),('074010'),('074010'),('074011'),('074011'),('074011'),('074011'),('074011'),('074011'),('074011'),('074011'),('074012'),('074012'),('074012'),('074012'),('074012'),('074012'),('074012'),('075001'),('075001'),('075001'),('075007'),('075007'),('075007'),('075007'),('076101'),('076101'),('076101'),('076101'),('076102'),('076102'),('076102'),('076103'),('076103'),('076103'),('076103'),('076103'),('077001'),('077001'),('077001'),('077002'),('077002'),('077002'),('077002'),('077002'),('077002'),('077002'),('077003'),('077003'),('077003'),('077003'),('077003'),('077003'),('077003'),('077004'),('077004'),('077004'),('077004'),('077004'),('077004'),('077006'),('077006'),('077008'),('077008'),('077008'),('077008'),('077008'),('077008'),('077008'),('077009'),('077009'),('077009'),('077009'),('077009'),('077009'),('077009'),('078005'),('078005'),('078005'),('079002'),('079002'),('079002'),('079002'),('079002'),('079002'),('079002'),('079003'),('079003'),('079004'),('079004'),('079005'),('079005'),('079005'),('079005'),('079005'),('079005'),('079006'),('079006'),('079006'),('079006'),('079007'),('079007'),('079007'),('079007'),('079007'),('081001'),('081001'),('081001'),('081001'),('081001'),('082011'),('082011'),('082011'),('082011'),('082011'),('082013'),('082013'),('082013'),('082013'),('082013'),('082013'),('082014'),('082014'),('082014'),('082014'),('082014'),('082014'),('082014'),('082015'),('082015'),('082015'),('082015'),('082015'),('082016'),('082016'),('082016'),('082016'),('082016'),('082016'),('082017'),('082017'),('082017'),('082017'),('082017'),('082017'),('082017'),('082021'),('082021'),('082022'),('082022'),('082022'),('082022'),('082022'),('082023'),('082023'),('082023'),('082023'),('082023'),('082024'),('082024'),('082024'),('082024'),('082024'),('082025'),('082025'),('082025'),('082025'),('082025'),('082026'),('082026'),('082026'),('082026'),('082026'),('082027'),('082027'),('082027'),('082027'),('082027'),('082028'),('082028'),('082028'),('082028'),('082029'),('082029'),('082029'),('082029'),('082029'),('082030'),('082030'),('082030'),('082030'),('082031'),('082031'),('082031'),('082031'),('082031'),('082032'),('082032'),('082032'),('082033'),('082033'),('082034'),('082034'),('082034'),('082034'),('082034'),('082034'),('082034'),('082035'),('082035'),('082035'),('082036'),('082036'),('082036'),('082036'),('082037'),('082037'),('082037'),('082038'),('082038'),('082038'),('082038'),('082039'),('082039'),('082039'),('082039'),('082040'),('082040'),('082040'),('082040'),('082040'),('082041'),('082041'),('082041'),('082041'),('082042'),('082042'),('082043'),('082043'),('082043'),('082043'),('082043'),('082044'),('082044'),('082044'),('082044'),('084001'),('084002'),('084002'),('084002'),('084002'),('084003'),('084003'),('084003'),('084003'),('084003'),('084003'),('084003'),('084003'),('084004'),('084004'),('084004'),('084004'),('084004'),('084005'),('084005'),('084005'),('084005'),('084005'),('084007'),('084007'),('084007'),('084007'),('084007'),('084007'),('084008'),('084008'),('084008'),('084008'),('084008'),('084008'),('084009'),('084009'),('084009'),('084009'),('084009'),('084009'),('084011'),('084013'),('084013'),('084013'),('084013'),('084013'),('084014'),('084014'),('084014'),('084016'),('084016'),('084016'),('084016'),('084016'),('084016'),('084016'),('084016'),('084017'),('084017'),('084017'),('084017'),('084017'),('084017'),('084017'),('084017'),('084017'),('084027'),('084027'),('084027'),('084027'),('084027'),('084027'),('084032'),('084032'),('084033'),('084033'),('084033'),('084035'),('084035'),('084035'),('084036'),('084036'),('084036'),('084036'),('084036'),('084036'),('084037'),('084037'),('084038'),('084038'),('084038'),('084038'),('084038'),('084038'),('084039'),('084039'),('084039'),('084039'),('084040'),('084040'),('084040'),('084040'),('084040'),('084041'),('084041'),('084041'),('084041'),('084042'),('084042'),('084043'),('084043'),('084043'),('084043'),('084044'),('084044'),('084044'),('084044'),('084044'),('084045'),('084046'),('084046'),('084046'),('084047'),('084048'),('084048'),('084049'),('084049'),('084050'),('084051'),('084051'),('085001'),('085001'),('085001'),('085001'),('085001'),('085001'),('085002'),('085002'),('085002'),('085002'),('085003'),('085003'),('085003'),('085003'),('085003'),('085003'),('085003'),('085004'),('085004'),('085004'),('085004'),('085004'),('085004'),('085004'),('085005'),('085005'),('085005'),('085005'),('085005'),('085005'),('085006'),('085006'),('085006'),('085006'),('085006'),('085006'),('085006'),('085006'),('085007'),('085007'),('085007'),('085007'),('085007'),('085007'),('085007'),('085009'),('085009'),('085009'),('085009'),('085009'),('085009'),('085011'),('085011'),('085011'),('085011'),('085011'),('085011'),('085011'),('085011'),('085012'),('085012'),('085012'),('085012'),('085012'),('085012'),('085012'),('085014'),('085014'),('085014'),('085014'),('085014'),('085014'),('085014'),('085014'),('085014'),('085015'),('085015'),('085015'),('085015'),('085015'),('085015'),('085015'),('085015'),('085016'),('085016'),('085016'),('085016'),('085016'),('085016'),('085016'),('085016'),('085017'),('085017'),('085017'),('085017'),('085017'),('085018'),('085018'),('085018'),('085018'),('085018'),('085019'),('085019'),('085019'),('085019'),('085019'),('085019'),('085019'),('085019'),('085019'),('085020'),('085020'),('085020'),('085020'),('085020'),('085020'),('085022'),('085022'),('085022'),('085022'),('085022'),('085022'),('085023'),('085023'),('085023'),('085023'),('085023'),('085028'),('085028'),('085028'),('085028'),('085028'),('085028'),('085028'),('085029'),('085029'),('085029'),('085029'),('085029'),('085029'),('085029'),('085030'),('085030'),('085030'),('085030'),('085030'),('085030'),('085030'),('085031'),('085031'),('085031'),('085031'),('085031'),('085031'),('085031'),('085033'),('085034'),('085034'),('085034'),('085034'),('085034'),('085034'),('085034'),('085035'),('085035'),('085035'),('085035'),('085035'),('085035'),('085036'),('085036'),('085036'),('085036'),('085036'),('085036'),('085037'),('085037'),('085037'),('085037'),('085037'),('085037'),('085038'),('085038'),('085038'),('085038'),('085038'),('085038'),('085038'),('085040'),('085040'),('085040'),('085040'),('085040'),('085040'),('085040'),('085040'),('085041'),('085041'),('085041'),('085041'),('085041'),('085041'),('085041'),('085041'),('085042'),('085042'),('085042'),('085042'),('085042'),('085042'),('085042'),('085043'),('085043'),('085043'),('085043'),('085043'),('085043'),('085044'),('085044'),('085044'),('085044'),('085044'),('085044'),('085044'),('085045'),('085045'),('085045'),('085045'),('085045'),('085046'),('085046'),('085046'),('085046'),('085046'),('085046'),('085046'),('085046'),('085047'),('085047'),('085047'),('085047'),('085047'),('085047'),('085047'),('085047'),('085048'),('085048'),('085048'),('085048'),('085048'),('085048'),('085048'),('085063'),('085063'),('085063'),('085063'),('085063'),('085064'),('085064'),('085064'),('085064'),('085064'),('085065'),('085065'),('085068'),('085068'),('085068'),('085068'),('085068'),('085068'),('085071'),('085071'),('085071'),('085071'),('085071'),('085071'),('085073'),('085073'),('085082'),('085082'),('085082'),('085082'),('085082'),('085086'),('085086'),('085086'),('085088'),('085088'),('085088'),('085088'),('085088'),('085088'),('085088'),('085089'),('085089'),('085090'),('085090'),('085090'),('085090'),('085090'),('085090'),('085090'),('085090'),('085091'),('085091'),('085091'),('085091'),('085091'),('085092'),('085092'),('085092'),('085093'),('085093'),('085095'),('085095'),('085095'),('085095'),('085095'),('085096'),('085096'),('085096'),('085096'),('085096'),('085096'),('085097'),('085097'),('085097'),('085097'),('085097'),('085098'),('085098'),('085098'),('085098'),('085098'),('085098'),('085098'),('085099'),('085099'),('085099'),('085099'),('085099'),('085099'),('085099'),('085100'),('085100'),('085100'),('085100'),('085100'),('085100'),('085100'),('085100'),('085100'),('085100'),('085101'),('085101'),('085101'),('085101'),('085101'),('085101'),('085101'),('085101'),('085102'),('085102'),('085103'),('085103'),('085103'),('085104'),('085104'),('085104'),('085104'),('085104'),('085105'),('085105'),('085106'),('085106'),('085106'),('085106'),('085106'),('085106'),('085108'),('085108'),('085109'),('085109'),('085109'),('085109'),('085109'),('085109'),('085109'),('085109'),('085110'),('085110'),('085110'),('085110'),('085110'),('085111'),('085111'),('085111'),('085112'),('085112'),('085112'),('085112'),('085113'),('085113'),('085113'),('085113'),('085113'),('085115'),('085120'),('085121'),('085121'),('085121'),('085121'),('085122'),('085122'),('085122'),('085122'),('085122'),('085122'),('085122'),('085122'),('085123'),('085123'),('085123'),('085123'),('085123'),('085123'),('085123'),('085123'),('085125'),('085125'),('085125'),('085125'),('085125'),('085126'),('085126'),('085126'),('085126'),('085126'),('085127'),('085127'),('085127'),('085127'),('085127'),('085127'),('085127'),('085127'),('085128'),('085128'),('085128'),('085128'),('085128'),('085129'),('085129'),('085129'),('085129'),('085129'),('085130'),('085130'),('085130'),('085130'),('085130'),('085132'),('085132'),('085132'),('085132'),('085132'),('085132'),('085133'),('085133'),('085133'),('085133'),('085133'),('085134'),('085134'),('085134'),('085135'),('085135'),('085135'),('085136'),('085136'),('085136'),('085136'),('085137'),('085137'),('085137'),('085137'),('085137'),('085137'),('085137'),('086002'),('086002'),('086002'),('086002'),('086003'),('086003'),('086003'),('086003'),('086005'),('088001'),('088001'),('088001'),('088001'),('088001'),('088003'),('088003'),('088003'),('088003'),('088003'),('088003'),('088005'),('088005'),('088005'),('088005'),('088005'),('088006'),('088006'),('088006'),('088006'),('088006'),('088007'),('088007'),('088007'),('088008'),('088008'),('088008'),('088008'),('088009'),('088009'),('088009'),('088009'),('088009'),('089001'),('089001'),('089001'),('089001'),('089001'),('089001'),('089001'),('090001'),('090001'),('090001'),('090001'),('090001'),('090001'),('090001'),('090002'),('090002'),('090002'),('090002'),('090002'),('090002'),('090003'),('090003'),('090003'),('090003'),('090003'),('090003'),('090003'),('090004'),('090004'),('090004'),('090004'),('090004'),('090004'),('090004'),('090006'),('090006'),('090006'),('090006'),('090006'),('090006'),('090006'),('090008'),('090008'),('090008'),('090008'),('090008'),('090009'),('090009'),('090009'),('090009'),('090009'),('090010'),('090010'),('090013'),('090013'),('090013'),('090016'),('090016'),('090017'),('090018'),('090022'),('090027'),('091001'),('091001'),('091001'),('091001'),('091001'),('091001'),('091002'),('091002'),('091002'),('091002'),('091002'),('091002'),('091009'),('091009'),('091009'),('091009'),('091009'),('091011'),('091011'),('091011'),('091011'),('091011'),('091011'),('091011'),('091012'),('091012'),('091013'),('091013'),('091013'),('091013'),('091013'),('091013'),('091015'),('091015'),('091015'),('091015'),('091015'),('091015'),('091016'),('091016'),('091016'),('091016'),('091016'),('091017'),('091017'),('091018'),('091018'),('091018'),('091018'),('093003'),('093003'),('093003'),('093003'),('093003'),('093003'),('099001'),('099001'),('099001'),('099001'),('099001'),('099001'),('099001'),('100001'),('100001'),('100001'),('100001'),('106001'),('113005'),('113005'),('113005'),('113006'),('113006'),('113018'),('113019'),('113020'),('115001'),('115001'),('115001'),('115002'),('115002'),('115003'),('115004'),('115004'),('115004'),('115004'),('115005'),('115005'),('115005'),('115006'),('115006'),('115006'),('115007'),('115007'),('115007'),('115007'),('115007'),('115008'),('115008'),('115008'),('115009'),('115010'),('115010'),('115010'),('115010'),('115010'),('115011'),('115011'),('115011'),('115011'),('115012'),('115012'),('115013'),('115013'),('115013'),('115014'),('115014'),('115014'),('115014'),('115015'),('115015'),('115015'),('115016'),('115016'),('115016'),('115016'),('115017'),('115017'),('115017'),('115017'),('115017'),('115018'),('115018'),('115020'),('115020'),('115021'),('115021'),('115022'),('115022'),('115022'),('115023'),('115023'),('115023'),('115023'),('115023'),('115025'),('115025'),('115025'),('115026'),('115026'),('115027'),('115027'),('115027'),('115028'),('115028'),('115028'),('115028'),('115029'),('115029'),('115029'),('115030'),('115030'),('115030'),('115031'),('115031'),('115032'),('115032'),('115032'),('115033'),('115033'),('115033'),('115033'),('115034'),('115034'),('115034'),('115035'),('115035'),('115036'),('115036'),('115036'),('115036'),('115036'),('115039'),('115040'),('115040'),('115040'),('115041'),('115041'),('115041'),('115041'),('115041'),('115042'),('115042'),('115042'),('115042'),('115042'),('115043'),('115043'),('115043'),('115044'),('115044'),('115044'),('115044'),('115046'),('115046'),('115046'),('115047'),('115048'),('115050'),('115050'),('115050'),('115050'),('115050'),('115051'),('115051'),('115051'),('115052'),('115053'),('115053'),('115054'),('115054'),('115054'),('115055'),('115055'),('115055'),('115057'),('115059'),('115059'),('115059'),('115059'),('115060'),('115060'),('115060'),('115060'),('115060'),('115060'),('115061'),('115061'),('115061'),('115062'),('115062'),('115062'),('115062'),('115064'),('115064'),('115064'),('115065'),('115065'),('115065'),('115065'),('115066'),('115066'),('115066'),('115067'),('115067'),('115067'),('115068'),('115068'),('115068'),('115069'),('115069'),('115069'),('115069'),('115069'),('115070'),('115070'),('115070'),('115071'),('115071'),('115071'),('115072'),('115072'),('115072'),('115073'),('115073'),('115075'),('115075'),('115075'),('115076'),('115076'),('115076'),('115076'),('115076'),('115076'),('115081'),('115081'),('115081'),('115082'),('115082'),('115082'),('115085'),('115085'),('115085'),('115085'),('115085'),('115086'),('115086'),('115086'),('115087'),('115087'),('115088'),('115088'),('115088'),('115088'),('115088'),('115095'),('115095'),('115095'),('115096'),('115096'),('115097'),('115097'),('115098'),('115098'),('115099'),('115101'),('115102'),('115102'),('115102'),('115103'),('115103'),('115104'),('115104'),('115104'),('115104'),('115105'),('115105'),('115106'),('115106'),('115106'),('115106'),('115106'),('115108'),('115109'),('115111'),('115111'),('115111'),('115111'),('115112'),('115112'),('115112'),('115112'),('115112'),('115113'),('115113'),('115113'),('115114'),('115114'),('115114'),('115114'),('115114'),('115115'),('115115'),('115115'),('115115'),('115116'),('115117'),('115117'),('115117'),('115118'),('115118'),('115119'),('115119'),('115119'),('115119'),('115120'),('115121'),('115121'),('115122'),('115122'),('116001'),('116003'),('116003'),('116003'),('116003'),('116004'),('116004'),('116005'),('116005'),('116006'),('116006'),('116006'),('116007'),('116007'),('116008'),('116008'),('116009'),('116009'),('116009'),('116010'),('116010'),('116010'),('116010'),('116011'),('116011'),('116011'),('116011'),('116012'),('116012'),('123001'),('123001'),('123001'),('123001'),('123001'),('124065'),('126001'),('126001'),('126001'),('126001'),('126001'),('126001'),('126001'),('126001'),('126002'),('126002'),('126002'),('126002'),('126002'),('126002'),('126002'),('126002'),('126003'),('126003'),('126003'),('126003'),('126003'),('126003'),('126003'),('126003'),('126003'),('126004'),('126004'),('126004'),('126004'),('126004'),('126004'),('126004'),('126004'),('126004'),('126004'),('126005'),('126005'),('126005'),('126005'),('126005'),('126005'),('126005'),('126005'),('126005'),('126006'),('126006'),('126006'),('126006'),('126006'),('126006'),('126006'),('126006'),('126006'),('126007'),('126007'),('126007'),('126007'),('126007'),('126007'),('126007'),('126008'),('126008'),('126008'),('126008'),('126008'),('126008'),('126008'),('126008'),('126009'),('126009'),('126009'),('126009'),('126009'),('126009'),('126009'),('126009'),('126010'),('126010'),('126010'),('126010'),('126010'),('126010'),('126010'),('126010'),('126010'),('126011'),('126011'),('126011'),('126011'),('126011'),('126011'),('126011'),('126012'),('126012'),('126012'),('126012'),('130001'),('130001'),('130001'),('130001'),('132001'),('132001'),('132001'),('132001'),('132001'),('132002'),('132002'),('132002'),('132002'),('132002'),('132002'),('132002'),('133001'),('133001'),('133008'),('133009'),('133010'),('133011'),('133011'),('133011'),('133011'),('133011'),('133011'),('133012'),('133015'),('133015'),('133015'),('133015'),('133016'),('133018'),('133018'),('133018'),('133018'),('133018'),('133019'),('133021'),('133021'),('133022'),('133022'),('133023'),('133023'),('133024'),('133024'),('133024'),('133024'),('133024'),('133024'),('133025'),('133027'),('133027'),('133027'),('133027'),('133027'),('133028'),('133028'),('133028'),('133029'),('133029'),('133029'),('133029'),('133029'),('133029'),('133030'),('133030'),('133031'),('133031'),('133031'),('134001'),('134001'),('134001'),('135001'),('135001'),('135001'),('135001'),('135001'),('135002'),('135002'),('135002'),('135004'),('135010'),('135010'),('135010'),('135010'),('135010'),('135010'),('137010'),('137011'),('137012'),('137014'),('137015'),('137015'),('137016'),('137019'),('139001'),('140001'),('140001'),('140001'),('140001'),('140001'),('140001'),('141001'),('141001'),('141001'),('141001'),('141001'),('141002'),('141002'),('141002'),('141002'),('141002'),('141003'),('141003'),('141003'),('141003'),('141003'),('141003'),('141003'),('141003'),('141006'),('141006'),('141006'),('141006'),('141006'),('141006'),('141006'),('141006'),('141007'),('141007'),('141007'),('141007'),('141007'),('141009'),('141009'),('141009'),('141009'),('141009'),('141011'),('141011'),('141011'),('141011'),('141011'),('141011'),('141012'),('141014'),('141014'),('141014'),('141014'),('141014'),('141014'),('141014'),('141014'),('141015'),('141015'),('141015'),('141015'),('141015'),('141016'),('141016'),('141016'),('141016'),('141016'),('141016'),('141017'),('141017'),('141017'),('141017'),('141017'),('141017'),('141018'),('141018'),('141018'),('141018'),('141019'),('141019'),('141019'),('141019'),('141020'),('141020'),('141020'),('141020'),('141020'),('141020'),('141020'),('141021'),('141021'),('141021'),('141021'),('141021'),('141021'),('141022'),('141022'),('141022'),('141022'),('141022'),('141022'),('141023'),('141023'),('141023'),('141023'),('141023'),('141023'),('141023'),('141024'),('141025'),('141025'),('141025'),('141026'),('141026'),('141026'),('141026'),('141026'),('141026'),('141027'),('141027'),('141027'),('141027'),('141027'),('141028'),('141028'),('145001'),('145001'),('145001'),('145001'),('145001'),('145001'),('145001'),('145001'),('145001'),('145002'),('145002'),('145002'),('145002'),('145002'),('145002'),('145002'),('145002'),('145002'),('145003'),('145003'),('145003'),('145003'),('145003'),('145003'),('145003'),('145003'),('145003'),('145003'),('145004'),('145004'),('145004'),('145004'),('145004'),('145004'),('145004'),('145004'),('145004'),('145005'),('145005'),('145005'),('145005'),('145005'),('145005'),('145005'),('145005'),('145005'),('145006'),('145006'),('145006'),('145006'),('145006'),('145006'),('145006'),('145006'),('145006'),('145008'),('145008'),('145008'),('145008'),('145008'),('145008'),('145008'),('145008'),('145009'),('145009'),('145009'),('145009'),('145009'),('145009'),('145009'),('145011'),('145011'),('145011'),('145011'),('145011'),('145011'),('145011'),('145011'),('145012'),('145012'),('145012'),('145012'),('145012'),('145012'),('145012'),('145012'),('145013'),('145013'),('145013'),('145013'),('145013'),('145013'),('145013'),('150009'),('150013'),('150014'),('150015'),('150015'),('150015'),('150016'),('150016'),('150017'),('150017'),('150017'),('150017'),('150020'),('152001'),('152001'),('152001'),('152002'),('152003'),('152003'),('152003'),('152003'),('152004'),('152005'),('152006'),('152006'),('152006'),('152006'),('152007'),('154001'),('154002'),('154002'),('155001'),('155001'),('155002'),('155003'),('155004'),('155004'),('155006'),('159001'),('159003'),('160001'),('160001'),('160001'),('160001'),('160002'),('160002'),('161001'),('162002'),('162002'),('162003'),('162003'),('162003'),('162003'),('162003'),('162007'),('162012'),('162012'),('162012'),('163001'),('163001'),('163001'),('163011'),('163015'),('163016'),('163016'),('165001'),('165001'),('165001'),('165001'),('165002'),('165002'),('165002'),('165002'),('165003'),('165003'),('165003'),('165004'),('165004'),('165004'),('165005'),('165005'),('165005'),('165006'),('165006'),('165006'),('165006'),('165007'),('165007'),('165007'),('165007'),('165008'),('165008'),('165008'),('165008'),('165009'),('165009'),('165009'),('165009'),('165010'),('165010'),('165010'),('165011'),('165011'),('165012'),('165012'),('165012'),('165013'),('165013'),('165013'),('165014'),('165014'),('165014'),('165015'),('165015'),('165015'),('165015'),('165016'),('165016'),('165016'),('165017'),('165017'),('165017'),('165017'),('165018'),('165018'),('165018'),('165018'),('165019'),('165019'),('165019'),('165019'),('165020'),('165020'),('165020'),('165020'),('165021'),('165021'),('165021'),('165021'),('165022'),('165022'),('165022'),('165023'),('165024'),('165024'),('165024'),('165025'),('165025'),('165025'),('165026'),('165026'),('165026'),('165028'),('165029'),('165030'),('165030'),('165030'),('165031'),('165031'),('165033'),('165033'),('165034'),('165034'),('165034'),('165035'),('165035'),('165035'),('165036'),('165036'),('165036'),('168003'),('168003'),('168004'),('168005'),('168014'),('169001'),('169001'),('169001'),('169001'),('169001'),('169001'),('169001'),('169001'),('169001'),('169001'),('169002'),('169002'),('169002'),('169002'),('169002'),('169002'),('169002'),('169002'),('169002'),('169002'),('169003'),('169003'),('169003'),('169003'),('169007'),('169007'),('169007'),('169007'),('169007'),('169007'),('169007'),('169007'),('169007'),('169007'),('169008'),('169008'),('169008'),('169008'),('169008'),('169008'),('169008'),('169009'),('169009'),('169009'),('169009'),('169010'),('171006'),('171006'),('171007'),('171007'),('171008'),('171008'),('171008'),('171009'),('171009'),('171009'),('172001'),('176001'),('176001'),('176001'),('176001'),('176001'),('176001'),('176001'),('176002'),('176002'),('176002'),('176002'),('176002'),('176003'),('176003'),('176003'),('176003'),('176003'),('176003'),('177001'),('177001'),('177001'),('177001'),('177001'),('177001'),('179007'),('179007'),('179012'),('179012'),('179012'),('179012'),('179012'),('179012'),('179013'),('179013'),('179013'),('179013'),('179013'),('179013'),('179042'),('179044'),('179045'),('180001'),('180013'),('180014'),('180014'),('180015'),('180017'),('180018'),('180020'),('180020'),('180021'),('180021'),('180027'),('180030'),('180033'),('180035'),('180036'),('180037'),('180038'),('180041'),('180042'),('180045'),('180045'),('180047'),('180048'),('180049'),('180050'),('180054'),('180060'),('180066'),('180067'),('180068'),('180070'),('182001'),('184001'),('184002'),('184005'),('184005'),('184005'),('184005'),('184006'),('184006'),('184006'),('184006'),('184008'),('184008'),('184008'),('184008'),('184009'),('184009'),('184009'),('184009'),('184010'),('184010'),('184010'),('184010'),('184011'),('184011'),('184011'),('184011'),('185001'),('185001'),('185001'),('185001'),('185001'),('185001'),('185001'),('185003'),('185003'),('185003'),('185003'),('185003'),('185003'),('185003'),('187001'),('191002'),('191002'),('192002'),('194003'),('197001'),('197001'),('197001'),('197001'),('197001'),('197001'),('197001'),('197002'),('197002'),('197002'),('197002'),('197002'),('197002'),('197002'),('197003'),('197003'),('197003'),('197003'),('197003'),('197003'),('197003'),('197004'),('197004'),('197004'),('197004'),('197004'),('197004'),('197004'),('197005'),('197005'),('197005'),('197005'),('197005'),('197005'),('197006'),('197006'),('197006'),('197006'),('197006'),('198001'),('198001'),('198001'),('198001'),('198001'),('198001'),('198003'),('198003'),('198003'),('198004'),('198004'),('198004'),('198004'),('198004'),('198004'),('198005'),('198005'),('198005'),('198005'),('198005'),('198005'),('198005'),('198006'),('198006'),('198006'),('198006'),('198006'),('198006'),('198007'),('198007'),('198007'),('198007'),('198007'),('198007'),('198007'),('198008'),('198008'),('198008'),('198008'),('198008'),('198008'),('198009'),('198009'),('198009'),('198009'),('198009'),('198009'),('198009'),('198010'),('198010'),('198010'),('198010'),('198010'),('198010'),('198011'),('198012'),('198012'),('198012'),('198012'),('198015'),('198015'),('198016'),('198016'),('198016'),('198016'),('198016'),('198016'),('198017'),('198017'),('198017'),('198017'),('198017'),('198017'),('201001'),('201001'),('201001'),('201001'),('201001'),('201002'),('202001'),('202001'),('203001'),('203001'),('203001'),('203001'),('203001'),('203001'),('203001'),('203002'),('203002'),('203002'),('203002'),('203003'),('203003'),('203003'),('203003'),('203003'),('203017'),('203017'),('203017'),('203017'),('203017'),('203017'),('203017'),('203017'),('203017'),('203018'),('203018'),('203018'),('203018'),('203018'),('203019'),('203019'),('203019'),('203019'),('203019'),('204001'),('204002'),('205001'),('205001'),('205001'),('205001'),('205001'),('205001'),('205001'),('208001'),('208001'),('208002'),('208002'),('208002'),('208003'),('208003'),('208003'),('208004'),('208004'),('208004'),('208004'),('208004'),('208004'),('208004'),('208005'),('208005'),('208005'),('208005'),('208005'),('209001'),('209001'),('209001'),('209001'),('209001'),('209002'),('209002'),('209002'),('209002'),('209002'),('209003'),('209003'),('209003'),('209003'),('209003'),('210001'),('210001'),('210001'),('210001'),('210001'),('210004'),('210004'),('210004'),('210004'),('210004'),('210004'),('210009'),('210010'),('212001'),('212001'),('212002'),('212002'),('212002'),('212002'),('212003'),('212003'),('212003'),('212004'),('212004'),('212004'),('212005'),('212005'),('212005'),('212005'),('212005'),('212006'),('212006'),('212006'),('212007'),('212007'),('212008'),('212008'),('212008'),('212008'),('212009'),('212009'),('212009'),('212009'),('212010'),('212010'),('212010'),('212010'),('212011'),('212011'),('212012'),('212012'),('212013'),('212013'),('212013'),('218001'),('218004'),('218009'),('218011'),('218011'),('218015'),('218020'),('218021'),('218021'),('218022'),('218022'),('218022'),('218023'),('218024'),('218025'),('218026'),('218026'),('218027'),('218028'),('218029'),('218029'),('218029'),('218030'),('218031'),('221001'),('221001'),('221001'),('221001'),('221001'),('221001'),('221002'),('221002'),('221002'),('221002'),('221002'),('221002'),('221003'),('221003'),('221003'),('221003'),('221003'),('221003'),('221004'),('221004'),('221004'),('221004'),('221004'),('221004'),('221005'),('221005'),('221005'),('221005'),('221005'),('221006'),('221006'),('221006'),('221006'),('221006'),('221007'),('221007'),('221007'),('221007'),('221007'),('221007'),('221008'),('221008'),('221008'),('221008'),('221008'),('221008'),('221009'),('221009'),('221009'),('221009'),('221009'),('221009'),('221010'),('221010'),('221010'),('221010'),('221011'),('221011'),('221011'),('221011'),('221012'),('221012'),('221012'),('221012'),('221012'),('221012'),('221013'),('221013'),('221013'),('221013'),('221013'),('221013'),('223003'),('223003'),('224001'),('224001'),('224002'),('224002'),('224003'),('224007'),('224008'),('225001'),('225002'),('225002'),('225002'),('225003'),('225003'),('225003'),('225003'),('225004'),('225004'),('225004'),('225005'),('225005'),('225005'),('225005'),('225005'),('225005'),('225006'),('225006'),('225006'),('225007'),('225007'),('225007'),('225008'),('225008'),('225008'),('225008'),('225008'),('225009'),('225009'),('225009'),('225010'),('225010'),('225010'),('225011'),('225011'),('225011'),('225011'),('225011'),('225012'),('225012'),('225012'),('225012'),('225012'),('225012'),('225013'),('225013'),('226001'),('226002'),('226003'),('226003'),('226005'),('226005'),('226006'),('226007'),('226007'),('226007'),('226007'),('227011'),('227015'),('227015'),('227041'),('227045'),('227052'),('227056'),('227063'),('227064'),('227066'),('227067'),('227069'),('227071'),('227073'),('227085'),('227116'),('227119'),('227131'),('227133'),('227147'),('229005'),('229005'),('229005'),('233003'),('233004'),('235001'),('235001'),('235002'),('235003'),('235003'),('235003'),('235004'),('235005'),('235005'),('235005'),('235005'),('235005'),('235005'),('235005'),('236001'),('236001'),('236001'),('236001'),('236002'),('236003'),('236003'),('236003'),('236003'),('236003'),('236003'),('238002'),('238002'),('238002'),('238002'),('238002'),('238002'),('238003'),('238003'),('238003'),('238003'),('238003'),('238003'),('238004'),('238004'),('238004'),('238004'),('238004'),('238005'),('238005'),('238005'),('238007'),('238007'),('238007'),('238007'),('238007'),('238007'),('238007'),('238008'),('238008'),('238008'),('238008'),('238008'),('238008'),('238008'),('334005'),('334006'),('337001'),('337001'),('337001'),('337002'),('337002'),('337003'),('337003'),('337003'),('337004'),('343001'),('343001'),('344001'),('344002'),('344003'),('344004'),('344005'),('344005'),('345001'),('345001'),('348001'),('348004'),('348005'),('348005'),('349001'),('349001'),('349002'),('349002'),('349002'),('350001'),('353002'),('353002'),('353002'),('353003'),('355001'),('355002'),('355005'),('355006'),('355006'),('356001'),('358001'),('358001'),('358001'),('359001'),('359001'),('359002'),('359002'),('359002'),('359002'),('360001'),('360001'),('360002'),('360002'),('360003'),('360003'),('360004'),('360004'),('360005'),('360005'),('360005'),('366001'),('366002'),('366002'),('366003'),('366004'),('369001'),('369001'),('373001'),('373002'),('373002'),('373003'),('373003'),('373005'),('373007'),('373008'),('373009'),('373009'),('373010'),('373010'),('373010'),('373011'),('373011'),('373011'),('373011'),('373012'),('373012'),('373012'),('373013'),('373013'),('373014'),('373014'),('373015'),('373015'),('373015'),('373015'),('373017'),('373017'),('373017'),('373017'),('373018'),('373021'),('374002'),('374004'),('374006'),('374007'),('374008'),('374009'),('374010'),('374011'),('374012'),('374015'),('374016'),('382001'),('382002'),('382002'),('384001'),('386001'),('386001'),('386001'),('386001'),('386001'),('386001'),('386001'),('386002'),('386002'),('386002'),('386002'),('386002'),('386002'),('386002'),('386003'),('386003'),('386003'),('386003'),('386003'),('386003'),('386003'),('386003'),('386003'),('386004'),('386004'),('386004'),('386004'),('386004'),('386004'),('386004'),('386004'),('386005'),('386005'),('386005'),('386005'),('386005'),('386005'),('386005'),('386006'),('386006'),('386006'),('386006'),('386006'),('386006'),('386007'),('386007'),('386007'),('386007'),('386007'),('386007'),('386007'),('386007'),('386007'),('386008'),('386008'),('386008'),('386008'),('386008'),('386008'),('386008'),('386008'),('386009'),('386009'),('386009'),('386010'),('386010'),('386010'),('386010'),('386010'),('386010'),('386010'),('386010'),('386011'),('386011'),('386011'),('386011'),('386011'),('386011'),('386011'),('386011'),('386011'),('386012'),('386012'),('386012'),('386012'),('386012'),('386012'),('386012'),('386012'),('386012'),('386013'),('386013'),('386013'),('386013'),('386013'),('386013'),('386013'),('386014'),('386014'),('386014'),('386014'),('389001'),('389002'),('389002'),('389003'),('389003'),('389003'),('389003'),('389004'),('389004'),('389004'),('389004'),('392001'),('393001'),('393002'),('393002'),('393003'),('393004'),('395001'),('395001'),('397001'),('397001'),('397001'),('397002'),('399001'),('399001'),('399001'),('399001'),('399001'),('399001'),('399001'),('399002'),('399002'),('399002'),('399002'),('399002'),('399002'),('399002'),('399003'),('400001'),('400001'),('400001'),('400001'),('400002'),('403002'),('504001'),('504001'),('504002'),('504002'),('504002'),('504004'),('504004'),('504005'),('504006'),('504007'),('504007'),('504007'),('504008'),('504008'),('504009'),('504009'),('504009'),('504009'),('504009'),('504010'),('504011'),('504011'),('504012'),('504012'),('504014'),('504014'),('504014'),('504014'),('504014'),('504014'),('504014'),('504014'),('504017'),('504017'),('504021'),('504021'),('504021'),('504021'),('504021'),('504021'),('504021'),('504022'),('504023'),('504023'),('504024'),('504024'),('504025'),('504025'),('506001'),('506001'),('506001'),('506001'),('506001'),('506001'),('506002'),('506002'),('506002'),('506002'),('506002'),('511001'),('511001'),('511001'),('511001'),('511001'),('511001'),('511001'),('511002'),('511002'),('511002'),('511002'),('511002'),('511002'),('511002'),('511003'),('511003'),('511003'),('511003'),('511003'),('511003'),('511004'),('511004'),('511004'),('511004'),('511004'),('511004'),('511004'),('511005'),('511005'),('511005'),('511005'),('511005'),('511005'),('511005'),('511006'),('511006'),('511006'),('511006'),('511006'),('511006'),('511006'),('511007'),('511007'),('511007'),('511007'),('511007'),('511008'),('511008'),('511008'),('511008'),('511008'),('511008'),('511009'),('511009'),('511009'),('511009'),('511009'),('511009'),('511010'),('511010'),('511010'),('511010'),('511010'),('511010'),('511011'),('511011'),('511011'),('511011'),('511011'),('511011'),('511012'),('511012'),('511012'),('511012'),('511012'),('511012'),('511012'),('511013'),('511013'),('511013'),('511013'),('511013'),('511013'),('511013'),('511014'),('511014'),('511014'),('511014'),('511014'),('511017'),('511018'),('511020'),('511021'),('511022'),('511024'),('511028'),('511029'),('511029'),('511029'),('511029'),('511029'),('511029'),('513001'),('513001'),('513001'),('513001'),('513001'),('513001'),('513001'),('513001'),('513002'),('513002'),('513002'),('513002'),('513002'),('513002'),('513003'),('513003'),('513003'),('513003'),('513003'),('513003'),('513003'),('513003'),('513004'),('513004'),('513004'),('515001'),('515001'),('515001'),('515001'),('515001'),('515002'),('515002'),('515003'),('515003'),('515007'),('515007'),('515008'),('515011'),('515011'),('515011'),('515011'),('515011'),('515011'),('515012'),('515012'),('515012'),('515012'),('515013'),('515013'),('515013'),('515013'),('515013'),('515014'),('515014'),('515014'),('515014'),('515014'),('515015'),('515015'),('515015'),('515015'),('515015'),('518001'),('518002'),('521001'),('521002'),('521002'),('521002'),('521003'),('521003'),('521003'),('521003'),('521004'),('521004'),('521004'),('521004'),('521005'),('521005'),('521005'),('521005'),('521006'),('521006'),('521006'),('521009'),('521010'),('521010'),('521010'),('521010'),('521011'),('521011'),('521011'),('521011'),('521012'),('521013'),('521013'),('521015'),('521016'),('521016'),('523001'),('523001'),('523001'),('523001'),('523001'),('523001'),('523001'),('523002'),('523002'),('523002'),('523002'),('523002'),('523002'),('523003'),('523003'),('523003'),('523003'),('523003'),('523003'),('523003'),('523004'),('523004'),('523004'),('523004'),('523004'),('523004'),('523005'),('523005'),('523005'),('523005'),('523005'),('523005'),('523005'),('523005'),('523006'),('523006'),('523006'),('523006'),('523006'),('523006'),('523006'),('523007'),('523007'),('523007'),('523007'),('523007'),('523007'),('523007'),('524001'),('700001'),('701001'),('701002'),('701003'),('702001'),('702002'),('702004'),('702005'),('704001'),('704004'),('705001'),('706001'),('706002'),('707001'),('707002'),('707003'),('708001'),('710001'),('710002'),('711001'),('711002'),('712001'),('714001'),('714002'),('715001'),('719001'),('719002'),('991002'),('991002'),('991002'),('991003'),('991003'),('991003'),('991003'),('991003'),('991003'),('991003'),('991004'),('991004'),('991004'),('991005'),('991005'),('991005'),('991006'),('991007'),('995001'),('995001'),('995001'),('995001'),('995001'),('995001'),('995001'),('995001'),('995001'),('995001'),('995001'),('996001'),('996001'),('996001'),('996001'),('996001'),('996001'),('996001'),('996001'),('996002'),('996002'),('996003'),('996003'),('996003'),('996003'),('996003'),('998001'),('998001'),('998001'),('998001'),('998001'),('998001'),('998001'),('998001'),('998001'),('998001'),('998002'),('998002'),('998002'),('998002'),('998002'),('998002'),('998002'),('998002'),('998002'),('998002'),('998003'),('998003'),('998003'),('998003'),('998003'),('998003'),('998003'),('998003'),('998004'),('998004'),('998005'),('998005'),('998006'),('998007'),('999001'),('999001'),('999001'),('999001'),('999001'),('999001'),('999001'),('999001'),('999001'),('999001'),('999001'),('999002'),('999002'),('011017'),('011017'),('011017'),('011017'),('011017'),('011017'),('011017'),('011018'),('011018'),('011018'),('011018'),('034001'),('034001'),('034002'),('034002'),('071010'),('071010'),('071010'),('519001'),('126013'),('126013'),('126013'),('126013'),('126013'),('184012'),('184012'),('184012'),('404001'),('405002'),('405002'),('405001'),('405003'),('405006'),('240011'),('240011'),('240011'),('240011'),('240011'),('240011'),('240010'),('240010'),('240010'),('240009'),('240009'),('240009'),('240009'),('240008'),('240008'),('240008'),('240007'),('240007'),('240007'),('240007'),('240007'),('240007'),('240005'),('240005'),('240005'),('240005'),('240005'),('240004'),('240004'),('240004'),('240004'),('240004'),('240003'),('240003'),('240003'),('240003'),('240002'),('240002'),('240002'),('240002'),('240002'),('240002'),('240002'),('240001'),('240001'),('240001'),('240001'),('240001'),('240012'),('240012'),('240012'),('240012'),('240012'),('240013'),('240014'),('240015'),('240015'),('240015'),('240015'),('240015'),('240015'),('240015'),('240015'),('240016'),('240016'),('240016'),('240016'),('240016'),('240016'),('240017'),('240017'),('240017'),('357001'),('357001'),('235006'),('235006'),('235007'),('235007'),('235007'),('235007'),('235007'),('056023'),('056023'),('056023'),('056023'),('056023'),('046015'),('019005'),('019005'),('126014'),('126014'),('126014'),('126014'),('126014'),('126014'),('241003'),('241003'),('241003'),('241003'),('241003'),('241003'),('241002'),('241002'),('241002'),('241002'),('241002'),('241002'),('241001'),('241001'),('241001'),('241001'),('241001'),('240020'),('240020'),('240020'),('240020'),('240020'),('240020'),('240019'),('240019'),('240019'),('242001'),('242002'),('242004'),('242005'),('242006'),('089002'),('089002'),('089002'),('089002'),('089002'),('089002'),('406001'),('406002'),('406003'),('406004'),('406004'),('243001'),('243005'),('243006'),('243007'),('243008'),('408001'),('408001'),('408001'),('408001'),('408001'),('366005'),('366005'),('016035'),('016035'),('016035'),('016035'),('077010'),('996004'),('996004'),('996004'),('996004'),('996004'),('996004'),('996004'),('996004'),('025064'),('025064'),('025064'),('025064'),('011019'),('011019'),('011019'),('011019'),('011019'),('115123'),('115123'),('504026'),('039007'),('039009'),('039008'),('039008'),('039010'),('039010'),('039011'),('039012'),('180072'),('240021'),('240021'),('240021'),('240021'),('240021'),('240021'),('240021'),('240023'),('240023'),('240023'),('240023'),('405008'),('405008'),('525002'),('410002'),('410002'),('410004'),('410005'),('410005'),('410006'),('410007'),('410007'),('410008'),('410009'),('410010'),('410011'),('410011'),('410012'),('410012'),('410013'),('410013'),('410014'),('410014'),('410016'),('410016'),('344006'),('240031'),('240031'),('240031'),('240031'),('240030'),('240030'),('240030'),('240030'),('240029'),('240029'),('240029'),('240029'),('240028'),('240028'),('240028'),('240028'),('240027'),('240027'),('240026'),('240026'),('240026'),('240025'),('240025'),('240025'),('240025'),('240024'),('240024'),('240034'),('240034'),('240034'),('240033'),('240033'),('240033'),('240032'),('240032'),('240032'),('240032'),('411001'),('411002'),('203020'),('069025'),('069025'),('069025'),('069025'),('069025'),('069025'),('244001'),('244001'),('244001'),('244001'),('244001'),('244001'),('244001'),('244001'),('244001'),('244001'),('244001'),('244002'),('244002'),('244002'),('244002'),('244002'),('244002'),('244002'),('244002'),('244002'),('244002'),('244002'),('244009'),('244009'),('244009'),('244009'),('244009'),('244009'),('244009'),('244009'),('244009'),('244009'),('244009'),('244008'),('244008'),('244008'),('244008'),('244008'),('244008'),('244008'),('244008'),('244008'),('244008'),('244008'),('244007'),('244007'),('244007'),('244007'),('244007'),('244007'),('244007'),('244007'),('244007'),('244007'),('244007'),('244006'),('244006'),('244006'),('244006'),('244006'),('244006'),('244006'),('244006'),('244006'),('244006'),('244006'),('244004'),('244004'),('244004'),('244004'),('244004'),('244004'),('244004'),('244004'),('244004'),('244004'),('244004'),('244003'),('244003'),('244003'),('244003'),('244003'),('244003'),('244003'),('244003'),('244003'),('244003'),('244003'),('244014'),('244014'),('244014'),('244014'),('244014'),('244014'),('244014'),('244014'),('244013'),('244013'),('244013'),('244013'),('244013'),('244013'),('244013'),('244013'),('244012'),('244012'),('244012'),('244012'),('244012'),('244012'),('244012'),('244012'),('244011'),('244011'),('244011'),('244011'),('244011'),('244011'),('244011'),('244011'),('244016'),('244016'),('244016'),('244016'),('244016'),('244016'),('244016'),('244016'),('244016'),('244016'),('244016'),('244017'),('244017'),('244017'),('244017'),('244017'),('244017'),('244017'),('244017'),('244017'),('240040'),('240037'),('405009'),('405009'),('405009'),('405010'),('405010'),('240043'),('240043'),('504028'),('504040'),('800001'),('410019'),('410019'),('410020'),('410020'),('410020'),('410021'),('410021'),('244018'),('244018'),('244018'),('244018'),('244018'),('244018'),('244018'),('244018'),('244018'),('244018'),('244018'),('244019'),('244019'),('244019'),('244019'),('244019'),('244019'),('244019'),('244019'),('244019'),('244019'),('244019'),('244020'),('244020'),('244020'),('244020'),('244020'),('244020'),('244020'),('244020'),('413001'),('344007'),('082045'),('082045'),('082045'),('082045'),('082045'),('010031'),('010031'),('010031'),('010031'),('010032'),('010032'),('010032'),('010032'),('010033'),('010033'),('010033'),('010033'),('010033'),('010034'),('010034'),('010034'),('010034'),('010035'),('010035'),('010035'),('010035'),('504044'),('515016'),('515016'),('515016'),('515016'),('801002'),('801003'),('801004'),('801005'),('802001'),('801001'),('414001'),('141029'),('803001'),('803002'),('803004'),('803005'),('803006'),('803007'),('803008'),('803009'),('803013'),('803014'),('803015'),('803016'),('803017'),('410022'),('410023'),('410023'),('803019'),('415002'),('415001'),('244021'),('244021'),('244021'),('244021'),('244021'),('244021'),('244021'),('011020'),('011020'),('011020'),('011020'),('011023'),('011023'),('011023'),('011023'),('011022'),('011022'),('011022'),('011022'),('011022'),('011022'),('011021'),('011021'),('011021'),('011021'),('025065'),('025065'),('025065'),('025065'),('165037'),('165037'),('165038'),('165038'),('165038'),('165039'),('416001'),('416001'),('416001'),('416001'),('416001'),('416002'),('416003'),('417001'),('418001'),('504045'),('504045'),('504045'),('803022'),('240022'),('240022'),('240022'),('240022'),('420001'),('420001'),('420001'),('420001'),('804010'),('804005'),('804002'),('804018'),('804013'),('511019'),('511016'),('511015'),('511032'),('511031'),('511030'),('511027'),('511026'),('511025'),('511033'),('511023'),('133034'),('133034'),('133034'),('133033'),('169011'),('169011'),('169011'),('169011'),('169011'),('344008'),('244022'),('244022'),('244022'),('244022'),('244022'),('244022'),('244022'),('244026'),('244026'),('244026'),('244026'),('244026'),('244026'),('244025'),('244025'),('244025'),('244025'),('244025'),('244025'),('244025'),('244025'),('244030'),('244030'),('244030'),('244030'),('244030'),('244030'),('244030'),('244030'),('244023'),('244023'),('244023'),('244023'),('244023'),('244023'),('244024'),('244024'),('244024'),('244024'),('244024'),('244024'),('244024'),('244024'),('244027'),('244027'),('244027'),('244027'),('244027'),('244027'),('244027'),('244027'),('244028'),('244028'),('244028'),('244028'),('244028'),('244028'),('244028'),('244028'),('244029'),('244029'),('244029'),('244029'),('244029'),('244029'),('244029'),('244029'),('244031'),('244031'),('244031'),('244031'),('244031'),('244031'),('244031'),('244031'),('082046'),('082046'),('082046'),('082046'),('082047'),('082047'),('082048'),('082048'),('126015'),('126015'),('126016'),('126016'),('126016'),('126016'),('126016'),('416005'),('421001'),('421001'),('421002'),('016037'),('016037'),('016037'),('016037'),('016036'),('016036'),('016036'),('016036'),('115124'),('115124'),('115126'),('240049'),('240049'),('240048'),('240048'),('240047'),('240047'),('240046'),('240046'),('240045'),('240044'),('244032'),('244033'),('422002'),('422004'),('422004'),('422004'),('422005'),('422005'),('184013'),('184013'),('184013'),('805001'),('805002'),('805003'),('805004'),('805005'),('056024'),('056024'),('056024'),('423001'),('344010'),('235009'),('235009'),('235009'),('235009'),('212014'),('212014'),('056025'),('056025'),('056025'),('056026'),('056026'),('056026'),('056026'),('056026'),('056026'),('244034'),('244034'),('244034'),('244034'),('244034'),('244034'),('244035'),('244035'),('244035'),('244035'),('244035'),('244035'),('244035'),('244036'),('244036'),('244036'),('244036'),('244036'),('244036'),('244036'),('244037'),('244037'),('244037'),('244037'),('244037'),('244037'),('244037'),('244038'),('244038'),('244038'),('244038'),('244038'),('244038'),('244038'),('244039'),('244039'),('244039'),('244039'),('244039'),('244039'),('244039'),('203015'),('245002'),('245002'),('245001'),('245001'),('056029'),('056030'),('056032'),('424001'),('056034'),('056034'),('056034'),('056034'),('056033'),('056033'),('056033'),('805006'),('805007'),('805008'),('805009'),('805010'),('422008'),('422008'),('422007'),('422007'),('422006'),('422006'),('422010'),('422009'),('422009'),('422011'),('422011'),('209004'),('209004'),('150022'),('100002'),('056035'),('056035'),('056035'),('023036'),('023036'),('185005'),('246001'),('246001'),('247001'),('247001'),('247001'),('247001'),('247001'),('247001'),('247001'),('247002'),('247002'),('425001'),('416006'),('416006'),('165042'),('165041'),('165040'),('165043'),('010040'),('010039'),('010038'),('010036'),('248001'),('248002'),('248003'),('248004'),('248005'),('249001'),('249003'),('249004'),('249005'),('250007'),('250001'),('250002'),('250003'),('250004'),('250005'),('250006'),('250008'),('250009'),('250010'),('250011'),('250012'),('250013'),('251001'),('251002'),('806001'),('806002'),('235010'),('243009'),('249007'),('249008'),('249009'),('011024'),('011025'),('429001'),('429001'),('429002'),('429002'),('429003'),('429003');
-select field from t1 group by field;
-drop table t1;
-
-#
-# Test of enum with space
-#
-
-create table t1 (a enum (' ','a','b') not null);
-show create table t1;
-drop table t1;
-create table t1 (a enum (' ','a','b ') not null default 'b ');
-show create table t1;
-drop table t1;
-
-#
-# Tests of wrong enum values (bug #2023)
-#
-
-create table t1 (a enum ('0','1'));
-insert into t1 set a='foobar';
-select * from t1;
-update t1 set a = replace(a,'x','y');
-select * from t1;
-drop table t1;
-
-#
-# Bug #2077
-#
-
-set names latin1;
-create table t1 (a enum(0xE4, '1', '2') not null default 0xE4);
-show columns from t1;
-show create table t1;
-drop table t1;
-
-
-#
-# Bug #5628 German characters in field-defs will be '?'
-# with some table definitions
-#
-set names latin1;
-CREATE TABLE t1 (
- a INT default 1,
- b ENUM('value','_value','') character set latin1 NOT NULL
-);
-show create table t1;
-show columns from t1;
-drop table t1;
-
-#
-# Bugs #6154, 6206: ENUMs are not case sensitive even if declared BINARY
-#
-CREATE TABLE t1 (c enum('a', 'A') BINARY);
-INSERT INTO t1 VALUES ('a'),('A');
-SELECT * FROM t1;
-DROP TABLE t1;
-
-CREATE TABLE t1 (c enum('ae','oe','ue','ss') collate latin1_german2_ci);
-INSERT INTO t1 VALUES (''),(''),(''),('');
-SELECT * FROM t1;
-DROP TABLE t1;
-
-#
-# Bug #6379: ENUM values are incorrectly converted
-#
-# Check latin1 -> utf8 conversion
-#
-CREATE TABLE t1 (
- a ENUM('','','') character set utf8 default ''
-);
-show create table t1;
-insert into t1 values (''), (''), ('');
-select a from t1 order by a;
-drop table t1;
-
-#
-# Now check utf8 -> latin1 conversion
-# This test emulates loading a script generated with mysqldump
-#
-set names utf8;
-CREATE TABLE t1 (
- a ENUM('ä','ö','ü') character set latin1 default 'ü'
-);
-insert into t1 values ('ä'),('ö'),('ü');
-# Now check what has been loaded
-set names latin1;
-show create table t1;
-select a from t1 order by a;
-drop table t1;
-
-#
-# Test bug where enum fields where extended for each ALTER TABLE
-#
-
-create table t1 (a enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin);
-insert into t1 values ('Y');
-alter table t1 add b set ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin;
-alter table t1 add c enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin;
---enable_metadata
-select * from t1;
---disable_metadata
-drop table t1;
-
-#
-# Bug #6840 Default value is not checked in ALTER column SET DEFAULT 'x'
-#
-create table t1 (a enum('x','y') default 'x');
---error 1067
-alter table t1 alter a set default 'z';
-drop table t1;
-
-create table t1 (a set('x','y') default 'x');
---error 1067
-alter table t1 alter a set default 'z';
-drop table t1;
-
-
-#
-# Bug#20922 mysql removes a name of first column in a table
-#
-create table t1 (f1 int);
-alter table t1 add f2 enum(0xFFFF);
-show create table t1;
-drop table t1;
-
---echo End of 4.1 tests
-
-#
-# Bug#24660 "enum" field type definition problem
-#
-create table t1(russian enum('E','F','EF','FE') NOT NULL DEFAULT'E');
-show create table t1;
-drop table t1;
-
-create table t1(denormal enum('E','F','E,F','F,E') NOT NULL DEFAULT'E');
-show create table t1;
-drop table t1;
-
-create table t1(russian_deviant enum('E','F','EF','F,E') NOT NULL DEFAULT'E');
-show create table t1;
-drop table t1;
-
-# the following create statement sometimes fails like it would if NO_BACKSLASH_ESCAPES sql mode was on,
-# we check sql mode here
-select @@SESSION.sql_mode;
-select @@GLOBAL.sql_mode;
-
-## ER_WRONG_FIELD_TERMINATORS
-#--error 1005
-create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ','
-
- !"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\','zz'));
-
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
---echo End of 5.1 tests
diff --git a/mysql-test/suite/pbxt/t/type_float.test b/mysql-test/suite/pbxt/t/type_float.test
deleted file mode 100644
index 2b3184eb830..00000000000
--- a/mysql-test/suite/pbxt/t/type_float.test
+++ /dev/null
@@ -1,203 +0,0 @@
-# Description
-# -----------
-# Numeric floating point.
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-SELECT 10,10.0,10.,.1e+2,100.0e-1;
-SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000;
-SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1;
-SELECT 0.001e+1,0.001e-1, -0.001e+01,-0.001e-01;
-SELECT 123.23E+02,-123.23E-02,"123.23E+02"+0.0,"-123.23E-02"+0.0;
-SELECT 2147483647E+02,21474836.47E+06;
-
-create table t1 (f1 float(24),f2 float(52));
-# We mask out Privileges column because it differs for embedded server
---replace_column 8 #
-show full columns from t1;
-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);
-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;
-drop table t1;
-
-create table t1 (datum double);
-insert into t1 values (0.5),(1.0),(1.5),(2.0),(2.5);
-select * from t1;
-select * from t1 where datum < 1.5;
-select * from t1 where datum > 1.5;
-select * from t1 where datum = 1.5;
-drop table t1;
-
-create table t1 (a decimal(7,3) not null, key (a));
-insert into t1 values ("0"),("-0.00"),("-0.01"),("-0.002"),("1");
-select a from t1 order by a;
-select min(a) from t1;
-drop table t1;
-
-#
-# BUG#3612, BUG#4393, BUG#4356, BUG#4394
-#
-
-create table t1 (c1 double, c2 varchar(20));
-insert t1 values (121,"16");
-select c1 + c1 * (c2 / 100) as col from t1;
-create table t2 select c1 + c1 * (c2 / 100) as col1, round(c1, 5) as col2, round(c1, 35) as col3, sqrt(c1*1e-15) col4 from t1;
-# Floats are a bit different in PS
---disable_ps_protocol
-select * from t2;
---enable_ps_protocol
-show create table t2;
-drop table t1,t2;
-
-# Bug #1022: When a table contains a 'float' field,
-# and one of the functions MAX, MIN, or AVG is used on that field,
-# the system crashes.
-
-create table t1 (a float);
-insert into t1 values (1);
-select max(a),min(a),avg(a) from t1;
-drop table t1;
-
-#
-# FLOAT/DOUBLE/DECIMAL handling
-#
-
-create table t1 (f float, f2 float(24), f3 float(6,2), d double, d2 float(53), d3 double(10,3), de decimal, de2 decimal(6), de3 decimal(5,2), n numeric, n2 numeric(8), n3 numeric(7,6));
-# We mask out Privileges column because it differs for embedded server
---replace_column 8 #
-show full columns from t1;
-drop table t1;
-
-create table t1 (a decimal(7,3) not null, key (a));
-insert into t1 values ("0"),("-0.00"),("-0.01"),("-0.002"),("1");
-select a from t1 order by a;
-select min(a) from t1;
-drop table t1;
-
---error 1425
-create table t1 (a float(200,100), b double(200,100));
-
-#
-# float in a char(1) field
-#
-create table t1 (c20 char);
-insert into t1 values (5000.0);
-insert into t1 values (0.5e4);
-drop table t1;
-
-# Errors
-
---error 1063
-create table t1 (f float(54)); # Should give an error
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-# Don't allow 'double unsigned' to be set to a negative value (Bug #7700)
-create table t1 (d1 double, d2 double unsigned);
-insert into t1 set d1 = -1.0;
-update t1 set d2 = d1;
-select * from t1;
-drop table t1;
-
-# Ensure that maximum values as the result of number of decimals
-# being specified in table schema are enforced (Bug #7361)
-create table t1 (f float(4,3));
-insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11");
-select * from t1;
-drop table if exists t1;
-create table t1 (f double(4,3));
-insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11");
-select * from t1;
-drop table if exists t1;
-
-# Check conversion of floats to character field (Bug #7774)
-create table t1 (c char(20));
-insert into t1 values (5e-28);
-# Expected result is "5e-28", but windows returns "5e-028"
---replace_result 5e-028 5e-28
-select * from t1;
-drop table t1;
-create table t1 (c char(6));
-insert into t1 values (2e5),(2e6),(2e-4),(2e-5);
-# Expected result is "2e+06", but windows returns "2e+006"
-# Expected result is "2e-05", but windows returns "2e-005"
---replace_result 2e+006 2e+06 2e-005 2e-05
-select * from t1;
-drop table t1;
-
-#
-# Test of comparison of integer with float-in-range (Bug #7840)
-# This is needed because some ODBC applications (like Foxpro) uses
-# floats for everything.
-#
-
-CREATE TABLE t1 (
- reckey int unsigned NOT NULL,
- recdesc varchar(50) NOT NULL,
- PRIMARY KEY (reckey)
-) ENGINE=PBXT DEFAULT CHARSET=latin1; # PBXT tested instead of MyISAM
-
-INSERT INTO t1 VALUES (108, 'Has 108 as key');
-INSERT INTO t1 VALUES (109, 'Has 109 as key');
-select * from t1 where reckey=108;
-select * from t1 where reckey=1.08E2;
-select * from t1 where reckey=109;
-select * from t1 where reckey=1.09E2;
-drop table t1;
-
-#
-# Bug #13372 (decimal union)
-#
-create table t1 (d double(10,1));
-create table t2 (d double(10,9));
-insert into t1 values ("100000000.0");
-insert into t2 values ("1.23456780");
-create table t3 select * from t2 union select * from t1;
-select * from t3;
-show create table t3;
-drop table t1, t2, t3;
-
-
-#
-# Bug #9855 (inconsistent column type for create select
-#
-create table t1 select 105213674794682365.00 + 0.0 x;
-show warnings;
-desc t1;
-drop table t1;
-
-create table t1 select 0.0 x;
-desc t1;
-create table t2 select 105213674794682365.00 y;
-desc t2;
-create table t3 select x+y a from t1,t2;
-show warnings;
-desc t3;
-drop table t1,t2,t3;
-
-#
-# Bug #22129: A small double precision number becomes zero
-#
-# check if underflows are detected correctly
-select 1e-308, 1.00000001e-300, 100000000e-300;
-
-# check if overflows are detected correctly
-select 10e307;
-
---echo End of 4.1 tests
-
-#
-# bug #12694 (float(m,d) specifications)
-#
-
---error 1427
-create table t1 (s1 float(0,2));
---error 1427
-create table t1 (s1 float(1,2));
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/type_nchar.test b/mysql-test/suite/pbxt/t/type_nchar.test
deleted file mode 100644
index 731f0d1c041..00000000000
--- a/mysql-test/suite/pbxt/t/type_nchar.test
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# Test nchar/nvarchar
-#
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (c nchar(10));
-show create table t1;
-drop table t1;
-
-create table t1 (c national char(10));
-show create table t1;
-drop table t1;
-
-create table t1 (c national varchar(10));
-show create table t1;
-drop table t1;
-
-create table t1 (c nvarchar(10));
-show create table t1;
-drop table t1;
-
-create table t1 (c nchar varchar(10));
-show create table t1;
-drop table t1;
-
-create table t1 (c national character varying(10));
-show create table t1;
-drop table t1;
-
-create table t1 (c nchar varying(10));
-show create table t1;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/type_newdecimal.test b/mysql-test/suite/pbxt/t/type_newdecimal.test
deleted file mode 100644
index 649d5fb64f6..00000000000
--- a/mysql-test/suite/pbxt/t/type_newdecimal.test
+++ /dev/null
@@ -1,1149 +0,0 @@
---disable_warnings
-drop table if exists t1;
---enable_warnings
-#
-# constant IN function test
-#
-select 1.1 IN (1.0, 1.2);
-select 1.1 IN (1.0, 1.2, 1.1, 1.4, 0.5);
-select 1.1 IN (1.0, 1.2, NULL, 1.4, 0.5);
-select 0.5 IN (1.0, 1.2, NULL, 1.4, 0.5);
-select 1 IN (1.11, 1.2, 1.1, 1.4, 1, 0.5);
-select 1 IN (1.11, 1.2, 1.1, 1.4, NULL, 0.5);
-
-#
-# case function test
-#
-select case 1.0 when 0.1 then "a" when 1.0 then "b" else "c" END;
-select case 0.1 when 0.1 then "a" when 1.0 then "b" else "c" END;
-select case 1 when 0.1 then "a" when 1.0 then "b" else "c" END;
-select case 1.0 when 0.1 then "a" when 1 then "b" else "c" END;
-select case 1.001 when 0.1 then "a" when 1 then "b" else "c" END;
-
-#
-# non constant IN test
-#
-create table t1 (a decimal(6,3));
-insert into t1 values (1.0), (NULL), (0.1);
-select * from t1;
-select 0.1 in (1.0, 1.2, 1.1, a, 1.4, 0.5) from t1;
-drop table t1;
-
-#
-# if function test
-#
-create table t1 select if(1, 1.1, 1.2), if(0, 1.1, 1.2), if(0.1, 1.1, 1.2), if(0, 1, 1.1), if(0, NULL, 1.2), if(1, 0.22e1, 1.1), if(1E0, 1.1, 1.2);
-select * from t1;
-show create table t1;
-drop table t1;
-
-#
-# NULLIF
-#
-create table t1 select nullif(1.1, 1.1), nullif(1.1, 1.2), nullif(1.1, 0.11e1), nullif(1.0, 1), nullif(1, 1.0), nullif(1, 1.1);
-select * from t1;
-show create table t1;
-drop table t1;
-
-#
-# saving in decimal field with overflow
-#
-
-create table t1 (a decimal(4,2));
-insert into t1 value (10000), (1.1e10), ("11111"), (100000.1);
-insert into t1 value (-10000), (-1.1e10), ("-11111"), (-100000.1);
-select a from t1;
-drop table t1;
-create table t1 (a decimal(4,2) unsigned);
-insert into t1 value (10000), (1.1e10), ("11111"), (100000.1);
-insert into t1 value (-10000), (-1.1e10), ("-11111"), (-100000.1);
-select a from t1;
-drop table t1;
-
-
-#
-# saving in field with overflow from decimal
-#
-create table t1 (a bigint);
-insert into t1 values (18446744073709551615.0);
-insert into t1 values (9223372036854775808.0);
-insert into t1 values (-18446744073709551615.0);
-select * from t1;
-drop table t1;
-create table t1 (a bigint unsigned);
-insert into t1 values (18446744073709551615.0);
-insert into t1 values (9223372036854775808.0);
-insert into t1 values (9999999999999999999999999.000);
-insert into t1 values (-1.0);
-select * from t1;
-drop table t1;
-create table t1 (a tinyint);
-insert into t1 values (18446744073709551615.0);
-insert into t1 values (9223372036854775808.0);
-select * from t1;
-drop table t1;
-
-#
-# test that functions create decimal fields
-#
-create table t1 select round(15.4,-1), truncate(-5678.123451,-3), abs(-1.1), -(-1.1);
-show create table t1;
-drop table t1;
-
-#
-# Trydy's tests
-#
-set session sql_mode='traditional';
-select 1e10/0e0;
-create table wl1612 (col1 int, col2 decimal(38,10), col3 numeric(38,10));
-insert into wl1612 values(1,12345678901234567890.1234567890,12345678901234567890.1234567890);
-select * from wl1612;
-insert into wl1612 values(2,01234567890123456789.0123456789,01234567890123456789.0123456789);
-select * from wl1612 where col1=2;
-insert into wl1612 values(3,1234567890123456789012345678.0123456789,1234567890123456789012345678.0123456789);
-select * from wl1612 where col1=3;
-
-select col1/0 from wl1612;
-select col2/0 from wl1612;
-select col3/0 from wl1612;
-
-insert into wl1612 values(5,5000.0005,5000.0005);
-insert into wl1612 values(6,5000.0005,5000.0005);
-select sum(col2),sum(col3) from wl1612;
-#select avg(col2),avg(col3) from wl1612;
-
-insert into wl1612 values(7,500000.000005,500000.000005);
-insert into wl1612 values(8,500000.000005,500000.000005);
-select sum(col2),sum(col3) from wl1612 where col1>4;
-#select avg(col2),avg(col3) from wl1612 where col1>4;
-
-#insert into wl1612 (col1,col2) values(9,123456789012345678901234567890);
-#insert into wl1612 (col1,col3) values(9,123456789012345678901234567890);
-
-insert into wl1612 (col1, col2) values(9,1.01234567891);
-insert into wl1612 (col1, col2) values(10,1.01234567894);
-insert into wl1612 (col1, col2) values(11,1.01234567895);
-insert into wl1612 (col1, col2) values(12,1.01234567896);
-select col1,col2 from wl1612 where col1>8;
-
-insert into wl1612 (col1, col3) values(13,1.01234567891);
-insert into wl1612 (col1, col3) values(14,1.01234567894);
-insert into wl1612 (col1, col3) values(15,1.01234567895);
-insert into wl1612 (col1, col3) values(16,1.01234567896);
-select col1,col3 from wl1612 where col1>12;
-
-select col1 from wl1612 where col1>4 and col2=1.01234567891;
-#-- should return 0 rows
-#
-select col1 from wl1612 where col1>4 and col2=1.0123456789;
-#-- should return col1 values 9 & 10
-#
-select col1 from wl1612 where col1>4 and col2<>1.0123456789;
-#-- should return col1 values 5,6,7,8,11,12
-#
-select col1 from wl1612 where col1>4 and col2<1.0123456789;
-#-- should return 0 rows
-#
-select col1 from wl1612 where col1>4 and col2<=1.0123456789;
-#-- should return col1 values 9 & 10
-#
-select col1 from wl1612 where col1>4 and col2>1.0123456789;
-#-- should return col1 values 5,6,7,8,11,12
-#
-select col1 from wl1612 where col1>4 and col2>=1.0123456789;
-#-- should return col1 values 5,6,7,8,910,11,12
-#
-#select col1, col2 from wl1612 where col1=11 or col1=12;
-select col1 from wl1612 where col1>4 and col2=1.012345679;
-#-- should return col1 values 11,12
-#
-select col1 from wl1612 where col1>4 and col2<>1.012345679;
-#-- should return col1 values 5,6,7,8,9,10
-#
-select col1 from wl1612 where col1>4 and col3=1.01234567891;
-#-- should return 0 rows
-#
-select col1 from wl1612 where col1>4 and col3=1.0123456789;
-#-- should return col1 values 13,14
-#
-select col1 from wl1612 where col1>4 and col3<>1.0123456789;
-#-- should return col1 values 5,6,7,8,15,16
-#
-select col1 from wl1612 where col1>4 and col3<1.0123456789;
-#-- should return 0 rows
-#
-select col1 from wl1612 where col1>4 and col3<=1.0123456789;
-#-- should return col1 values 13,14
-#
-select col1 from wl1612 where col1>4 and col3>1.0123456789;
-#-- should return col1 values 5,6,7,8,15,16
-#
-select col1 from wl1612 where col1>4 and col3>=1.0123456789;
-#-- should return col1 values 5,6,7,8,13,14,15,16
-#
-select col1 from wl1612 where col1>4 and col3=1.012345679;
-#-- should return col1 values 15,16
-#
-select col1 from wl1612 where col1>4 and col3<>1.012345679;
-#-- should return col1 values 5,6,7,8,13,14
-#
-drop table wl1612;
-#
-select 1/3;
-#
-select 0.8=0.7+0.1;
-#-- should return 1 (true)
-#
-select 0.7+0.1;
-#
-create table wl1612_1 (col1 int);
-insert into wl1612_1 values(10);
-#
-select * from wl1612_1 where 0.8=0.7+0.1;
-#--should return 1 row (col1=10)
-#
-select 0.07+0.07 from wl1612_1;
-#
-select 0.07-0.07 from wl1612_1;
-#
-select 0.07*0.07 from wl1612_1;
-#
-select 0.07/0.07 from wl1612_1;
-#
-drop table wl1612_1;
-#
-create table wl1612_2 (col1 decimal(10,2), col2 numeric(10,2));
-insert into wl1612_2 values(1,1);
-insert into wl1612_2 values(+1,+1);
-insert into wl1612_2 values(+01,+01);
-insert into wl1612_2 values(+001,+001);
-#
-select col1,count(*) from wl1612_2 group by col1;
-#
-select col2,count(*) from wl1612_2 group by col2;
-#
-drop table wl1612_2;
-#
-create table wl1612_3 (col1 decimal(10,2), col2 numeric(10,2));
-insert into wl1612_3 values('1','1');
-insert into wl1612_3 values('+1','+1');
-#
-insert into wl1612_3 values('+01','+01');
-insert into wl1612_3 values('+001','+001');
-#
-select col1,count(*) from wl1612_3 group by col1;
-#
-select col2,count(*) from wl1612_3 group by col2;
-#
-drop table wl1612_3;
-#
-select mod(234,10) ;
-#-- should return 4
-#
-select mod(234.567,10.555);
-#-- should return 2.357
-#
-select mod(-234.567,10.555);
-#-- should return -2.357
-#
-select mod(234.567,-10.555);
-#-- should return 2.357
-#
-select round(15.1);
-#-- should return 15
-#
-select round(15.4);
-#-- should return 15
-#
-select round(15.5);
-#-- should return 16
-#
-select round(15.6);
-#-- should return 16
-#
-select round(15.9);
-#-- should return 16
-#
-select round(-15.1);
-#-- should return -15
-#
-select round(-15.4);
-#-- should return -15
-#
-select round(-15.5);
-#-- should return -16
-#
-select round(-15.6);
-#-- should return -16
-#
-select round(-15.9);
-#-- should return -16
-#
-select round(15.1,1);
-#-- should return 15.1
-#
-select round(15.4,1);
-#-- should return 15.4
-#
-select round(15.5,1);
-#-- should return 15.5
-#
-select round(15.6,1);
-#-- should return 15.6
-#
-select round(15.9,1);
-#-- should return 15.9
-#
-select round(-15.1,1);
-#-- should return -15.1
-#
-select round(-15.4,1);
-#-- should return -15.4
-#
-select round(-15.5,1);
-#-- should return -15.5
-#
-select round(-15.6,1);
-#-- should return -15.6
-#
-select round(-15.9,1);
-#-- should return -15.9
-#
-select round(15.1,0);
-#-- should return 15
-#
-select round(15.4,0);
-#-- should return 15
-#
-select round(15.5,0);
-#-- should return 16
-#
-select round(15.6,0);
-#-- should return 16
-#
-select round(15.9,0);
-#-- should return 16
-#
-select round(-15.1,0);
-#-- should return -15
-#
-select round(-15.4,0);
-#-- should return -15
-#
-select round(-15.5,0);
-#-- should return -16
-#
-select round(-15.6,0);
-#-- should return -16
-#
-select round(-15.9,0);
-#-- should return -16
-#
-select round(15.1,-1);
-#-- should return 20
-#
-select round(15.4,-1);
-#-- should return 20
-#
-select round(15.5,-1);
-#-- should return 20
-#
-select round(15.6,-1);
-#-- should return 20
-#
-select round(15.9,-1);
-#-- should return 20
-#
-select round(-15.1,-1);
-#-- should return -20
-#
-select round(-15.4,-1);
-#-- should return -20
-#
-select round(-15.5,-1);
-#-- should return -20
-#
-select round(-15.6,-1);
-#-- should return -20
-#
-select round(-15.91,-1);
-#-- should return -20
-#
-select truncate(5678.123451,0);
-#-- should return 5678
-#
-select truncate(5678.123451,1);
-#-- should return 5678.1
-#
-select truncate(5678.123451,2);
-#-- should return 5678.12
-#
-select truncate(5678.123451,3);
-#-- should return 5678.123
-#
-select truncate(5678.123451,4);
-#-- should return 5678.1234
-#
-select truncate(5678.123451,5);
-#-- should return 5678.12345
-#
-select truncate(5678.123451,6);
-#-- should return 5678.123451
-#
-select truncate(5678.123451,-1);
-#-- should return 5670
-#
-select truncate(5678.123451,-2);
-#-- should return 5600
-#
-select truncate(5678.123451,-3);
-#-- should return 5000
-#
-select truncate(5678.123451,-4);
-#-- should return 0
-#
-select truncate(-5678.123451,0);
-#-- should return -5678
-#
-select truncate(-5678.123451,1);
-#-- should return -5678.1
-#
-select truncate(-5678.123451,2);
-#-- should return -5678.12
-#
-select truncate(-5678.123451,3);
-#-- should return -5678.123
-#
-select truncate(-5678.123451,4);
-#-- should return -5678.1234
-#
-select truncate(-5678.123451,5);
-#-- should return -5678.12345
-#
-select truncate(-5678.123451,6);
-#-- should return -5678.123451
-#
-select truncate(-5678.123451,-1);
-#-- should return -5670
-#
-select truncate(-5678.123451,-2);
-#-- should return -5600
-#
-select truncate(-5678.123451,-3);
-#-- should return -5000
-#
-select truncate(-5678.123451,-4);
-#-- should return 0
-#
-#drop table if exists wl1612_4;
-create table wl1612_4 (col1 int, col2 decimal(30,25), col3 numeric(30,25));
-#
-insert into wl1612_4 values(1,0.0123456789012345678912345,0.0123456789012345678912345);
-#
-select col2/9999999999 from wl1612_4 where col1=1;
-#
-select col3/9999999999 from wl1612_4 where col1=1;
-#
-select 9999999999/col2 from wl1612_4 where col1=1;
-#
-select 9999999999/col3 from wl1612_4 where col1=1;
-#
-select col2*9999999999 from wl1612_4 where col1=1;
-#
-select col3*9999999999 from wl1612_4 where col1=1;
-#
-insert into wl1612_4 values(2,55555.0123456789012345678912345,55555.0123456789012345678912345);
-#
-select col2/9999999999 from wl1612_4 where col1=2;
-#
-select col3/9999999999 from wl1612_4 where col1=2;
-#
-select 9999999999/col2 from wl1612_4 where col1=2;
-#
-select 9999999999/col3 from wl1612_4 where col1=2;
-#
-select col2*9999999999 from wl1612_4 where col1=2;
-#
-select col3*9999999999 from wl1612_4 where col1=2;
-#
-drop table wl1612_4;
-#
-#
-#
-#
-#-- Additional tests for WL#1612 Precision math
-#
-#-- Comparisons should show that a number is
-#-- exactly equal to its value as displayed.
-#
-set sql_mode='';
-#
-select 23.4 + (-41.7), 23.4 - (41.7) = -18.3;
-#
-select -18.3=-18.3;
-#
-select 18.3=18.3;
-#
-select -18.3=18.3;
-#
-select 0.8 = 0.7 + 0.1;
-
-#
-#-- It should be possible to define a column
-#-- with up to 38 digits precision either before
-#-- or after the decimal point. Any number which
-#-- is inserted, if it's within the range, should
-#-- be exactly the same as the number that gets
-#-- selected.
-#
-drop table if exists t1;
-#
-create table t1 (col1 decimal(38));
-#
-insert into t1 values (12345678901234567890123456789012345678);
-#
-select * from t1;
-#-- should return:
-#+----------------------------------------+
-#| col1 |
-#+----------------------------------------+
-#| 12345678901234567890123456789012345678 |
-#+----------------------------------------+
-#
-#drop table t1;
-#
-#create table t1 (col1 decimal(38,38));
-#
-#insert into t1 values (.12345678901234567890123456789012345678);
-#
-#select * from t1;
-#-- should return:
-#+------------------------------------------+
-#| col1 |
-#+------------------------------------------+
-#| 0.12345678901234567890123456789012345678 |
-#+------------------------------------------+
-#
-drop table t1;
-#
-create table t1 (col1 decimal(31,30));
-#
-insert into t1 values (0.00000000001);
-#
-select * from t1;
-#-- should return:
-#+---------------+
-#|col1 |
-#+---------------+
-#| 0.00000000001 |
-#+---------------+
-#
-drop table t1;
-#
-#-- The usual arithmetic operators / * + - should work.
-#
-#select 77777777777777777777777777777777777777 / 7777777777777777777777777777777777777 = 10;
-#-- should return 0 (false).
-#
-select 7777777777777777777777777777777777777 * 10;
-#-- should return 77777777777777777777777777777777777770
-#
-select .7777777777777777777777777777777777777 *
- 1000000000000000000;
-#-- should return 777777777777777777.7777777777777777777
-#
-select .7777777777777777777777777777777777777 - 0.1;
-#-- should return .6777777777777777777777777777777777777
-#
-select .343434343434343434 + .343434343434343434;
-#-- should return .686868686868686868
-#
-#-- 5. All arithmetic functions mentioned in the
-#MySQL Reference Manual should work.
-#
-select abs(9999999999999999999999);
-#-- should return 9999999999999999999999
-#
-select abs(-9999999999999999999999);
-#-- should return 9999999999999999999999
-#
-select ceiling(999999999999999999);
-select ceiling(99999999999999999999);
-#-- should return 99999999999999999999
-#
-select ceiling(9.9999999999999999999);
-#-- should return 10
-#
-select ceiling(-9.9999999999999999999);
-#-- should return 9
-#
-select floor(999999999999999999);
-select floor(9999999999999999999999);
-#-- should return 9999999999999999999999
-#
-select floor(9.999999999999999999999);
-#-- should return 9
-#
-select floor(-9.999999999999999999999);
-#-- should return -10
-#
-select floor(-999999999999999999999.999);
-select ceiling(999999999999999999999.999);
-#
-#
-select 99999999999999999999999999999999999999 mod 3;
-#-- should return 0
-#
-select round(99999999999999999.999);
-#-- should return 100000000000000000
-#
-select round(-99999999999999999.999);
-#-- should return -100000000000000000
-#
-select round(99999999999999999.999,3);
-#-- should return 100000000000000000.000
-#
-select round(-99999999999999999.999,3);
-#-- should return -100000000000000000.000
-#
-select truncate(99999999999999999999999999999999999999,31);
-#-- should return 99999999999999999999999999999999999999.000
-#
-select truncate(99.999999999999999999999999999999999999,31);
-#-- should return 99.9999999999999999999999999999999
-#
-select truncate(99999999999999999999999999999999999999,-31);
-# should return 90000000000000000000000000000000
-#
-#-- 6. Set functions (AVG, SUM, COUNT) should work.
-#
-#drop table if exists t1;
-#
-#delimiter //
-#
-#create procedure p1 () begin
-# declare v1 int default 1; declare v2 decimal(0,38) default 0;
-# create table t1 (col1 decimal(0,38));
-# while v1 <= 10000 do
-# insert into t1 values (-v2);
-# set v2 = v2 + 0.00000000000000000000000000000000000001;
-# set v1 = v1 + 1;
-# end while;
-# select avg(col1),sum(col1),count(col1) from t1; end;//
-#
-#call p1()//
-#-- should return
-# -- avg(col1)=0.00000000000000000000000000000000000001 added 10,000 times, then divided by 10,000
-# -- sum(col1)=0.00000000000000000000000000000000000001 added 10,000 times
-#
-# -- count(col1)=10000
-#
-#delimiter ;//
-#
-#drop procedure p1;
-#drop table t1;
-#
-#-- When I say DECIMAL(x) I should be able to store x digits.
-#-- If I can't, there should be an error at CREATE time.
-#
-#drop table if exists t1;
-#
-#create table t1 (col1 decimal(254));
-#-- should return SQLSTATE 22003 numeric value out of range
-#
-#-- When I say DECIMAL(x,y) there should be no silent change of precision or
-#-- scale.
-#
-#drop table if exists t1;
-#
-#create table t1 (col1 decimal(0,38));
-#
-#show create table t1;
-#-- should return:
-#+-------+--------------------------------+
-#| Table | Create Table |
-#+-------+--------------------------------+
-#| t9 | CREATE TABLE `t1` ( |
-#|`s1` decimal(0,38) default NULL |
-#| ) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
-#+-------+--------------------------------+
-#
-#drop table t1;
-#
-#-- From WL#1612 "The future" point 2.:
-#-- The standard requires that we treat numbers like "0.5" as
-#-- DECIMAL or NUMERIC, not as floating-point.
-#
-#drop table if exists t1;
-#
-#
-create table t1 as select 0.5;
-#
-show create table t1;
-#-- should return:
-#+-------+-----------------------------------+
-#| Table | Create Table |
-#+-------+-----------------------------------+
-#| t7 | CREATE TABLE `t1` ( |
-#| `0.5` decimal(3,1) NOT NULL default '0.0' |
-#| ) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
-#+-------+-----------------------------------+
-#
-drop table t1;
-#
-#-- From WL#1612, "The future", point 3.: We have to start rounding correctly.
-#
-select round(1.5),round(2.5);
-#-- should return:
-#+------------+------------+
-#| round(1.5) | round(2.5) |
-#+------------+------------+
-#| 2 | 3 |
-#+------------+------------+
-#
-#-- From WL#1612, "The future", point 4.: "select 0.07 * 0.07;" should return 0.0049, not 0.00.
-#-- If operand#1 has scale X and operand#2 has scale Y, then result should have scale (X+Y).
-#
-select 0.07 * 0.07;
-#-- should return 0.0049
-#
-#-- From WL#1612, "The future", point 5.: Division by zero is an error.
-#
-set sql_mode='traditional';
-#
-select 1E-500 = 0;
-#-- should return 1 (true).
-#
-select 1 / 1E-500;
-#
-#-- should return SQLSTATE 22012 division by zero.
-#
-select 1 / 0;
-#-- should return SQLSTATE 22012 division by zero.
-#
-#+-------+
-#| 1 / 0 |
-#+-------+
-#| NULL |
-#+-------+
-#1 row in set, 1 warning (0.00 sec)
-#
-#-- From WL#1612 "The future" point 6.: Overflow is an error.
-#
-#set sql_mode='';
-#
-#select 1E300 * 1E300;
-#-- should return SQLSTATE 22003 numeric value out of range
-#
-#select 18446744073709551615 + 1;
-#-- should return SQLSTATE 22003 numeric value out of range
-#
-#-- 14. From WL#1612 "The future" point 7.:
-#-- If s1 is INTEGER and s2 is DECIMAL, then
-#-- "create table tk7 as select avg(s1),avg(s2) from tk;"
-#-- should not create a table with "double(17,4)" data types.
-#-- The result of AVG must still be exact numeric, with a
-#-- scale the same or greater than the operand's scale.
-#-- The result of SUM must still be exact numeric, with
-#-- a scale the same as the operand's scale.
-#
-#drop table if exists t1;
-#drop table if exists t2;
-#
-#create table t1 (col1 int, col2 decimal(5));
-#
-#create table t2 as select avg(col1),avg(col2) from t1;
-#
-#
-#show create table t2;
-#-- should return:
-#+-------+---------------------------------+
-#| Table | Create Table |
-#+-------+---------------------------------+
-#| t2 | CREATE TABLE `t2` ( |
-#| `avg(col1)` decimal(17,4) default NULL, |
-#| `avg(col2)` decimal(17,5) default NULL |
-#| ) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
-#+-------+---------------------------------+
-#
-#drop table t2;
-#drop table t1;
-#
-#-- From WL#1612 "The future" point 8.: Stop storing leading "+" signs and
-# leading "0"s.
-#
-#drop table if exists t1;
-#
-#create table t1 (col1 decimal(5,2),col2 decimal(5) zerofill, col3 decimal(3,1));
-#
-#insert into t1 values (1,1,1);
-#
-#select col1 from t1 union select col2 from t1 union select col3 from t1;
-#
-#drop table t1;
-#
-#-- From WL#1612, The future" point 9.:
-#-- Accept the data type and precision and scale as the user
-#-- asks, or return an error, but don't change to something else.
-#
-#drop table if exists t1;
-#
-#create table t1 (col1 numeric(4,2));
-#
-#show create table t1;
-#
-#drop table t1;
-#
-#-- The scripts in the following bugs should work:
-#
-
-#BUG#559 Maximum precision for DECIMAL column ...
-#BUG#1499 INSERT/UPDATE into decimal field rounding problem
-#BUG#1845 Not correctly recognising value for decimal field
-#BUG#2493 Round function doesn't work correctly
-#BUG#2649 round(0.5) gives 0 (should be 1)
-#BUG#3612 impicite rounding of VARCHARS during aritchmetic operations...
-#BUG#3722 SELECT fails for certain values in Double(255,10) column.
-#BUG#4485 Floating point conversions are inconsistent
-#BUG#4891 MATH
-#BUG#5931 Out-of-range values are accepted
-#BUG#6048 Stored procedure causes operating system reboot
-#BUG#6053 DOUBLE PRECISION literal
-
-# Tests from 'traditional' mode tests
-#
-set sql_mode='ansi,traditional';
-#
-CREATE TABLE Sow6_2f (col1 NUMERIC(4,2));
-#-- should return OK
-INSERT INTO Sow6_2f VALUES (10.55);
-#-- should return OK
-INSERT INTO Sow6_2f VALUES (10.5555);
-#-- should return OK
-INSERT INTO Sow6_2f VALUES (-10.55);
-#-- should return OK
-INSERT INTO Sow6_2f VALUES (-10.5555);
-#-- should return OK
-INSERT INTO Sow6_2f VALUES (11);
-#-- should return OK
--- error 1264
-INSERT INTO Sow6_2f VALUES (101.55);
-#-- should return SQLSTATE 22003 numeric value out of range
--- error 1264
-UPDATE Sow6_2f SET col1 = col1 * 50 WHERE col1 = 11;
-#-- should return SQLSTATE 22003 numeric value out of range
--- error 1365
-UPDATE Sow6_2f SET col1 = col1 / 0 WHERE col1 > 0;
-#-- should return SQLSTATE 22012 division by zero
-SELECT MOD(col1,0) FROM Sow6_2f;
-#-- should return SQLSTATE 22012 division by zero
--- error 1366
-INSERT INTO Sow6_2f VALUES ('a59b');
-#-- should return SQLSTATE 22018 invalid character value for cast
-drop table Sow6_2f;
-
-#
-# bug#9501
-#
-select 10.3330000000000/12.34500000;
-
-#
-# Bug #10404
-#
-
-set sql_mode='';
-select 0/0;
-
-#
-# bug #9546
-#
---disable_ps_protocol
-select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 as x;
-select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + 1 as x;
---enable_ps_protocol
-#
-# Bug #10004
-#
-select 0.190287977636363637 + 0.040372670 * 0 - 0;
-#
-# Bug #9527
-#
-select -0.123 * 0;
-
-#
-# Bug #10232
-#
-
-CREATE TABLE t1 (f1 DECIMAL (12,9), f2 DECIMAL(2,2));
-INSERT INTO t1 VALUES (10.5, 0);
-UPDATE t1 SET f1 = 4.5;
-SELECT * FROM t1;
-DROP TABLE t1;
-CREATE TABLE t1 (f1 DECIMAL (64,20), f2 DECIMAL(2,2));
-INSERT INTO t1 VALUES (9999999999999999999999999999999999, 0);
-SELECT * FROM t1;
-DROP TABLE t1;
-
-#
-# Bug #10599: problem with NULL
-#
-
-select abs(10/0);
-select abs(NULL);
-
-#
-# Bug #9894 (negative to unsigned column)
-#
-set @@sql_mode='traditional';
-create table t1( d1 decimal(18) unsigned, d2 decimal(20) unsigned, d3 decimal (22) unsigned);
---error 1264
-insert into t1 values(1,-1,-1);
-drop table t1;
-create table t1 (col1 decimal(5,2), col2 numeric(5,2));
---error 1264
-insert into t1 values (999.999,999.999);
---error 1264
-insert into t1 values (-999.999,-999.999);
-select * from t1;
-drop table t1;
-set sql_mode='';
-
-#
-# Bug #8425 (insufficient precision of the division)
-#
-set @sav_dpi= @@div_precision_increment;
-set @@div_precision_increment=15;
-create table t1 (col1 int, col2 decimal(30,25), col3 numeric(30,25));
-insert into t1 values (1,0.0123456789012345678912345,0.0123456789012345678912345);
-select col2/9999999999 from t1 where col1=1;
-select 9999999999/col2 from t1 where col1=1;
-select 77777777/7777777;
-drop table t1;
-set div_precision_increment= @sav_dpi;
-
-#
-# Bug #10896 (0.00 > -0.00)
-#
-create table t1 (a decimal(4,2));
-insert into t1 values (0.00);
-select * from t1 where a > -0.00;
-select * from t1 where a = -0.00;
-drop table t1;
-
-#
-# Bug #11215: a problem with LONGLONG_MIN
-#
-
-create table t1 (col1 bigint default -9223372036854775808);
-insert into t1 values (default);
-select * from t1;
-drop table t1;
-
-#
-# Bug #10891 (converting to decimal crashes server)
-#
-select cast('1.00000001335143196001808973960578441619873046875E-10' as decimal(30,15));
-
-#
-# Bug #11708 (conversion to decimal fails in decimal part)
-#
-select ln(14000) c1, convert(ln(14000),decimal(5,3)) c2, cast(ln(14000) as decimal(5,3)) c3;
---error 1427
-select convert(ln(14000),decimal(2,3)) c1;
---error 1427
-select cast(ln(14000) as decimal(2,3)) c1;
-
-#
-# Bug #8449 (Silent column changes)
-#
---error 1426
-create table t1 (sl decimal(70,30));
---error 1425
-create table t1 (sl decimal(32,31));
---error 1425
-create table t1 (sl decimal(0,38));
---error 1427
-create table t1 (sl decimal(0,30));
-create table t1 (sl decimal(5, 5));
-show create table t1;
-drop table t1;
-# Test limits
-create table t1 (sl decimal(65, 30));
-show create table t1;
-drop table t1;
-
-#
-# Bug 11557 (DEFAULT values rounded improperly
-#
-create table t1 (
- f1 decimal unsigned not null default 17.49,
- f2 decimal unsigned not null default 17.68,
- f3 decimal unsigned not null default 99.2,
- f4 decimal unsigned not null default 99.7,
- f5 decimal unsigned not null default 104.49,
- f6 decimal unsigned not null default 199.91,
- f7 decimal unsigned not null default 999.9,
- f8 decimal unsigned not null default 9999.99);
-insert into t1 (f1) values (1);
-select * from t1;
-drop table t1;
-
-#
-# Bug 12173 (show create table fails)
-#
-create table t1 (
- f0 decimal (30,30) zerofill not null DEFAULT 0,
- f1 decimal (0,0) zerofill not null default 0);
-show create table t1;
-drop table t1;
-
-#
-# Bug 12938 (arithmetic loop's zero)
-#
---disable_warnings
-drop procedure if exists wg2;
---enable_warnings
-delimiter //;
-create procedure wg2()
-begin
- declare v int default 1;
- declare tdec decimal(5) default 0;
- while v <= 9 do set tdec =tdec * 10;
- select v, tdec;
- set v = v + 1;
- end while;
-end//
-
-call wg2()//
-
-delimiter ;//
-drop procedure wg2;
-
-#
-# Bug #12979 Stored procedures: crash if inout decimal parameter
-# (not a SP bug in fact)
-#
-
-select cast(@non_existing_user_var/2 as DECIMAL);
-
-#
-# Bug #13667 (Inconsistency for decimal(m,d) specification
-#
---error 1427
-create table t (d decimal(0,10));
-
-#
-# Bug #14268 (bad FLOAT->DECIMAL conversion)
-#
-
-CREATE TABLE t1 (
- my_float FLOAT,
- my_double DOUBLE,
- my_varchar VARCHAR(50),
- my_decimal DECIMAL(65,30)
-);
-SHOW CREATE TABLE t1;
-
-let $max_power= 32;
-while ($max_power)
-{
- eval INSERT INTO t1 SET my_float = 1.175494345e-$max_power,
- my_double = 1.175494345e-$max_power,
- my_varchar = '1.175494345e-$max_power';
- dec $max_power;
-}
-SELECT my_float, my_double, my_varchar FROM t1;
-
-# The following statement produces results with garbage past
-# the significant digits. Improving it is a part of the WL#3977.
-SELECT CAST(my_float AS DECIMAL(65,30)), my_float FROM t1;
-SELECT CAST(my_double AS DECIMAL(65,30)), my_double FROM t1;
-SELECT CAST(my_varchar AS DECIMAL(65,30)), my_varchar FROM t1;
-
-# We have to disable warnings here as the test in
-# Field_new_decimal::store(double):
-# if (nr2 != nr)
-# fails randomly depending on compiler options
-
---disable_warnings
-UPDATE t1 SET my_decimal = my_float;
-
-# Expected result 0.000000000011754943372854760000
-# On windows we get 0.000000000011754943372854770000
-# use replace_result to correct it
---replace_result 0.000000000011754943372854770000 0.000000000011754943372854760000
-SELECT my_decimal, my_float FROM t1;
-
-UPDATE t1 SET my_decimal = my_double;
---sorted_result
-SELECT my_decimal, my_double FROM t1;
---enable_warnings
---disable_warnings # PBXT The rows updated keeps changing
-UPDATE t1 SET my_decimal = my_varchar;
---enable_warnings # PBXT The rows updated keeps changing
---sorted_result
-SELECT my_decimal, my_varchar FROM t1;
-
-DROP TABLE t1;
-
-#
-# Bug #13573 (Wrong data inserted for too big values)
-#
-
-create table t1 (c1 decimal(64));
---disable_ps_protocol
-insert into t1 values(
-89000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);
---error ER_DATA_OUT_OF_RANGE
-insert into t1 values(
-99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 *
-99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999);
---enable_ps_protocol
-insert into t1 values(1e100);
-select * from t1;
-drop table t1;
-
-#
-# Bug #18014: problem with 'alter table'
-#
-
-create table t1(a decimal(7,2));
-insert into t1 values(123.12);
-select * from t1;
-alter table t1 modify a decimal(10,2);
-select * from t1;
-drop table t1;
-
-#
-# Bug#19667 group by a decimal expression yields wrong result
-#
-create table t1 (i int, j int);
-insert into t1 values (1,1), (1,2), (2,3), (2,4);
-select i, count(distinct j) from t1 group by i;
-select i+0.0 as i2, count(distinct j) from t1 group by i2;
-drop table t1;
-
-create table t1(f1 decimal(20,6));
-insert into t1 values (CAST('10:11:12' AS date) + interval 14 microsecond);
-insert into t1 values (CAST('10:11:12' AS time));
-select * from t1;
-drop table t1;
-
-#
-# Bug#16172 DECIMAL data type processed incorrectly
-#
-select cast(143.481 as decimal(4,1));
-select cast(143.481 as decimal(4,0));
-select cast(143.481 as decimal(2,1));
-select cast(-3.4 as decimal(2,1));
-select cast(99.6 as decimal(2,0));
-select cast(-13.4 as decimal(2,1));
-select cast(98.6 as decimal(2,0));
-
-# Bug #8663 (cant use bigint as input to CAST)
-#
-select cast(19999999999999999999 as unsigned);
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/type_ranges.test b/mysql-test/suite/pbxt/t/type_ranges.test
deleted file mode 100644
index e1a06bb047e..00000000000
--- a/mysql-test/suite/pbxt/t/type_ranges.test
+++ /dev/null
@@ -1,179 +0,0 @@
-#
-# Test ranges for all types and some other basic tests
-#
-
---disable_warnings
-drop table if exists t1,t2,t3;
---enable_warnings
-SET SQL_WARNINGS=1;
-
-CREATE TABLE t1 (
- auto int(5) unsigned NOT NULL auto_increment,
- string char(10) default "hello",
- tiny tinyint(4) DEFAULT '0' NOT NULL ,
- short smallint(6) DEFAULT '1' NOT NULL ,
- medium mediumint(8) DEFAULT '0' NOT NULL,
- long_int int(11) DEFAULT '0' NOT NULL,
- longlong bigint(13) DEFAULT '0' NOT NULL,
- real_float float(13,1) DEFAULT 0.0 NOT NULL,
- real_double double(16,4),
- utiny tinyint(3) unsigned DEFAULT '0' NOT NULL,
- ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL,
- umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
- ulong int(11) unsigned DEFAULT '0' NOT NULL,
- ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
- time_stamp timestamp,
- date_field date,
- time_field time,
- date_time datetime,
- blob_col blob,
- tinyblob_col tinyblob,
- mediumblob_col mediumblob not null default '',
- longblob_col longblob not null default '',
- options enum('one','two','tree') not null ,
- flags set('one','two','tree') not null default '',
- PRIMARY KEY (auto),
- KEY (utiny),
- KEY (tiny),
- KEY (short),
- KEY any_name (medium),
- KEY (longlong),
- KEY (real_float),
- KEY (ushort),
- KEY (umedium),
- KEY (ulong),
- KEY (ulonglong,ulong),
- KEY (options,flags)
-);
-
-# We mask out the Privileges column because it differs with embedded server
---replace_column 8 #
-show full fields from t1;
-show keys from t1;
-
-CREATE UNIQUE INDEX test on t1 ( auto ) ;
-CREATE INDEX test2 on t1 ( ulonglong,ulong) ;
-CREATE INDEX test3 on t1 ( medium ) ;
-DROP INDEX test ON t1;
-
-insert into t1 values (10, 1,1,1,1,1,1,1,1,1,1,1,1,1,NULL,0,0,0,1,1,1,1,'one','one');
-insert into t1 values (NULL,2,2,2,2,2,2,2,2,2,2,2,2,2,NULL,NULL,NULL,NULL,NULL,NULL,2,2,'two','two,one');
-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);
-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");
-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);
-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;
-
-
-ALTER TABLE t1
-add new_field char(10) default "new" not null,
-change blob_col new_blob_col varchar(20),
-change date_field date_field char(10),
-alter column string set default "newdefault",
-alter short drop default,
-DROP INDEX utiny,
-DROP INDEX ushort,
-DROP PRIMARY KEY,
-DROP FOREIGN KEY any_name,
-ADD INDEX (auto);
-
-LOCK TABLES t1 WRITE;
-ALTER TABLE t1
-RENAME as t2,
-DROP longblob_col;
-UNLOCK TABLES;
-
-ALTER TABLE t2 rename as t3;
-LOCK TABLES t3 WRITE ;
-ALTER TABLE t3 rename as t1;
-UNLOCK TABLES;
-
-select auto,new_field,new_blob_col,date_field from t1 ;
-
-#
-# check with old syntax
-#
-CREATE TABLE t2 (
- auto int(5) unsigned NOT NULL auto_increment,
- string char(20),
- mediumblob_col mediumblob not null,
- new_field char(2),
- PRIMARY KEY (auto)
-);
-
-INSERT INTO t2 (string,mediumblob_col,new_field) SELECT string,mediumblob_col,new_field from t1 where auto > 10;
-
-select * from t2;
-
-# test enums
-select distinct flags from t1;
-select flags from t1 where find_in_set("two",flags)>0;
-select flags from t1 where find_in_set("unknown",flags)>0;
-select options,flags from t1 where options="ONE" and flags="ONE";
-select options,flags from t1 where options="one" and flags="one";
-
-drop table t2;
-
-#
-# Check CREATE ... SELECT
-#
-
-create table t2 select * from t1;
-update t2 set string="changed" where auto=16;
-# We mask out the Privileges column because it differs with embedded server
---replace_column 8 #
-show full columns from t1;
---replace_column 8 #
-show full columns from t2;
-select t1.auto,t2.auto from t1,t2 where t1.auto=t2.auto and ((t1.string<>t2.string and (t1.string is not null or t2.string is not null)) or (t1.tiny<>t2.tiny and (t1.tiny is not null or t2.tiny is not null)) or (t1.short<>t2.short and (t1.short is not null or t2.short is not null)) or (t1.medium<>t2.medium and (t1.medium is not null or t2.medium is not null)) or (t1.long_int<>t2.long_int and (t1.long_int is not null or t2.long_int is not null)) or (t1.longlong<>t2.longlong and (t1.longlong is not null or t2.longlong is not null)) or (t1.real_float<>t2.real_float and (t1.real_float is not null or t2.real_float is not null)) or (t1.real_double<>t2.real_double and (t1.real_double is not null or t2.real_double is not null)) or (t1.utiny<>t2.utiny and (t1.utiny is not null or t2.utiny is not null)) or (t1.ushort<>t2.ushort and (t1.ushort is not null or t2.ushort is not null)) or (t1.umedium<>t2.umedium and (t1.umedium is not null or t2.umedium is not null)) or (t1.ulong<>t2.ulong and (t1.ulong is not null or t2.ulong is not null)) or (t1.ulonglong<>t2.ulonglong and (t1.ulonglong is not null or t2.ulonglong is not null)) or (t1.time_stamp<>t2.time_stamp and (t1.time_stamp is not null or t2.time_stamp is not null)) or (t1.date_field<>t2.date_field and (t1.date_field is not null or t2.date_field is not null)) or (t1.time_field<>t2.time_field and (t1.time_field is not null or t2.time_field is not null)) or (t1.date_time<>t2.date_time and (t1.date_time is not null or t2.date_time is not null)) or (t1.new_blob_col<>t2.new_blob_col and (t1.new_blob_col is not null or t2.new_blob_col is not null)) or (t1.tinyblob_col<>t2.tinyblob_col and (t1.tinyblob_col is not null or t2.tinyblob_col is not null)) or (t1.mediumblob_col<>t2.mediumblob_col and (t1.mediumblob_col is not null or t2.mediumblob_col is not null)) or (t1.options<>t2.options and (t1.options is not null or t2.options is not null)) or (t1.flags<>t2.flags and (t1.flags is not null or t2.flags is not null)) or (t1.new_field<>t2.new_field and (t1.new_field is not null or t2.new_field is not null)));
-select t1.auto,t2.auto from t1,t2 where t1.auto=t2.auto and not (t1.string<=>t2.string and t1.tiny<=>t2.tiny and t1.short<=>t2.short and t1.medium<=>t2.medium and t1.long_int<=>t2.long_int and t1.longlong<=>t2.longlong and t1.real_float<=>t2.real_float and t1.real_double<=>t2.real_double and t1.utiny<=>t2.utiny and t1.ushort<=>t2.ushort and t1.umedium<=>t2.umedium and t1.ulong<=>t2.ulong and t1.ulonglong<=>t2.ulonglong and t1.time_stamp<=>t2.time_stamp and t1.date_field<=>t2.date_field and t1.time_field<=>t2.time_field and t1.date_time<=>t2.date_time and t1.new_blob_col<=>t2.new_blob_col and t1.tinyblob_col<=>t2.tinyblob_col and t1.mediumblob_col<=>t2.mediumblob_col and t1.options<=>t2.options and t1.flags<=>t2.flags and t1.new_field<=>t2.new_field);
-
-drop table t2;
-
-create table t2 (primary key (auto)) select auto+1 as auto,1 as t1, 'a' as t2, repeat('a',256) as t3, binary repeat('b',256) as t4, repeat('a',4096) as t5, binary repeat('b',4096) as t6, '' as t7, binary '' as t8 from t1;
-# We mask out the Privileges column because it differs with embedded server
---replace_column 8 #
-show full columns from t2;
-select t1,t2,length(t3),length(t4),length(t5),length(t6),t7,t8 from t2;
-drop table t1,t2;
-
-create table t1 (c int);
-insert into t1 values(1),(2);
-create table t2 select * from t1;
---error 1060
-create table t3 select * from t1, t2; # Should give an error
-create table t3 select t1.c AS c1, t2.c AS c2,1 as "const" from t1, t2;
-# We mask out the Privileges column because it differs with embedded server
---replace_column 8 #
-show full columns from t3;
-drop table t1,t2,t3;
-
-create table t1 ( myfield INT NOT NULL, UNIQUE INDEX (myfield), unique (myfield), index(myfield));
-drop table t1;
-
-create table t1 ( id integer unsigned not null primary key );
-create table t2 ( id integer unsigned not null primary key );
-insert into t1 values (1), (2);
-insert into t2 values (1);
-select t1.id as id_A, t2.id as id_B from t1 left join t2 using ( id );
-select t1.id as id_A, t2.id as id_B from t1 left join t2 on (t1.id = t2.id);
-create table t3 (id_A integer unsigned not null, id_B integer unsigned null );
-insert into t3 select t1.id as id_A, t2.id as id_B from t1 left join t2 using ( id );
-select * from t3;
-truncate table t3;
-insert into t3 select t1.id as id_A, t2.id as id_B from t1 left join t2 on (t1.id = t2.id);
-select * from t3;
-drop table t3;
-create table t3 select t1.id as id_A, t2.id as id_B from t1 left join t2 using ( id );
-select * from t3;
-drop table t3;
-create table t3 select t1.id as id_A, t2.id as id_B from t1 left join t2 on (t1.id = t2.id);
-select * from t3;
-drop table t1,t2,t3;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/type_set.test b/mysql-test/suite/pbxt/t/type_set.test
deleted file mode 100644
index b77ef42c5a2..00000000000
--- a/mysql-test/suite/pbxt/t/type_set.test
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# Test of SET with space
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (a set (' ','a','b') not null);
-show create table t1;
-drop table t1;
-create table t1 (a set (' ','a','b ') not null default 'b ');
-show create table t1;
-drop table t1;
-CREATE TABLE t1 ( user varchar(64) NOT NULL default '', path varchar(255) NOT NULL default '', privilege set('select','RESERVED30','RESERVED29','RESERVED28','RESERVED27','RESERVED26', 'RESERVED25','RESERVED24','data.delete','RESERVED22','RESERVED21', 'RESERVED20','data.insert.none','data.insert.approve', 'data.insert.delete','data.insert.move','data.insert.propose', 'data.insert.reject','RESERVED13','RESERVED12','RESERVED11','RESERVED10', 'RESERVED09','data.update','RESERVED07','RESERVED06','RESERVED05', 'RESERVED04','metadata.delete','metadata.put','RESERVED01','RESERVED00') NOT NULL default '', KEY user (user) ) ENGINE=MyISAM CHARSET=utf8;
-DROP TABLE t1;
-
-#
-# Check that SET is case sensitive with a binary collation
-#
-set names latin1;
-create table t1 (s set ('a','A') character set latin1 collate latin1_bin);
-show create table t1;
-insert into t1 values ('a'),('a,A'),('A,a'),('A');
-select s from t1 order by s;
-select s from t1 order by concat(s);
-drop table t1;
-
-#
-# Check that SET honors a more complex collation correctly
-#
-CREATE TABLE t1 (c set('ae','oe','ue','ss') collate latin1_german2_ci);
-INSERT INTO t1 VALUES (''),(''),(''),('');
-INSERT INTO t1 VALUES ('ae'),('oe'),('ue'),('ss');
-INSERT INTO t1 VALUES (',,,');
-INSERT INTO t1 VALUES ('ae,oe,ue,ss');
-SELECT c FROM t1 ORDER BY c;
-SELECT c FROM t1 ORDER BY concat(c);
-DROP TABLE t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/type_time.test b/mysql-test/suite/pbxt/t/type_time.test
deleted file mode 100644
index 7b11a754845..00000000000
--- a/mysql-test/suite/pbxt/t/type_time.test
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# testing of the TIME column type
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (t time);
-insert into t1 values("10:22:33"),("12:34:56.78"),(10),(1234),(123456.78),(1234559.99),("1"),("1:23"),("1:23:45"), ("10.22"), ("-10 1:22:33.45"),("20 10:22:33"),("1999-02-03 20:33:34");
-insert t1 values (30),(1230),("1230"),("12:30"),("12:30:35"),("1 12:30:31.32");
-select * from t1;
-# Test wrong values
-insert into t1 values("10.22.22"),(1234567),(123456789),(123456789.10),("10 22:22"),("12.45a");
-select * from t1;
-drop table t1;
-
-create table t1 (t time);
-insert into t1 values ('09:00:00'),('13:00:00'),('19:38:34'), ('13:00:00'),('09:00:00'),('09:00:00'),('13:00:00'),('13:00:00'),('13:00:00'),('09:00:00');
-select t, time_to_sec(t),sec_to_time(time_to_sec(t)) from t1;
-select sec_to_time(time_to_sec(t)) from t1;
-drop table t1;
-
-#
-# BUG #12440: Incorrect processing of time values containing
-# long fraction part and/or large exponent part.
-#
-# These must return normal result:
-# ##########################################################
-# To be uncommented after fix BUG #15805
-# ##########################################################
-# SELECT CAST(235959.123456 AS TIME);
-# SELECT CAST(0.235959123456e+6 AS TIME);
-# SELECT CAST(235959123456e-6 AS TIME);
-# These must cut fraction part and produce warning:
-# SELECT CAST(235959.1234567 AS TIME);
-# SELECT CAST(0.2359591234567e6 AS TIME);
-# This must return NULL and produce warning:
-# SELECT CAST(0.2359591234567e+30 AS TIME);
-# ##########################################################
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/type_timestamp.test b/mysql-test/suite/pbxt/t/type_timestamp.test
deleted file mode 100644
index 65659b2acca..00000000000
--- a/mysql-test/suite/pbxt/t/type_timestamp.test
+++ /dev/null
@@ -1,334 +0,0 @@
-#
-# Test timestamp
-#
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-# Set timezone to GMT-3, to make it possible to use "interval 3 hour"
-set time_zone="+03:00";
-
-CREATE TABLE t1 (a int, t timestamp);
-CREATE TABLE t2 (a int, t datetime);
-SET TIMESTAMP=1234;
-insert into t1 values(1,NULL);
-insert into t1 values(2,"2002-03-03");
-SET TIMESTAMP=1235;
-insert into t1 values(3,NULL);
-SET TIMESTAMP=1236;
-insert into t1 (a) values(4);
-insert into t2 values(5,"2002-03-04"),(6,NULL),(7,"2002-03-05"),(8,"00-00-00");
-SET TIMESTAMP=1237;
-insert into t1 select * from t2;
-SET TIMESTAMP=1238;
-insert into t1 (a) select a+1 from t2 where a=8;
-select * from t1;
-drop table t1,t2;
-
-SET TIMESTAMP=1234;
-CREATE TABLE t1 (value TEXT NOT NULL, id VARCHAR(32) NOT NULL, stamp timestamp, PRIMARY KEY (id));
-INSERT INTO t1 VALUES ("my value", "myKey","1999-04-02 00:00:00");
-SELECT stamp FROM t1 WHERE id="myKey";
-UPDATE t1 SET value="my value" WHERE id="myKey";
-SELECT stamp FROM t1 WHERE id="myKey";
-UPDATE t1 SET id="myKey" WHERE value="my value";
-SELECT stamp FROM t1 WHERE id="myKey";
-drop table t1;
-
-create table t1 (a timestamp);
-insert into t1 values (now());
-select date_format(a,"%Y %y"),year(a),year(now()) from t1;
-drop table t1;
-
-create table t1 (ix timestamp);
-insert into t1 values (19991101000000),(19990102030405),(19990630232922),(19990601000000),(19990930232922),(19990531232922),(19990501000000),(19991101000000),(19990501000000);
-select ix+0 from t1;
-truncate table t1;
-insert into t1 values ("19991101000000"),("19990102030405"),("19990630232922"),("19990601000000");
-select ix+0 from t1;
-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);
-INSERT INTO t1 VALUES ("1999-01-01","1999-01-01 00:00:00",19990101000000);
-INSERT INTO t1 VALUES ("1999-09-09","1999-09-09 23:59:59",19990909235959);
-INSERT INTO t1 VALUES ("2000-01-01","2000-01-01 00:00:00",20000101000000);
-INSERT INTO t1 VALUES ("2000-02-28","2000-02-28 00:00:00",20000228000000);
-INSERT INTO t1 VALUES ("2000-02-29","2000-02-29 00:00:00",20000229000000);
-INSERT INTO t1 VALUES ("2000-03-01","2000-03-01 00:00:00",20000301000000);
-INSERT INTO t1 VALUES ("2000-12-31","2000-12-31 23:59:59",20001231235959);
-INSERT INTO t1 VALUES ("2001-01-01","2001-01-01 00:00:00",20010101000000);
-INSERT INTO t1 VALUES ("2004-12-31","2004-12-31 23:59:59",20041231235959);
-INSERT INTO t1 VALUES ("2005-01-01","2005-01-01 00:00:00",20050101000000);
-INSERT INTO t1 VALUES ("2030-01-01","2030-01-01 00:00:00",20300101000000);
-# The following will get you an different answer on 64 bit machines
-#INSERT INTO t1 VALUES ("2050-01-01","2050-01-01 00:00:00",20500101000000);
-SELECT * FROM t1;
-drop table t1;
-
-#
-# Let us check if we properly treat wrong datetimes and produce proper warnings
-# (for both strings and numbers)
-#
-create table t1 (ix timestamp);
-insert into t1 values (0),(20030101010160),(20030101016001),(20030101240101),(20030132010101),(20031301010101),(20031200000000),(20030000000000);
-select ix+0 from t1;
-truncate table t1;
-insert into t1 values ("00000000000000"),("20030101010160"),("20030101016001"),("20030101240101"),("20030132010101"),("20031301010101"),("20031200000000"),("20030000000000");
-select ix+0 from t1;
-truncate table t1;
-insert into t1 values ("0000-00-00 00:00:00 some trailer"),("2003-01-01 00:00:00 some trailer");
-select ix+0 from t1;
-drop table t1;
-
-#
-# Test for TIMESTAMP column with default now() and on update now() clauses
-#
-
-# These statements should fail.
---error 1293
-create table t1 (t1 timestamp, t2 timestamp default now());
---error 1293
-create table t1 (t1 timestamp, t2 timestamp on update now());
---error 1293
-create table t1 (t1 timestamp, t2 timestamp default now() on update now());
---error 1293
-create table t1 (t1 timestamp default now(), t2 timestamp on update now());
---error 1293
-create table t1 (t1 timestamp on update now(), t2 timestamp default now() on update now());
-
-# Let us test TIMESTAMP auto-update behaviour
-# Also we will test behaviour of TIMESTAMP field in SHOW CREATE TABLE and
-# behaviour of DEFAULT literal for such fields
-create table t1 (t1 timestamp default '2003-01-01 00:00:00', t2 datetime, t3 timestamp);
-SET TIMESTAMP=1000000000;
-insert into t1 values ();
-SET TIMESTAMP=1000000001;
-update t1 set t2=now();
-SET TIMESTAMP=1000000002;
-insert into t1 (t1,t3) values (default, default);
-select * from t1 order by t2; # PBXT: Order for consistent result
-show create table t1;
-show columns from t1;
-drop table t1;
-
-create table t1 (t1 timestamp default now(), t2 datetime, t3 timestamp);
-SET TIMESTAMP=1000000002;
-insert into t1 values ();
-SET TIMESTAMP=1000000003;
-update t1 set t2=now();
-SET TIMESTAMP=1000000003;
-insert into t1 (t1,t3) values (default, default);
-select * from t1 order by t1; # PBXT: Order for consistent result
-show create table t1;
-show columns from t1;
-drop table t1;
-
-create table t1 (t1 timestamp default '2003-01-01 00:00:00' on update now(), t2 datetime);
-SET TIMESTAMP=1000000004;
-insert into t1 values ();
-select * from t1;
-SET TIMESTAMP=1000000005;
-update t1 set t2=now();
-SET TIMESTAMP=1000000005;
-insert into t1 (t1) values (default);
-select * from t1 order by t1; # PBXT: Order for consistent result
-show create table t1;
-show columns from t1;
-drop table t1;
-
-create table t1 (t1 timestamp default now() on update now(), t2 datetime);
-SET TIMESTAMP=1000000006;
-insert into t1 values ();
-select * from t1;
-SET TIMESTAMP=1000000007;
-update t1 set t2=now();
-SET TIMESTAMP=1000000007;
-insert into t1 (t1) values (default);
-select * from t1 order by t2; # PBXT: Order for consistent result
-show create table t1;
-show columns from t1;
-drop table t1;
-
-create table t1 (t1 timestamp, t2 datetime, t3 timestamp);
-SET TIMESTAMP=1000000007;
-insert into t1 values ();
-select * from t1;
-SET TIMESTAMP=1000000008;
-update t1 set t2=now();
-SET TIMESTAMP=1000000008;
-insert into t1 (t1,t3) values (default, default);
-select * from t1 order by t2; # PBXT: Order for consistent result
-show create table t1;
-show columns from t1;
-drop table t1;
-
-# Let us test if CURRENT_TIMESTAMP also works well as default value
-# (Of course NOW and CURRENT_TIMESTAMP are same for parser but still just
-# for demonstartion.)
-create table t1 (t1 timestamp default current_timestamp on update current_timestamp, t2 datetime);
-SET TIMESTAMP=1000000009;
-insert into t1 values ();
-select * from t1;
-SET TIMESTAMP=1000000010;
-update t1 set t2=now();
-SET TIMESTAMP=1000000011;
-insert into t1 (t1) values (default);
-select * from t1 order by t1; # PBXT: Order for consistent result
-show create table t1;
-show columns from t1;
-truncate table t1;
-
-#
-# Let us test some cases when auto-set should be disabled or influence
-# on server behavior in some other way.
-#
-
-# Update statement that explicitly sets field should not auto-set it.
-insert into t1 values ('2004-04-01 00:00:00', '2004-04-01 00:00:00');
-SET TIMESTAMP=1000000012;
-update t1 set t1= '2004-04-02 00:00:00';
-select * from t1;
-# The same for multi updates
-update t1 as ta, t1 as tb set tb.t1= '2004-04-03 00:00:00';
-select * from t1;
-drop table t1;
-
-# Now let us test replace it should behave exactly like delete+insert
-# Case where optimization is possible DEFAULT = ON UPDATE
-create table t1 (pk int primary key, t1 timestamp default current_timestamp on update current_timestamp, bulk int);
-insert into t1 values (1, '2004-04-01 00:00:00', 10);
-SET TIMESTAMP=1000000013;
-replace into t1 set pk = 1, bulk= 20;
-select * from t1;
-drop table t1;
-# Case in which there should not be optimisation
-create table t1 (pk int primary key, t1 timestamp default '2003-01-01 00:00:00' on update current_timestamp, bulk int);
-insert into t1 values (1, '2004-04-01 00:00:00', 10);
-SET TIMESTAMP=1000000014;
-replace into t1 set pk = 1, bulk= 20;
-select * from t1;
-drop table t1;
-# Other similar case
-create table t1 (pk int primary key, t1 timestamp default current_timestamp, bulk int);
-insert into t1 values (1, '2004-04-01 00:00:00', 10);
-SET TIMESTAMP=1000000015;
-replace into t1 set pk = 1, bulk= 20;
-select * from t1;
-drop table t1;
-
-# Let us test alter now
-create table t1 (t1 timestamp default current_timestamp on update current_timestamp);
-insert into t1 values ('2004-04-01 00:00:00');
-SET TIMESTAMP=1000000016;
-alter table t1 add i int default 10;
-select * from t1;
-drop table t1;
-
-#
-# Test for TIMESTAMP columns which are able to store NULLs
-#
-
-# Unlike for default TIMESTAMP fields we don't interpret first field
-# in this table as TIMESTAMP with DEFAULT NOW() ON UPDATE NOW() properties.
-create table t1 (a timestamp null, b timestamp null);
-show create table t1;
-insert into t1 values (NULL, NULL);
-SET TIMESTAMP=1000000017;
-insert into t1 values ();
-select * from t1;
-drop table t1;
-
-# But explicit auto-set properties still should be OK.
-create table t1 (a timestamp null default current_timestamp on update current_timestamp, b timestamp null);
-show create table t1;
-insert into t1 values (NULL, NULL);
-SET TIMESTAMP=1000000018;
-insert into t1 values ();
-select * from t1;
-drop table t1;
-
-# It is also OK to specify NULL as default explicitly for such fields.
-# This is also a test for bug #2464, DEFAULT keyword in INSERT statement
-# should return default value for column.
-
-create table t1 (a timestamp null default null, b timestamp null default '2003-01-01 00:00:00');
-show create table t1;
-insert into t1 values (NULL, NULL);
-insert into t1 values (DEFAULT, DEFAULT);
-select * from t1;
-drop table t1;
-
-#
-# Let us test behavior of ALTER TABLE when it converts columns
-# containing NULL to TIMESTAMP columns.
-#
-create table t1 (a bigint, b bigint);
-insert into t1 values (NULL, NULL), (20030101000000, 20030102000000);
-set timestamp=1000000019;
-alter table t1 modify a timestamp, modify b timestamp;
-select * from t1;
-drop table t1;
-
-#
-# Test for bug #4131, TIMESTAMP columns missing minutes and seconds when
-# using GROUP BY in @@new=1 mode.
-#
-create table t1 (a char(2), t timestamp);
-insert into t1 values ('a', '2004-01-01 00:00:00'), ('a', '2004-01-01 01:00:00'),
- ('b', '2004-02-01 00:00:00');
-select max(t) from t1 group by a;
-drop table t1;
-
-#
-# Test for bug #7418 "TIMESTAMP not always converted to DATETIME in MAXDB
-# mode". TIMESTAMP columns should be converted DATETIME columns in MAXDB
-# mode regardless of whether a display width is given.
-#
-set sql_mode='maxdb';
-create table t1 (a timestamp, b timestamp(5));
-show create table t1;
-# restore default mode
-set sql_mode='';
-drop table t1;
-
-#
-# Bug#7806 - insert on duplicate key and auto-update of timestamp
-#
-create table t1 (a int auto_increment primary key, b int, c timestamp);
-insert into t1 (a, b, c) values (1, 0, '2001-01-01 01:01:01'),
- (2, 0, '2002-02-02 02:02:02'), (3, 0, '2003-03-03 03:03:03');
-select * from t1;
-update t1 set b = 2, c = c where a = 2;
-select * from t1;
-insert into t1 (a) values (4);
-select * from t1 order by a; # PBXT: Order for consistent result
-update t1 set c = '2004-04-04 04:04:04' where a = 4;
-select * from t1 order by a; # PBXT required order for consistent result
-insert into t1 (a) values (3), (5) on duplicate key update b = 3, c = c;
-select * from t1 order by a; # PBXT: Order for consistent result
-insert into t1 (a, c) values (4, '2004-04-04 00:00:00'),
- (6, '2006-06-06 06:06:06') on duplicate key update b = 4;
-select * from t1 order by a; # PBXT: Order for consistent result
-drop table t1;
-
-# End of 4.1 tests
-
-# Restore timezone to default
-set time_zone= @@global.time_zone;
-
-CREATE TABLE t1 (
-`id` int(11) NOT NULL auto_increment,
-`username` varchar(80) NOT NULL default '',
-`posted_on` timestamp NOT NULL default '0000-00-00 00:00:00',
-PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
-
-show fields from t1;
-select is_nullable from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='t1' and COLUMN_NAME='posted_on';
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/type_uint.test b/mysql-test/suite/pbxt/t/type_uint.test
deleted file mode 100644
index a9ee2a94a1a..00000000000
--- a/mysql-test/suite/pbxt/t/type_uint.test
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# test of unsigned int
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-SET SQL_WARNINGS=1;
-
-create table t1 (this int unsigned);
-insert into t1 values (1);
-insert into t1 values (-1);
-insert into t1 values ('5000000000');
-select * from t1;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/type_year.test b/mysql-test/suite/pbxt/t/type_year.test
deleted file mode 100644
index 1a5fb9f082b..00000000000
--- a/mysql-test/suite/pbxt/t/type_year.test
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# Test year
-#
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (y year,y2 year(2));
-insert into t1 values (0,0),(1999,1999),(2000,2000),(2001,2001),(70,70),(69,69);
-select * from t1;
-select * from t1 order by y;
-select * from t1 order by y2;
-drop table t1;
-
-#
-# Bug 2335
-#
-
-create table t1 (y year);
-insert into t1 values (now());
-select if(y = now(), 1, 0) from t1;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/udf.test b/mysql-test/suite/pbxt/t/udf.test
deleted file mode 100644
index 97c2cf8acb4..00000000000
--- a/mysql-test/suite/pbxt/t/udf.test
+++ /dev/null
@@ -1,444 +0,0 @@
---source include/have_udf.inc
-#
-# To run this tests the "sql/udf_example.c" need to be compiled into
-# udf_example.so and LD_LIBRARY_PATH should be setup to point out where
-# the library are.
-#
-
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-#
-# Create the example functions from udf_example
-#
-
---replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
-eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
---replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
-eval CREATE FUNCTION myfunc_double RETURNS REAL SONAME "$UDF_EXAMPLE_SO";
-
---replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
---error ER_CANT_FIND_DL_ENTRY
-eval CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
---replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
-eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
---replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
-eval CREATE FUNCTION sequence RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
---replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
-eval CREATE FUNCTION lookup RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
---replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
-eval CREATE FUNCTION reverse_lookup
- RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
---replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
-eval CREATE AGGREGATE FUNCTION avgcost
- RETURNS REAL SONAME "$UDF_EXAMPLE_SO";
-
---error ER_CANT_INITIALIZE_UDF
-select myfunc_double();
-select myfunc_double(1);
-select myfunc_double(78654);
---error 1305
-select myfunc_nonexist();
-select myfunc_int();
---error ER_CANT_INITIALIZE_UDF
-select lookup();
-select lookup("127.0.0.1");
---error ER_CANT_INITIALIZE_UDF
-select lookup(127,0,0,1);
-select lookup("localhost");
---error ER_CANT_INITIALIZE_UDF
-select reverse_lookup();
-
-# These two functions should return "localhost", but it's
-# depending on configuration, so just call them and don't log the result
---disable_result_log
-select reverse_lookup("127.0.0.1");
-select reverse_lookup(127,0,0,1);
---enable_result_log
-
-select reverse_lookup("localhost");
---error ER_CANT_INITIALIZE_UDF
-select avgcost();
---error ER_CANT_INITIALIZE_UDF
-select avgcost(100,23.76);
-create table t1(sum int, price float(24));
-insert into t1 values(100, 50.00), (100, 100.00);
-select avgcost(sum, price) from t1;
-delete from t1;
-insert into t1 values(100, 54.33), (200, 199.99);
-select avgcost(sum, price) from t1;
-drop table t1;
-
-#------------------------------------------------------------------------
-# BUG#17261 Passing a variable from a stored procedure to UDF crashes mysqld
-#------------------------------------------------------------------------
-
-select metaphon('hello');
-
-delimiter //;
-CREATE PROCEDURE `XXX1`(in testval varchar(10))
-begin
-select metaphon(testval);
-end//
-delimiter ;//
-
-call XXX1('hello');
-drop procedure xxx1;
-
-delimiter //;
-CREATE PROCEDURE `XXX2`()
-begin
-declare testval varchar(10);
-set testval = 'hello';
-select metaphon(testval);
-end//
-delimiter ;//
-
-call XXX2();
-drop procedure xxx2;
-
-#
-# Bug#19904: UDF: not initialized *is_null per row
-#
-
-CREATE TABLE bug19904(n INT, v varchar(10));
-INSERT INTO bug19904 VALUES (1,'one'),(2,'two'),(NULL,NULL),(3,'three'),(4,'four');
-SELECT myfunc_double(n) AS f FROM bug19904;
-SELECT metaphon(v) AS f FROM bug19904;
-DROP TABLE bug19904;
-
-#
-# Bug#21269: DEFINER-clause is allowed for UDF-functions
-#
-
---error ER_PARSE_ERROR
-CREATE DEFINER=CURRENT_USER() FUNCTION should_not_parse
-RETURNS STRING SONAME "should_not_parse.so";
-
---error ER_PARSE_ERROR
-CREATE DEFINER=someone@somewhere FUNCTION should_not_parse
-RETURNS STRING SONAME "should_not_parse.so";
-#
-# Bug#19862: Sort with filesort by function evaluates function twice
-#
-create table t1(f1 int);
-insert into t1 values(1),(2);
-explain select myfunc_int(f1) from t1 order by 1;
-drop table t1;
-
-#
-# Bug #21809: Error 1356 while selecting from view with grouping though
-# underlying select OK.
-#
-CREATE TABLE t1(a INT, b INT); INSERT INTO t1 values (1,1),(2,2);
-
-DELIMITER ||;
-CREATE FUNCTION fn(a int) RETURNS int DETERMINISTIC
-BEGIN
- RETURN a;
-END
-||
-DELIMITER ;||
-
-CREATE VIEW v1 AS SELECT a, fn(MIN(b)) as c FROM t1 GROUP BY a;
-
-SELECT myfunc_int(a AS attr_name) FROM t1;
-EXPLAIN EXTENDED SELECT myfunc_int(a AS attr_name) FROM t1;
-EXPLAIN EXTENDED SELECT myfunc_int(a) FROM t1;
-SELECT a,c FROM v1;
-
---error ER_WRONG_PARAMETERS_TO_STORED_FCT
-SELECT a, fn(MIN(b) xx) as c FROM t1 GROUP BY a;
---error ER_WRONG_PARAMETERS_TO_STORED_FCT
-SELECT myfunc_int(fn(MIN(b) xx)) as c FROM t1 GROUP BY a;
---error ER_PARSE_ERROR
-SELECT myfunc_int(test.fn(MIN(b) xx)) as c FROM t1 GROUP BY a;
-
-SELECT myfunc_int(fn(MIN(b)) xx) as c FROM t1 GROUP BY a;
-SELECT myfunc_int(test.fn(MIN(b)) xx) as c FROM t1 GROUP BY a;
-
-EXPLAIN EXTENDED SELECT myfunc_int(MIN(b) xx) as c FROM t1 GROUP BY a;
-EXPLAIN EXTENDED SELECT test.fn(MIN(b)) as c FROM t1 GROUP BY a;
-EXPLAIN EXTENDED SELECT myfunc_int(fn(MIN(b))) as c FROM t1 GROUP BY a;
-EXPLAIN EXTENDED SELECT myfunc_int(test.fn(MIN(b))) as c FROM t1 GROUP BY a;
-SELECT myfunc_int(MIN(b) xx) as c FROM t1 GROUP BY a;
-SELECT test.fn(MIN(b)) as c FROM t1 GROUP BY a;
-SELECT myfunc_int(fn(MIN(b))) as c FROM t1 GROUP BY a;
-SELECT myfunc_int(test.fn(MIN(b))) as c FROM t1 GROUP BY a;
-DROP VIEW v1;
-DROP TABLE t1;
-DROP FUNCTION fn;
-
---echo End of 5.0 tests.
-
-#
-# Bug#24736: UDF functions parsed as Stored Functions
-#
-
-select myfunc_double(3);
-select myfunc_double(3 AS three);
-select myfunc_double(abs(3));
-select myfunc_double(abs(3) AS named_param);
-select abs(myfunc_double(3));
-select abs(myfunc_double(3 AS three));
-
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select myfunc_double(abs(3 AS wrong));
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select abs(myfunc_double(3) AS wrong);
-
-#
-# BUG#18239: Possible to overload internal functions with stored functions
-#
-
---disable_warnings
-drop function if exists pi;
---enable_warnings
-
---error ER_NATIVE_FCT_NAME_COLLISION
-CREATE FUNCTION pi RETURNS STRING SONAME "should_not_parse.so";
-
-# Verify that Stored Functions and UDF are mutually exclusive
-DROP FUNCTION IF EXISTS metaphon;
-
-CREATE FUNCTION metaphon(a int) RETURNS int
-return 0;
-
-# this currently passes, and eclipse the stored function
---replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
-eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
-
-DROP FUNCTION metaphon;
-DROP FUNCTION metaphon;
-
---replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
-eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
-
---error ER_UDF_EXISTS
-CREATE FUNCTION metaphon(a int) RETURNS int
-return 0;
-
---error ER_UDF_EXISTS
-CREATE FUNCTION test.metaphon(a int) RETURNS int
-return 0;
-
-# End of Bug#18239
-
-#
-# Drop the example functions from udf_example
-#
-
-DROP FUNCTION metaphon;
-DROP FUNCTION myfunc_double;
---error ER_SP_DOES_NOT_EXIST
-DROP FUNCTION myfunc_nonexist;
-DROP FUNCTION myfunc_int;
-DROP FUNCTION sequence;
-DROP FUNCTION lookup;
-DROP FUNCTION reverse_lookup;
-DROP FUNCTION avgcost;
-
-#
-# Bug #15439: UDF name case handling forces DELETE FROM mysql.func to remove
-# the UDF
-#
-select * from mysql.func;
---replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
-eval CREATE FUNCTION is_const RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
-
-select IS_const(3);
-
-drop function IS_const;
-
-select * from mysql.func;
-
---error 1305
-select is_const(3);
-
-#
-# Bug#18761: constant expression as UDF parameters not passed in as constant
-#
---replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
-eval CREATE FUNCTION is_const RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
-
-select
- is_const(3) as const,
- is_const(3.14) as const,
- is_const('fnord') as const,
- is_const(2+3) as const,
- is_const(rand()) as 'nc rand()',
- is_const(sin(3.14)) as const,
- is_const(upper('test')) as const;
-
-create table bug18761 (n int);
-insert into bug18761 values (null),(2);
-select
- is_const(3) as const,
- is_const(3.14) as const,
- is_const('fnord') as const,
- is_const(2+3) as const,
- is_const(2+n) as 'nc 2+n ',
- is_const(sin(n)) as 'nc sin(n)',
- is_const(sin(3.14)) as const,
- is_const(upper('test')) as const,
- is_const(rand()) as 'nc rand()',
- is_const(n) as 'nc n ',
- is_const(is_const(n)) as 'nc ic?(n)',
- is_const(is_const('c')) as const
-from
- bug18761;
-drop table bug18761;
-
---error 1241
-select is_const((1,2,3));
-
-drop function if exists is_const;
-
-#
-# Bug #25382: Passing NULL to an UDF called from stored procedures
-# crashes server
-#
---replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
-eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
-
---replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
-eval CREATE FUNCTION myfunc_double RETURNS REAL SONAME "$UDF_EXAMPLE_SO";
-
---replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
-eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
-
-delimiter //;
-create function f1(p1 varchar(255))
-returns varchar(255)
-begin
- return metaphon(p1);
-end//
-
-create function f2(p1 varchar(255))
-returns double
-begin
- return myfunc_double(p1);
-end//
-
-create function f3(p1 varchar(255))
-returns double
-begin
- return myfunc_int(p1);
-end//
-
-delimiter ;//
-
-select f3(NULL);
-select f2(NULL);
-select f1(NULL);
-
-drop function f1;
-drop function f2;
-drop function f3;
-drop function metaphon;
-drop function myfunc_double;
-drop function myfunc_int;
-
-#
-# Bug #28921: Queries containing UDF functions are cached
-#
-
---replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
-eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
-create table t1 (a char);
-
-set GLOBAL query_cache_size=1355776;
-reset query cache;
-flush status;
-
-select metaphon('MySQL') from t1;
-show status like "Qcache_hits";
-show status like "Qcache_queries_in_cache";
-
-select metaphon('MySQL') from t1;
-show status like "Qcache_hits";
-show status like "Qcache_queries_in_cache";
-
-drop table t1;
-drop function metaphon;
-set GLOBAL query_cache_size=default;
-
-#
-# Bug#28318 CREATE FUNCTION (UDF) requires a schema
-#
-
---disable_warnings
-DROP DATABASE IF EXISTS mysqltest;
---enable_warnings
-CREATE DATABASE mysqltest;
-USE mysqltest;
-DROP DATABASE mysqltest;
---replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
-eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
-DROP FUNCTION metaphon;
-USE test;
-
-#
-# Bug #29804 UDF parameters don't contain correct string length
-#
-
-CREATE TABLE const_len_bug (
- str_const varchar(4000),
- result1 varchar(4000),
- result2 varchar(4000)
-);
-
-DELIMITER |;
-CREATE TRIGGER check_const_len_trigger BEFORE INSERT ON const_len_bug FOR EACH ROW BEGIN
- set NEW.str_const = 'bar';
- set NEW.result2 = check_const_len(NEW.str_const);
-END |
-
-CREATE PROCEDURE check_const_len_sp (IN str_const VARCHAR(4000))
-BEGIN
-DECLARE result VARCHAR(4000);
-SET result = check_const_len(str_const);
-insert into const_len_bug values(str_const, result, "");
-END |
-DELIMITER ;|
-
---replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
-eval CREATE FUNCTION check_const_len RETURNS string SONAME "$UDF_EXAMPLE_SO";
-
-CALL check_const_len_sp("foo");
-
-SELECT * from const_len_bug;
-
-DROP FUNCTION check_const_len;
-DROP PROCEDURE check_const_len_sp;
-DROP TRIGGER check_const_len_trigger;
-DROP TABLE const_len_bug;
-
-
-#
-# Bug #30355: Incorrect ordering of UDF results
-#
-
---replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
-eval CREATE FUNCTION sequence RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
-CREATE TABLE t1 (a INT);
-CREATE TABLE t2 (a INT PRIMARY KEY);
-INSERT INTO t1 VALUES (4),(3),(2),(1);
-INSERT INTO t2 SELECT * FROM t1;
-
-SELECT sequence() AS seq, a FROM t1 ORDER BY seq ASC;
-SELECT sequence() AS seq, a FROM t1 ORDER BY seq DESC;
-
-SELECT * FROM t1 WHERE a = sequence();
-SELECT * FROM t2 WHERE a = sequence();
-
-DROP FUNCTION sequence;
-DROP TABLE t1,t2;
-
-
---disable_query_log
-drop database pbxt;
---enable_query_log
---echo End of 5.0 tests.
diff --git a/mysql-test/suite/pbxt/t/union.test b/mysql-test/suite/pbxt/t/union.test
deleted file mode 100644
index e324d824636..00000000000
--- a/mysql-test/suite/pbxt/t/union.test
+++ /dev/null
@@ -1,923 +0,0 @@
-#
-# Test of unions
-#
-
---disable_warnings
-drop table if exists t1,t2,t3,t4,t5,t6;
---enable_warnings
-
-CREATE TABLE t1 (a int not null, b char (10) not null);
-insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
-CREATE TABLE t2 (a int not null, b char (10) not null);
-insert into t2 values (3,'c'),(4,'d'),(5,'f'),(6,'e');
-
-select a,b from t1 union distinct select a,b from t2;
-select a,b from t1 union all select a,b from t2;
-select a,b from t1 union all select a,b from t2 order by b;
-select a,b from t1 union all select a,b from t2 union select 7,'g';
-select 0,'#' union select a,b from t1 union all select a,b from t2 union select 7,'gg';
-select a,b from t1 union select a,b from t1;
-select 't1',b,count(*) from t1 group by b UNION select 't2',b,count(*) from t2 group by b;
-
-# Test alternate syntax for unions
-(select a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 4;
-(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1);
-(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc;
---error 1250
-(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by t1.b;
-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;
-(select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2;
-select found_rows();
-select sql_calc_found_rows a,b from t1 union all select a,b from t2 limit 2;
-select found_rows();
-
-#
-# Test some error conditions with UNION
-#
-
-explain select a,b from t1 union all select a,b from t2;
-
---error 1054
-explain select xx from t1 union select 1;
---error 1222
-explain select a,b from t1 union select 1;
---error 1222
-explain select 1 union select a,b from t1 union select 1;
---error 1222
-explain select a,b from t1 union select 1 limit 0;
-
---error 1221
-select a,b from t1 into outfile 'skr' union select a,b from t2;
-
---error 1221
-select a,b from t1 order by a union select a,b from t2;
-
---error 1221
-insert into t3 select a from t1 order by a union select a from t2;
-
---error 1222
-create table t3 select a,b from t1 union select a from t2;
-
---error 1222
-select a,b from t1 union select a from t2;
-
---error 1222
-select * from t1 union select a from t2;
-
---error 1222
-select a from t1 union select * from t2;
-
---error 1234
-select * from t1 union select SQL_BUFFER_RESULT * from t2;
-
-# Test CREATE, INSERT and REPLACE
-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;
-# PS can't handle REPLACE ... SELECT
-replace into t3 select a,b as c from t1 union all select a,b from t2;
-
-drop table t1,t2,t3;
-
-#
-# Test some unions without tables
-#
---error 1096
-select * union select 1;
-select 1 as a,(select a union select a);
---error 1054
-(select 1) union (select 2) order by 0;
-SELECT @a:=1 UNION SELECT @a:=@a+1;
---error 1054
-(SELECT 1) UNION (SELECT 2) ORDER BY (SELECT a);
-(SELECT 1,3) UNION (SELECT 2,1) ORDER BY (SELECT 2);
-
-#
-# Test bug reported by joc@presence-pc.com
-#
-
-CREATE TABLE t1 (
- `pseudo` char(35) NOT NULL default '',
- `pseudo1` char(35) NOT NULL default '',
- `same` tinyint(1) unsigned NOT NULL default '1',
- PRIMARY KEY (`pseudo1`),
- KEY `pseudo` (`pseudo`)
-) ENGINE=MyISAM;
-INSERT INTO t1 (pseudo,pseudo1,same) VALUES ('joce', 'testtt', 1),('joce', 'tsestset', 1),('dekad', 'joce', 1);
-SELECT pseudo FROM t1 WHERE pseudo1='joce' UNION SELECT pseudo FROM t1 WHERE pseudo='joce';
-SELECT pseudo1 FROM t1 WHERE pseudo1='joce' UNION SELECT pseudo1 FROM t1 WHERE pseudo='joce';
-SELECT * FROM t1 WHERE pseudo1='joce' UNION SELECT * FROM t1 WHERE pseudo='joce' order by pseudo desc,pseudo1 desc;
-SELECT pseudo1 FROM t1 WHERE pseudo='joce' UNION SELECT pseudo FROM t1 WHERE pseudo1='joce';
-SELECT pseudo1 FROM t1 WHERE pseudo='joce' UNION ALL SELECT pseudo FROM t1 WHERE pseudo1='joce';
-SELECT pseudo1 FROM t1 WHERE pseudo='joce' UNION SELECT 1;
-drop table t1;
-
-create table t1 (a int);
-create table t2 (a int);
-insert into t1 values (1),(2),(3),(4),(5);
-insert into t2 values (11),(12),(13),(14),(15);
-(select * from t1 limit 2) union (select * from t2 limit 3) limit 4;
-(select * from t1 limit 2) union (select * from t2 limit 3);
-(select * from t1 limit 2) union (select * from t2 limit 20,3);
-set SQL_SELECT_LIMIT=2;
-(select * from t1 limit 1) union (select * from t2 limit 3);
-set SQL_SELECT_LIMIT=DEFAULT;
-drop table t1,t2;
-
-#
-# Test error with left join
-#
-
-CREATE TABLE t1 (
- cid smallint(5) unsigned NOT NULL default '0',
- cv varchar(250) NOT NULL default '',
- PRIMARY KEY (cid),
- UNIQUE KEY cv (cv)
-) ;
-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),
- KEY cap (cap)
-) ;
-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),
- KEY gn (gn)
-) ;
-INSERT INTO t3 VALUES (1,'V1',NULL);
-CREATE TABLE t4 (
- uid bigint(20) unsigned NOT NULL default '0',
- gid bigint(20) unsigned default NULL,
- rid bigint(20) unsigned default NULL,
- cid bigint(20) unsigned default NULL,
- UNIQUE KEY m (uid,gid,rid,cid),
- KEY uid (uid),
- KEY rid (rid),
- KEY cid (cid),
- KEY container (gid,rid,cid)
-) ;
-INSERT INTO t4 VALUES (1,1,NULL,NULL);
-CREATE TABLE t5 (
- rid bigint(20) unsigned NOT NULL auto_increment,
- rl varchar(255) NOT NULL default '',
- PRIMARY KEY (rid),
- KEY rl (rl)
-) ;
-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),
- KEY un (un)
-) ;
-INSERT INTO t6 VALUES (1,'test',8);
-
-SELECT t4.uid, t5.rl, t3.gn as g1, t4.cid, t4.gid as gg FROM t3, t6, t1, t4 left join t5 on t5.rid = t4.rid left join t2 on t2.cid = t4.cid WHERE t3.gid=t4.gid AND t6.uid = t4.uid AND t6.uc = t1.cid AND t1.cv = "dummy" AND t6.un = "test";
-SELECT t4.uid, t5.rl, t3.gn as g1, t4.cid, t4.gid as gg FROM t3, t6, t1, t4 left join t5 on t5.rid = t4.rid left join t2 on t2.cid = t4.cid WHERE t3.gid=t4.gid AND t6.uid = t4.uid AND t3.must IS NOT NULL AND t6.uc = t1.cid AND t1.cv = "dummy" AND t6.un = "test";
-(SELECT t4.uid, t5.rl, t3.gn as g1, t4.cid, t4.gid as gg FROM t3, t6, t1, t4 left join t5 on t5.rid = t4.rid left join t2 on t2.cid = t4.cid WHERE t3.gid=t4.gid AND t6.uid = t4.uid AND t3.must IS NOT NULL AND t6.uc = t1.cid AND t1.cv = "dummy" AND t6.un = "test") UNION (SELECT t4.uid, t5.rl, t3.gn as g1, t4.cid, t4.gid as gg FROM t3, t6, t1, t4 left join t5 on t5.rid = t4.rid left join t2 on t2.cid = t4.cid WHERE t3.gid=t4.gid AND t6.uid = t4.uid AND t6.uc = t1.cid AND t1.cv = "dummy" AND t6.un = "test");
-drop table t1,t2,t3,t4,t5,t6;
-
-#
-# Test insert ... SELECT with UNION
-#
-
-CREATE TABLE t1 (a int not null, b char (10) not null);
-insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
-CREATE TABLE t2 (a int not null, b char (10) not null);
-insert into t2 values (3,'c'),(4,'d'),(5,'f'),(6,'e');
-create table t3 select a,b from t1 union select a,b from t2;
-create table t4 (select a,b from t1) union (select a,b from t2) limit 2;
-insert into t4 select a,b from t1 union select a,b from t2;
-insert into t3 (select a,b from t1) union (select a,b from t2) limit 2;
-select * from t3;
-select * from t4;
-drop table t1,t2,t3,t4;
-
-#
-# Test of SQL_CALC_FOUND_ROW handling
-#
-create table t1 (a int);
-insert into t1 values (1),(2),(3);
-create table t2 (a int);
-insert into t2 values (3),(4),(5);
-
-# Test global limits
-(SELECT SQL_CALC_FOUND_ROWS * FROM t1) UNION all (SELECT * FROM t2) LIMIT 1;
-select found_rows();
-(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION all (SELECT * FROM t2) LIMIT 2;
-select found_rows();
-
-# Test cases where found_rows() should return number of returned rows
-(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION all (SELECT * FROM t2);
-select found_rows();
-(SELECT SQL_CALC_FOUND_ROWS * FROM t1) UNION all (SELECT * FROM t2 LIMIT 1);
-select found_rows();
-# This used to work in 4.0 but not anymore in 4.1
---error 1064
-(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION SELECT * FROM t2 LIMIT 1;
-#select found_rows();
-
-# In these case found_rows() should work
-SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION all SELECT * FROM t2 LIMIT 2;
-select found_rows();
-SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION all SELECT * FROM t2 LIMIT 2;
-select found_rows();
-
-# The following examples will not be exact
-SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 2;
-select found_rows();
-SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 100;
-select found_rows();
-SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 100 UNION SELECT * FROM t2;
-select found_rows();
-SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION SELECT * FROM t2;
-select found_rows();
-SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION SELECT * FROM t2 LIMIT 2;
-select found_rows();
-SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 2,2;
-select found_rows();
-SELECT SQL_CALC_FOUND_ROWS * FROM t1 limit 2,2 UNION SELECT * FROM t2;
-select found_rows();
-
-# Test some limits with ORDER BY
-SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a desc LIMIT 1;
-(SELECT * FROM t1 ORDER by a) UNION ALL (SELECT * FROM t2 ORDER BY a) ORDER BY A desc LIMIT 4;
-
-# Wrong usage
---error 1234
-(SELECT * FROM t1) UNION all (SELECT SQL_CALC_FOUND_ROWS * FROM t2) LIMIT 1;
-
-create temporary table t1 engine=myisam select a from t1 union select a from t2; # PBXT cannot handle INSERT/SELECT on temp table
-drop temporary table t1;
---error ER_TABLE_EXISTS_ERROR
-create table t1 select a from t1 union select a from t2;
---error 1054
-select a from t1 union select a from t2 order by t2.a;
-drop table t1,t2;
-
-#
-# Problem with alias '*' (BUG #1249)
-#
-
-select length(version()) > 1 as `*` UNION select 2;
-
-#
-# Bug #4980: problem with explain
-#
-
-create table t1 (a int);
-insert into t1 values (0), (3), (1), (2);
-explain (select * from t1) union (select * from t1) order by a;
-drop table t1;
-#
-# Test for another bug with UNION and LEFT JOIN
-#
-CREATE TABLE t1 ( id int(3) unsigned default '0') ENGINE=MyISAM;
-INSERT INTO t1 (id) VALUES("1");
-CREATE TABLE t2 ( id int(3) unsigned default '0', id_master int(5) default '0', text1 varchar(5) default NULL, text2 varchar(5) default NULL) ENGINE=MyISAM;
-INSERT INTO t2 (id, id_master, text1, text2) VALUES("1", "1",
-"foo1", "bar1");
-INSERT INTO t2 (id, id_master, text1, text2) VALUES("2", "1",
-"foo2", "bar2");
-INSERT INTO t2 (id, id_master, text1, text2) VALUES("3", "1", NULL,
-"bar3");
-INSERT INTO t2 (id, id_master, text1, text2) VALUES("4", "1",
-"foo4", "bar4");
-SELECT 1 AS id_master, 1 AS id, NULL AS text1, 'ABCDE' AS text2 UNION SELECT id_master, t2.id, text1, text2 FROM t1 LEFT JOIN t2 ON t1.id = t2.id_master;
-SELECT 1 AS id_master, 1 AS id, 'ABCDE' AS text1, 'ABCDE' AS text2 UNION SELECT id_master, t2.id, text1, text2 FROM t1 LEFT JOIN t2 ON t1.id = t2.id_master;
-drop table if exists t1,t2;
-
-#
-# Test of bug when using the same table multiple times
-#
-create table t1 (a int not null primary key auto_increment, b int, key(b));
-create table t2 (a int not null primary key auto_increment, b int);
-insert into t1 (b) values (1),(2),(2),(3);
-insert into t2 (b) values (10),(11),(12),(13);
-
-explain extended (select * from t1 where a=1) union (select * from t2 where a=1);
-(select * from t1 where a=5) union (select * from t2 where a=1);
-(select * from t1 where a=5 and a=6) union (select * from t2 where a=1);
-(select t1.a,t1.b from t1,t2 where t1.a=5) union (select * from t2 where a=1);
-(select * from t1 where a=1) union (select t1.a,t2.a from t1,t2 where t1.a=t2.a);
-explain (select * from t1 where a=1 and b=10) union (select straight_join t1.a,t2.a from t1,t2 where t1.a=t2.a);
-explain (select * from t1 where a=1) union (select * from t1 where b=1);
-drop table t1,t2;
-create table t1 ( id int not null auto_increment, primary key (id) ,user_name text );
-create table t2 ( id int not null auto_increment, primary key (id) ,group_name text );
-create table t3 ( id int not null auto_increment, primary key (id) ,user_id int ,index user_idx (user_id) ,foreign key (user_id) references t1(id) ,group_id int ,index group_idx (group_id) ,foreign key (group_id) references t2(id) ); # PBXT: Correct table references!
-insert into t1 (user_name) values ('Tester');
-insert into t2 (group_name) values ('Group A');
-insert into t2 (group_name) values ('Group B');
-insert into t3 (user_id, group_id) values (1,1);
-select 1 'is_in_group', a.user_name, c.group_name, b.id from t1 a, t3 b, t2 c where a.id = b.user_id and b.group_id = c.id UNION select 0 'is_in_group', a.user_name, c.group_name, null from t1 a, t2 c;
-drop table t3, t2, t1;
-
-#
-# fix_fields problem
-#
-create table t1 (mat_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, matintnum CHAR(6) NOT NULL, test MEDIUMINT UNSIGNED NULL);
-create table t2 (mat_id MEDIUMINT UNSIGNED NOT NULL, pla_id MEDIUMINT UNSIGNED NOT NULL);
-insert into t1 values (NULL, 'a', 1), (NULL, 'b', 2), (NULL, 'c', 3), (NULL, 'd', 4), (NULL, 'e', 5), (NULL, 'f', 6), (NULL, 'g', 7), (NULL, 'h', 8), (NULL, 'i', 9);
-insert into t2 values (1, 100), (1, 101), (1, 102), (2, 100), (2, 103), (2, 104), (3, 101), (3, 102), (3, 105);
-SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id union SELECT 0, 0;
-drop table t1, t2;
-
-#
-# types conversions
-#
-create table t1 SELECT "a" as a UNION select "aa" as a;
-select * from t1;
-show create table t1;
-drop table t1;
-create table t1 SELECT 12 as a UNION select "aa" as a;
-select * from t1;
-show create table t1;
-drop table t1;
-create table t1 SELECT 12 as a UNION select 12.2 as a;
-select * from t1;
-show create table t1;
-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);
-insert into t2 values (NULL, 1, 3, 4, 1.5, 2.5, 1972, '1972-10-22', '1972-10-22 11:50', 'testc', 'testv', 'tetetetetest', 'teeeeeeeeeeeest');
-
-create table t1 SELECT it2 from t2 UNION select it1 from t2;
-select * from t1;
-show create table t1;
-drop table t1;
-create table t1 SELECT it2 from t2 UNION select i from t2;
-select * from t1;
-show create table t1;
-drop table t1;
-create table t1 SELECT i from t2 UNION select f from t2;
-select * from t1;
-show create table t1;
-drop table t1;
-create table t1 SELECT f from t2 UNION select d from t2;
-select * from t1;
-show create table t1;
-drop table t1;
-create table t1 SELECT ib from t2 UNION select f from t2;
-select * from t1;
-show create table t1;
-drop table t1;
-create table t1 SELECT ib from t2 UNION select d from t2;
-select * from t1;
-show create table t1;
-drop table t1;
-create table t1 SELECT f from t2 UNION select y from t2;
-select * from t1;
-show create table t1;
-drop table t1;
-create table t1 SELECT f from t2 UNION select da from t2;
-select * from t1;
-show create table t1;
-drop table t1;
-create table t1 SELECT y from t2 UNION select da from t2;
-select * from t1;
-show create table t1;
-drop table t1;
-create table t1 SELECT y from t2 UNION select dt from t2;
-select * from t1;
-show create table t1;
-drop table t1;
-create table t1 SELECT da from t2 UNION select dt from t2;
-select * from t1;
-show create table t1;
-drop table t1;
-create table t1 SELECT dt from t2 UNION select trim(sc) from t2;
-select trim(dt) from t1;
-show create table t1;
-drop table t1;
-create table t1 SELECT dt from t2 UNION select sv from t2;
-select * from t1;
-show create table t1;
-drop table t1;
-create table t1 SELECT sc from t2 UNION select sv from t2;
-select * from t1;
-show create table t1;
-drop table t1;
-create table t1 SELECT dt from t2 UNION select b from t2;
-select * from t1;
-show create table t1;
-drop table t1;
-create table t1 SELECT sv from t2 UNION select b from t2;
-select * from t1;
-show create table t1;
-drop table t1;
-create table t1 SELECT i from t2 UNION select d from t2 UNION select b from t2;
-select * from t1;
-show create table t1;
-drop table t1;
-create table t1 SELECT sv from t2 UNION select tx from t2;
-select * from t1;
-show create table t1;
-drop table t1;
-create table t1 SELECT b from t2 UNION select tx from t2;
-select * from t1;
-show create table t1;
-drop table t1,t2;
-create table t1 select 1 union select -1;
-select * from t1;
-show create table t1;
-drop table t1;
--- error 1267
-create table t1 select _latin1"test" union select _latin2"testt" ;
-create table t1 select _latin2"test" union select _latin2"testt" ;
-show create table t1;
-drop table t1;
-
-#
-# conversion memory->disk table
-#
-create table t1 (s char(200));
-insert into t1 values (repeat("1",200));
-create table t2 select * from t1;
-insert into t2 select * from t1;
-insert into t1 select * from t2;
-insert into t2 select * from t1;
-insert into t1 select * from t2;
-insert into t2 select * from t1;
-set local tmp_table_size=1024;
-select count(*) from (select * from t1 union all select * from t2 order by 1) b;
-select count(*) from t1;
-select count(*) from t2;
-drop table t1,t2;
-set local tmp_table_size=default;
-
-#
-# slow logging
-#
-create table t1 (a int, index (a), b int);
-insert t1 values (1,1),(2,2),(3,3),(4,4),(5,5);
-insert t1 select a+1, a+b from t1;
-insert t1 select a+1, a+b from t1;
-insert t1 select a+1, a+b from t1;
-insert t1 select a+1, a+b from t1;
-insert t1 select a+1, a+b from t1;
-FLUSH STATUS;
-show status like 'Slow_queries';
-select count(*) from t1 where a=7;
-show status like 'Slow_queries';
-select count(*) from t1 where b=13;
-show status like 'Slow_queries';
-select count(*) from t1 where b=13 union select count(*) from t1 where a=7;
-show status like 'Slow_queries';
-select count(*) from t1 where a=7 union select count(*) from t1 where b=13;
-show status like 'Slow_queries';
-# additional test for examined rows
-flush status;
-select a from t1 where b not in (1,2,3) union select a from t1 where b not in (4,5,6);
-show status like 'Slow_queries';
-drop table t1;
-
-#
-# Column 'name' cannot be null (error with union and left join) (bug #2508)
-#
-create table t1 ( RID int(11) not null default '0', IID int(11) not null default '0', nada varchar(50) not null,NAME varchar(50) not null,PHONE varchar(50) not null) engine=MyISAM;
-insert into t1 ( RID,IID,nada,NAME,PHONE) values (1, 1, 'main', 'a', '111'), (2, 1, 'main', 'b', '222'), (3, 1, 'main', 'c', '333'), (4, 1, 'main', 'd', '444'), (5, 1, 'main', 'e', '555'), (6, 2, 'main', 'c', '333'), (7, 2, 'main', 'd', '454'), (8, 2, 'main', 'e', '555'), (9, 2, 'main', 'f', '666'), (10, 2, 'main', 'g', '777');
-SET @save_optimizer_switch=@@optimizer_switch;
-SET optimizer_switch='outer_join_with_cache=off';
-select A.NAME, A.PHONE, B.NAME, B.PHONE from t1 A left join t1 B on A.NAME = B.NAME and B.IID = 2 where A.IID = 1 and (A.PHONE <> B.PHONE or B.NAME is null) union select A.NAME, A.PHONE, B.NAME, B.PHONE from t1 B left join t1 A on B.NAME = A.NAME and A.IID = 1 where B.IID = 2 and (A.PHONE <> B.PHONE or A.NAME is null);
-SET optimizer_switch=@save_optimizer_switch;
-drop table t1;
-
-#
-# Bug #2809 (UNION fails on MyIsam tables when index on second column from
-# same table)
-#
-create table t1 (col1 tinyint unsigned, col2 tinyint unsigned);
-insert into t1 values (1,2),(3,4),(5,6),(7,8),(9,10);
-select col1 n from t1 union select col2 n from t1 order by n;
-alter table t1 add index myindex (col2);
-select col1 n from t1 union select col2 n from t1 order by n;
-drop table t1;
-
-#
-# Incorrect handling of UNION ALL (Bug #1428)
-#
-create table t1 (i int);
-insert into t1 values (1);
-select * from t1 UNION select * from t1;
-select * from t1 UNION ALL select * from t1;
-select * from t1 UNION select * from t1 UNION ALL select * from t1;
-drop table t1;
-select 1 as a union all select 1 union all select 2 union select 1 union all select 2;
-set sql_select_limit=1;
-select 1 union select 2;
-(select 1) union (select 2);
-(select 1) union (select 2) union (select 3) limit 2;
-set sql_select_limit=default;
-
-#
-# ORDER with LIMIT
-#
-create table t1 (a int);
-insert into t1 values (100), (1);
-create table t2 (a int);
-insert into t2 values (100);
-select a from t1 union select a from t2 order by a;
-SET SQL_SELECT_LIMIT=1;
-select a from t1 union select a from t2 order by a;
-drop table t1, t2;
-set sql_select_limit=default;
-
-#
-# nonexisting column in global ORDER BY
-#
-CREATE TABLE t1 (i int(11) default NULL,c char(1) default NULL,KEY i (i));
-CREATE TABLE t2 (i int(11) default NULL,c char(1) default NULL,KEY i (i));
---error 1054
-explain (select * from t1) union (select * from t2) order by not_existing_column;
-drop table t1, t2;
-
-#
-# length detecting
-#
-CREATE TABLE t1 (uid int(1));
-INSERT INTO t1 SELECT 150;
-SELECT 'a' UNION SELECT uid FROM t1;
-drop table t1;
-
-#
-# parser stack overflow
-#
-CREATE TABLE t1 ( ID1 int(10) unsigned NOT NULL DEFAULT '0' , ID2 datetime NOT NULL DEFAULT '0000-00-00 00:00:00' , DATA1 varchar(10) , DATA2 double(5,4) , DATA3 datetime , PRIMARY KEY (ID1,ID2));
-
-CREATE TABLE t2 ( ID int(3) unsigned NOT NULL DEFAULT '0' , DATA1 timestamp DEFAULT '0000-00-00 00:00:00' , PRIMARY KEY (ID));
-(SELECT * FROM t1 AS PARTITIONED, t2 AS
-PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION
-(SELECT * FROM t1 AS PARTITIONED, t2 AS
-PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION
-(SELECT * FROM t1 AS PARTITIONED, t2 AS
-PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION
-(SELECT * FROM t1 AS PARTITIONED, t2 AS
-PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION
-(SELECT * FROM t1 AS PARTITIONED, t2 AS
-PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION
-(SELECT * FROM t1 AS PARTITIONED, t2 AS
-PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION
-(SELECT * FROM t1 AS PARTITIONED, t2 AS
-PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION
-(SELECT * FROM t1 AS PARTITIONED, t2 AS
-PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION
-(SELECT * FROM t1 AS PARTITIONED, t2 AS
-PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION
-(SELECT * FROM t1 AS PARTITIONED, t2 AS
-PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION
-(SELECT * FROM t1 AS PARTITIONED, t2 AS
-PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION
-(SELECT * FROM t1 AS PARTITIONED, t2 AS
-PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1);
-drop table t1,t2;
-
-#
-# merging ENUM and SET fields in one UNION
-#
-create table t1 (a ENUM('Yes', 'No') NOT NULL);
-create table t2 (a ENUM('aaa', 'bbb') NOT NULL);
-insert into t1 values ('No');
-insert into t2 values ('bbb');
-create table t3 (a SET('Yes', 'No') NOT NULL);
-create table t4 (a SET('aaa', 'bbb') NOT NULL);
-insert into t3 values (1);
-insert into t4 values (3);
-select "1" as a union select a from t1;
-select a as a from t1 union select "1";
-select a as a from t2 union select a from t1;
-select "1" as a union select a from t3;
-select a as a from t3 union select "1";
-select a as a from t4 union select a from t3;
-select a as a from t1 union select a from t4;
-drop table t1,t2,t3,t4;
-
-#
-# Bug #6139 UNION doesn't understand collate in the column of second select
-#
-create table t1 as
-(select _latin1'test') union
-(select _latin1'TEST') union
-(select _latin1'TeST');
-show create table t1;
-select count(*) from t1;
-drop table t1;
-
-create table t1 as
-(select _latin1'test' collate latin1_bin) union
-(select _latin1'TEST') union
-(select _latin1'TeST');
-show create table t1;
-select count(*) from t1;
-drop table t1;
-
-create table t1 as
-(select _latin1'test') union
-(select _latin1'TEST' collate latin1_bin) union
-(select _latin1'TeST');
-show create table t1;
-select count(*) from t1;
-drop table t1;
-
-create table t1 as
-(select _latin1'test') union
-(select _latin1'TEST') union
-(select _latin1'TeST' collate latin1_bin);
-show create table t1;
-select count(*) from t1;
-drop table t1;
-
-create table t2 (
-a char character set latin1 collate latin1_swedish_ci,
-b char character set latin1 collate latin1_german1_ci);
---error 1271
-create table t1 as
-(select a from t2) union
-(select b from t2);
-create table t1 as
-(select a collate latin1_german1_ci from t2) union
-(select b from t2);
-show create table t1;
-drop table t1;
-create table t1 as
-(select a from t2) union
-(select b collate latin1_german1_ci from t2);
-show create table t1;
-drop table t1;
-create table t1 as
-(select a from t2) union
-(select b from t2) union
-(select 'c' collate latin1_german1_ci from t2);
-show create table t1;
-drop table t1;
-drop table t2;
-
-#
-# Bug 6931: Date Type column problem when using UNION-Table.
-#
-create table t1(a1 int, f1 char(10));
-create table t2
-select f2,a1 from (select a1, CAST('2004-12-31' AS DATE) f2 from t1) a
-union
-select f2,a1 from (select a1, CAST('2004-12-31' AS DATE) f2 from t1) a
-order by f2, a1;
-show columns from t2;
-drop table t1, t2;
-
-create table t1 (f1 int);
-create table t2 (f1 int, f2 int ,f3 date);
-create table t3 (f1 int, f2 char(10));
-create table t4
-(
- select t2.f3 as sdate
- from t1
- left outer join t2 on (t1.f1 = t2.f1)
- inner join t3 on (t2.f2 = t3.f1)
- order by t1.f1, t3.f1, t2.f3
-)
-union
-(
- select cast('2004-12-31' as date) as sdate
- from t1
- left outer join t2 on (t1.f1 = t2.f1)
- inner join t3 on (t2.f2 = t3.f1)
- group by t1.f1
- order by t1.f1, t3.f1, t2.f3
-)
-order by sdate;
-show columns from t4;
-drop table t1, t2, t3, t4;
-
-#
-# Bug #2435 UNION with parentheses not supported
-#
-create table t1 (a int not null, b char (10) not null);
-insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
-select * from ((select * from t1 limit 1)) a;
-select * from ((select * from t1 limit 1) union (select * from t1 limit 1)) a;
-select * from ((select * from t1 limit 1) union (select * from t1 limit 1) union (select * from t1 limit 1)) a;
-select * from ((((select * from t1))) union (select * from t1) union (select * from t1)) a;
-select * from ((select * from t1) union (((select * from t1))) union (select * from t1)) a;
-drop table t1;
-
-#
-# Bugs#6519 UNION with collation binary and latin1_swedish_ci fails
-#
-set @val:=6;
-select concat('value is: ', @val) union select 'some text';
-
-#
-# Bug#15949 union + illegal mix of collations (IMPLICIT + COERCIBLE)
-#
-select concat(_latin1'a', _ascii'b' collate ascii_bin);
-create table t1 (foo varchar(100)) collate ascii_bin;
-insert into t1 (foo) values ("foo");
-select foo from t1 union select 'bar' as foo from dual;
-drop table t1;
-
-#
-# Enum merging test
-#
-CREATE TABLE t1 (
- a ENUM('','','') character set utf8 not null default '',
- b ENUM("one", "two") character set utf8,
- c ENUM("one", "two")
-);
-show create table t1;
-insert into t1 values ('', 'one', 'one'), ('', 'two', 'one'), ('', NULL, NULL);
-create table t2 select NULL union select a from t1;
-show columns from t2;
-drop table t2;
-create table t2 select a from t1 union select NULL;
-show columns from t2;
-drop table t2;
-create table t2 select a from t1 union select a from t1;
-show columns from t2;
-drop table t2;
-create table t2 select a from t1 union select c from t1;
-drop table t2;
-create table t2 select a from t1 union select b from t1;
-show columns from t2;
-drop table t2, t1;
-
-#
-# Bug #14216: UNION + DECIMAL wrong values in result
-#
-create table t1 (f1 decimal(60,25), f2 decimal(60,25));
-insert into t1 values (0.0,0.0);
-select f1 from t1 union all select f2 from t1;
-select 'XXXXXXXXXXXXXXXXXXXX' as description, f1 from t1
-union all
-select 'YYYYYYYYYYYYYYYYYYYY' as description, f2 from t1;
-drop table t1;
-create table t1 (f1 decimal(60,24), f2 decimal(60,24));
-insert into t1 values (0.0,0.0);
-select f1 from t1 union all select f2 from t1;
-select 'XXXXXXXXXXXXXXXXXXXX' as description, f1 from t1
-union all
-select 'YYYYYYYYYYYYYYYYYYYY' as description, f2 from t1;
-drop table t1;
-
-#
-# Test that union with VARCHAR produces dynamic row tables
-#
-
-create table t1 (a varchar(5));
-create table t2 select * from t1 union select 'abcdefghijkl';
-show create table t2;
-select row_format from information_schema.TABLES where table_schema="test" and table_name="t2";
-alter table t2 ROW_FORMAT=fixed;
-show create table t2;
-drop table t1,t2;
-
-#
-# correct conversion long string to TEXT (BUG#10025)
-#
-
-CREATE TABLE t1 (a mediumtext);
-CREATE TABLE t2 (b varchar(20));
-INSERT INTO t1 VALUES ('a'),('b');
-SELECT left(a,100000000) FROM t1 UNION SELECT b FROM t2;
-create table t3 SELECT left(a,100000000) FROM t1 UNION SELECT b FROM t2;
-show create table t3;
-drop tables t1,t2,t3;
-
-#
-# Extended fix to Bug#10025 - the test above should result to mediumtext
-# and the one below to longtext. Earlier above test resulted to longtext
-# type also.
-#
-
-CREATE TABLE t1 (a longtext);
-CREATE TABLE t2 (b varchar(20));
-INSERT INTO t1 VALUES ('a'),('b');
-SELECT left(a,100000000) FROM t1 UNION SELECT b FROM t2;
-create table t3 SELECT left(a,100000000) FROM t1 UNION SELECT b FROM t2;
-show create table t3;
-drop tables t1,t2,t3;
-
-#
-# Testing here that mediumtext converts into longtext if the result
-# exceeds mediumtext maximum length
-#
-
-SELECT @tmp_max:= @@global.max_allowed_packet;
-SET @@global.max_allowed_packet=25000000;
-# switching connection to allow the new max_allowed_packet take effect
---connect (newconn, localhost, root,,)
-CREATE TABLE t1 (a mediumtext);
-CREATE TABLE t2 (b varchar(20));
-INSERT INTO t1 VALUES ('a');
-CREATE TABLE t3 SELECT REPEAT(a,20000000) AS a FROM t1 UNION SELECT b FROM t2;
-SHOW CREATE TABLE t3;
-DROP TABLES t1,t3;
-CREATE TABLE t1 (a tinytext);
-INSERT INTO t1 VALUES ('a');
-CREATE TABLE t3 SELECT REPEAT(a,2) AS a FROM t1 UNION SELECT b FROM t2;
-SHOW CREATE TABLE t3;
-DROP TABLES t1,t3;
-CREATE TABLE t1 (a mediumtext);
-INSERT INTO t1 VALUES ('a');
-CREATE TABLE t3 SELECT REPEAT(a,2) AS a FROM t1 UNION SELECT b FROM t2;
-SHOW CREATE TABLE t3;
-DROP TABLES t1,t3;
-CREATE TABLE t1 (a tinyblob);
-INSERT INTO t1 VALUES ('a');
-CREATE TABLE t3 SELECT REPEAT(a,2) AS a FROM t1 UNION SELECT b FROM t2;
-SHOW CREATE TABLE t3;
-DROP TABLES t1,t2,t3;
---connection default
-SET @@global.max_allowed_packet:= @tmp_max;
---disconnect newconn
-
-#
-# Bug #10032 Bug in parsing UNION with ORDER BY when one node does not use FROM
-#
-
-create table t1 ( id int not null auto_increment, primary key (id), col1 int);
-insert into t1 (col1) values (2),(3),(4),(5),(6);
-select 99 union all select id from t1 order by 1;
-select id from t1 union all select 99 order by 1;
-drop table t1;
-
-# End of 4.1 tests
-
-#
-# Bug#12185: Data type aggregation may produce wrong result
-#
-create table t1(f1 char(1), f2 char(5), f3 binary(1), f4 binary(5), f5 timestamp, f6 varchar(1) character set utf8 collate utf8_general_ci, f7 text);
-create table t2 as select *, f6 as f8 from t1 union select *, f7 from t1;
-show create table t2;
-drop table t1, t2;
-
-#
-# Bug#18175: Union select over 129 tables with a sum function fails.
-#
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1)) union
-(select avg(1)) union (select avg(1)) union (select avg(1));
-
-#
-# Bug #16881: password() and union select
-# (The issue was poor handling of character set aggregation.)
-#
-select _utf8'12' union select _latin1'12345';
-
-#
-# lp:732124 union + limit returns wrong result
-#
-create table t1 (a int);
-insert into t1 values (10),(10),(10),(2),(3),(4),(5),(6),(7),(8),(9),(1),(10);
---sorted_result
-select a from t1 where false UNION select a from t1 limit 8;
-drop table t1;
-
-
---disable_query_log
-drop database pbxt;
---enable_query_log
---echo End of 5.0 tests
diff --git a/mysql-test/suite/pbxt/t/update.test b/mysql-test/suite/pbxt/t/update.test
deleted file mode 100644
index edc99e304a7..00000000000
--- a/mysql-test/suite/pbxt/t/update.test
+++ /dev/null
@@ -1,314 +0,0 @@
-#
-# test of updating of keys
-#
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-create table t1 (a int auto_increment , primary key (a));
-insert into t1 values (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
-update t1 set a=a+10 where a > 34;
-update t1 set a=a+100 where a > 0;
-
-# Some strange updates to test some otherwise unused code
-update t1 set a=a+100 where a=1 and a=2;
---error 1054
-update t1 set a=b+100 where a=1 and a=2;
---error 1054
-update t1 set a=b+100 where c=1 and a=2;
---error 1054
-update t1 set d=a+100 where a=1;
-select * from t1;
-drop table t1;
-
-CREATE TABLE t1
- (
- place_id int (10) unsigned NOT NULL,
- shows int(10) unsigned DEFAULT '0' NOT NULL,
- ishows int(10) unsigned DEFAULT '0' NOT NULL,
- ushows int(10) unsigned DEFAULT '0' NOT NULL,
- clicks int(10) unsigned DEFAULT '0' NOT NULL,
- iclicks int(10) unsigned DEFAULT '0' NOT NULL,
- uclicks int(10) unsigned DEFAULT '0' NOT NULL,
- ts timestamp,
- PRIMARY KEY (place_id,ts)
- );
-
-INSERT INTO t1 (place_id,shows,ishows,ushows,clicks,iclicks,uclicks,ts)
-VALUES (1,0,0,0,0,0,0,20000928174434);
-UPDATE t1 SET shows=shows+1,ishows=ishows+1,ushows=ushows+1,clicks=clicks+1,iclicks=iclicks+1,uclicks=uclicks+1 WHERE place_id=1 AND ts>="2000-09-28 00:00:00";
-select place_id,shows from t1;
-drop table t1;
-
-#
-# Test bug with update reported by Jan Legenhausen
-#
-
-CREATE TABLE t1 (
- lfdnr int(10) unsigned NOT NULL default '0',
- ticket int(10) unsigned NOT NULL default '0',
- client varchar(255) NOT NULL default '',
- replyto varchar(255) NOT NULL default '',
- subject varchar(100) NOT NULL default '',
- timestamp int(10) unsigned NOT NULL default '0',
- tstamp timestamp NOT NULL,
- status int(3) NOT NULL default '0',
- type varchar(15) NOT NULL default '',
- assignment int(10) unsigned NOT NULL default '0',
- fupcount int(4) unsigned NOT NULL default '0',
- parent int(10) unsigned NOT NULL default '0',
- activity int(10) unsigned NOT NULL default '0',
- priority tinyint(1) unsigned NOT NULL default '1',
- cc varchar(255) NOT NULL default '',
- bcc varchar(255) NOT NULL default '',
- body text NOT NULL,
- comment text,
- header text,
- PRIMARY KEY (lfdnr),
- KEY k1 (timestamp),
- KEY k2 (type),
- KEY k3 (parent),
- KEY k4 (assignment),
- KEY ticket (ticket)
-) ENGINE=MyISAM;
-
-INSERT INTO t1 VALUES (773,773,'','','',980257344,20010318180652,0,'Open',10,0,0,0,1,'','','','','');
-
-alter table t1 change lfdnr lfdnr int(10) unsigned not null auto_increment;
-update t1 set status=1 where type='Open';
-select status from t1;
-drop table t1;
-
-#
-# Test of ORDER BY
-#
-
-create table t1 (a int not null, b int not null, key (a));
-insert into t1 values (1,1),(1,2),(1,3),(3,1),(3,2),(3,3),(3,1),(3,2),(3,3),(2,1),(2,2),(2,3);
-SET @tmp=0;
-update t1 set b=(@tmp:=@tmp+1) order by a;
-update t1 set b=99 where a=1 order by b asc limit 1;
-select * from t1 order by a,b;
-update t1 set b=100 where a=1 order by b desc limit 2;
-update t1 set a=a+10+b where a=1 order by b;
-select * from t1 order by a,b;
-create table t2 (a int not null, b int not null);
-insert into t2 values (1,1),(1,2),(1,3);
-update t1 set b=(select distinct 1 from (select * from t2) a);
-drop table t1,t2;
-
-#
-# Test with limit (Bug #393)
-#
-
-CREATE TABLE t1 (
- `id_param` smallint(3) unsigned NOT NULL default '0',
- `nom_option` char(40) NOT NULL default '',
- `valid` tinyint(1) NOT NULL default '0',
- KEY `id_param` (`id_param`,`nom_option`)
- ) ENGINE=MyISAM;
-
-INSERT INTO t1 (id_param,nom_option,valid) VALUES (185,'600x1200',1);
-
-UPDATE t1 SET nom_option='test' WHERE id_param=185 AND nom_option='600x1200' AND valid=1 LIMIT 1;
-select * from t1;
-drop table t1;
-
-#
-# Multi table update test from bugs
-#
-
-create table t1 (F1 VARCHAR(30), F2 VARCHAR(30), F3 VARCHAR(30), cnt int, groupid int, KEY groupid_index (groupid));
-
-insert into t1 (F1,F2,F3,cnt,groupid) values ('0','0','0',1,6),
-('0','1','2',1,5), ('0','2','0',1,3), ('1','0','1',1,2),
-('1','2','1',1,1), ('1','2','2',1,1), ('2','0','1',2,4),
-('2','2','0',1,7);
-delete from m1 using t1 m1,t1 m2 where m1.groupid=m2.groupid and (m1.cnt < m2.cnt or m1.cnt=m2.cnt and m1.F3>m2.F3);
-select * from t1;
-drop table t1;
-
-#
-# Bug#5553 - Multi table UPDATE IGNORE fails on duplicate keys
-#
-
-CREATE TABLE t1 (
- `colA` int(10) unsigned NOT NULL auto_increment,
- `colB` int(11) NOT NULL default '0',
- PRIMARY KEY (`colA`)
-);
-INSERT INTO t1 VALUES (4433,5424);
-CREATE TABLE t2 (
- `colC` int(10) unsigned NOT NULL default '0',
- `colA` int(10) unsigned NOT NULL default '0',
- `colD` int(10) unsigned NOT NULL default '0',
- `colE` int(10) unsigned NOT NULL default '0',
- `colF` int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (`colC`,`colA`,`colD`,`colE`)
-);
-INSERT INTO t2 VALUES (3,4433,10005,495,500);
-INSERT INTO t2 VALUES (3,4433,10005,496,500);
-INSERT INTO t2 VALUES (3,4433,10009,494,500);
-INSERT INTO t2 VALUES (3,4433,10011,494,500);
-INSERT INTO t2 VALUES (3,4433,10005,497,500);
-INSERT INTO t2 VALUES (3,4433,10013,489,500);
-INSERT INTO t2 VALUES (3,4433,10005,494,500);
-INSERT INTO t2 VALUES (3,4433,10005,493,500);
-INSERT INTO t2 VALUES (3,4433,10005,492,500);
-UPDATE IGNORE t2,t1 set t2.colE = t2.colE + 1,colF=0 WHERE t1.colA = t2.colA AND (t1.colB & 4096) > 0 AND (colE + 1) < colF;
-SELECT * FROM t2;
-DROP TABLE t1;
-DROP TABLE t2;
-
-#
-# Bug #6054
-#
-create table t1 (c1 int, c2 char(6), c3 int);
-create table t2 (c1 int, c2 char(6));
-insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20);
-update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1";
-update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10;
-drop table t1, t2;
-
-#
-# Bug #8057
-#
-create table t1 (id int not null auto_increment primary key, id_str varchar(32));
-insert into t1 (id_str) values ("test");
-update t1 set id_str = concat(id_str, id) where id = last_insert_id();
-select * from t1;
-drop table t1;
-
-#
-# Bug #8942: a problem with update and partial key part
-#
-
-create table t1 (a int, b char(255), key(a, b(20)));
-insert into t1 values (0, '1');
-update t1 set b = b + 1 where a = 0;
-select * from t1;
-drop table t1;
-
-# BUG#9103 "Erroneous data truncation warnings on multi-table updates"
-create table t1 (a int, b varchar(10), key b(b(5))) engine=myisam;
-create table t2 (a int, b varchar(10)) engine=myisam;
-insert into t1 values ( 1, 'abcd1e');
-insert into t1 values ( 2, 'abcd2e');
-insert into t2 values ( 1, 'abcd1e');
-insert into t2 values ( 2, 'abcd2e');
-analyze table t1,t2;
-update t1, t2 set t1.a = t2.a where t2.b = t1.b;
-show warnings;
-drop table t1, t2;
-
-#
-# Bug #11868 Update with subquery with ref built with a key from the updated
-# table crashes server
-#
-create table t1(f1 int, f2 int);
-create table t2(f3 int, f4 int);
-create index idx on t2(f3);
-insert into t1 values(1,0),(2,0);
-insert into t2 values(1,1),(2,2);
-UPDATE t1 SET t1.f2=(SELECT MAX(t2.f4) FROM t2 WHERE t2.f3=t1.f1);
-select * from t1;
-drop table t1,t2;
-
-#
-# Bug #13180 sometimes server accepts sum func in update/delete where condition
-#
-create table t1(f1 int);
-select DATABASE();
---error 1111
-update t1 set f1=1 where count(*)=1;
-select DATABASE();
---error 1111
-delete from t1 where count(*)=1;
-drop table t1;
-
-# BUG#12915: Optimize "DELETE|UPDATE ... ORDER BY ... LIMIT n" to use an index
-create table t1 ( a int, b int default 0, index (a) );
-insert into t1 (a) values (0),(0),(0),(0),(0),(0),(0),(0);
-
-flush status;
-select a from t1 order by a limit 1;
-show status like 'handler_read%';
-
-flush status;
-update t1 set a=9999 order by a limit 1;
-analyze table t1; # PBXT required to get a consistent order in the update below
-update t1 set b=9999 order by a desc limit 1; # PBXT Update last updated field
-show status like 'handler_read%';
-
-flush status;
-delete from t1 order by a limit 1;
-show status like 'handler_read%';
-
-flush status;
-delete from t1 order by a desc limit 1;
-show status like 'handler_read%';
-
-alter table t1 disable keys;
-
-flush status;
-delete from t1 order by a limit 1;
-show status like 'handler_read%';
-
-select * from t1;
-update t1 set a=a+10,b=1 order by a limit 3;
-update t1 set a=a+11,b=2 order by a limit 3;
-update t1 set a=a+12,b=3 order by a limit 3;
-select * from t1 order by a;
-
-drop table t1;
-
-#
-# Bug#14186 select datefield is null not updated
-#
-create table t1 (f1 date not null);
-insert into t1 values('2000-01-01'),('0000-00-00');
-update t1 set f1='2002-02-02' where f1 is null;
-select * from t1;
-drop table t1;
-
-#
-# Bug#15028 Multitable update returns different numbers of matched rows
-# depending on table order
-create table t1 (f1 int);
-create table t2 (f2 int);
-insert into t1 values(1),(2);
-insert into t2 values(1),(1);
---enable_info
-update t1,t2 set f1=3,f2=3 where f1=f2 and f1=1;
---disable_info
-update t2 set f2=1;
-update t1 set f1=1 where f1=3;
---enable_info
-update t2,t1 set f1=3,f2=3 where f1=f2 and f1=1;
---disable_info
-drop table t1,t2;
-
-
-# BUG#15935
-create table t1 (a int);
-insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-create table t2 (a int, filler1 char(200), filler2 char(200), key(a));
-insert into t2 select A.a + 10*B.a, 'filler','filler' from t1 A, t1 B;
-flush status;
-update t2 set a=3 where a=2;
-show status like 'handler_read%';
-drop table t1, t2;
-
-#
-# Bug #16510 Updating field named like '*name' caused server crash
-#
-create table t1(f1 int, `*f2` int);
-insert into t1 values (1,1);
-update t1 set `*f2`=1;
-drop table t1;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
-# End of 4.1 tests
diff --git a/mysql-test/suite/pbxt/t/user_var.test b/mysql-test/suite/pbxt/t/user_var.test
deleted file mode 100644
index 18d8423fefc..00000000000
--- a/mysql-test/suite/pbxt/t/user_var.test
+++ /dev/null
@@ -1,226 +0,0 @@
-# Initialise
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
---error 1054
-set @a := foo;
-set @a := connection_id() + 3;
-select @a - connection_id();
-
-set @b := 1;
-select @b;
-
-# Check using and setting variables with SELECT DISTINCT
-
-CREATE TABLE t1 ( i int not null, v int not null,index (i));
-insert into t1 values (1,1),(1,3),(2,1);
-create table t2 (i int not null, unique (i));
-insert into t2 select distinct i from t1;
-select * from t2;
-select distinct t2.i,@vv1:=if(sv1.i,1,0),@vv2:=if(sv2.i,1,0),@vv3:=if(sv3.i,1,0), @vv1+@vv2+@vv3 from t2 left join t1 as sv1 on sv1.i=t2.i and sv1.v=1 left join t1 as sv2 on sv2.i=t2.i and sv2.v=2 left join t1 as sv3 on sv3.i=t2.i and sv3.v=3;
-explain select * from t1 where i=@vv1;
-select @vv1,i,v from t1 where i=@vv1;
-explain select * from t1 where @vv1:=@vv1+1 and i=@vv1;
-explain select @vv1:=i from t1 where i=@vv1;
-explain select * from t1 where i=@vv1;
-drop table t1,t2;
-
-# Check types of variables
-set @a=0,@b=0;
-select @a:=10, @b:=1, @a > @b, @a < @b;
-# Note that here a and b will be avaluated as number
-select @a:="10", @b:="1", @a > @b, @a < @b;
-# Note that here a and b will be avaluated as strings
-select @a:=10, @b:=2, @a > @b, @a < @b;
-select @a:="10", @b:="2", @a > @b, @a < @b;
-
-# Fixed bug #1194
-select @a:=1;
-select @a, @a:=1;
-
-create table t1 (id int, d double, c char(10));
-insert into t1 values (1,2.0, "test");
-select @c:=0;
-update t1 SET id=(@c:=@c+1);
-select @c;
-select @c:=0;
-update t1 set id=(@c:=@c+1);
-select @c;
-select @c:=0;
-select @c:=@c+1;
-select @d,(@d:=id),@d from t1;
-select @e,(@e:=d),@e from t1;
-select @f,(@f:=c),@f from t1;
-set @g=1;
-select @g,(@g:=c),@g from t1;
-select @c, @d, @e, @f;
-select @d:=id, @e:=id, @f:=id, @g:=@id from t1;
-select @c, @d, @e, @f, @g;
-drop table t1;
-
-# just for fun :)
-select @a:=10, @b:=2, @a>@b, @a:="10", @b:="2", @a>@b, @a:=10, @b:=2, @a>@b, @a:="10", @b:="2", @a>@b;
-
-#
-# bug#1739
-# Item_func_set_user_var sets update_query_id, Item_func_get_user_var checks it
-#
-create table t1 (i int not null);
-insert t1 values (1),(2),(2),(3),(3),(3);
-select @a:=0; select @a, @a:=@a+count(*), count(*), @a from t1 group by i;
-select @a:=0; select @a+0, @a:=@a+0+count(*), count(*), @a+0 from t1 group by i;
-
-set @a=0;
-select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i;
-select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i;
-drop table t1;
-
-#
-# Bug #2244: User variables didn't copy collation and derivation
-# attributes from values they were initialized to.
-#
-
-set @a=_latin2'test';
-select charset(@a),collation(@a),coercibility(@a);
-select @a=_latin2'TEST';
-select @a=_latin2'TEST' collate latin2_bin;
-
-set @a=_latin2'test' collate latin2_general_ci;
-select charset(@a),collation(@a),coercibility(@a);
-select @a=_latin2'TEST';
-select @a=_latin2'TEST' collate latin2_bin;
-
-#
-# Check the same invoking Item_set_user_var
-#
-select charset(@a:=_latin2'test');
-select collation(@a:=_latin2'test');
-select coercibility(@a:=_latin2'test');
-select collation(@a:=_latin2'test' collate latin2_bin);
-select coercibility(@a:=_latin2'test' collate latin2_bin);
-select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST';
-select charset(@a),collation(@a),coercibility(@a);
-select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' collate latin2_general_ci;
-
-#
-# Bug #6321 strange error:
-# string function FIELD(<uservariable content NULL>, ...)
-#
-set @var= NULL ;
-select FIELD( @var,'1it','Hit') as my_column;
-
-#
-# Bug#9425 A user variable doesn't always have implicit coercibility
-#
-select @v, coercibility(@v);
-set @v1=null, @v2=1, @v3=1.1, @v4=now();
-select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4);
-
-#
-# Bug #9286 SESSION/GLOBAL should be disallowed for user variables
-#
---error 1064
-set session @honk=99;
-
-#
-# Bug #10724 @@local not preserved in column name of select
-#
-# The value doesn't actually matter, we just care about the column name
---replace_column 1 #
-select @@local.max_allowed_packet;
---replace_column 1 #
-select @@session.max_allowed_packet;
---replace_column 1 #
-select @@global.max_allowed_packet;
---replace_column 1 #
-select @@max_allowed_packet;
---replace_column 1 #
-select @@Max_Allowed_Packet;
---replace_column 1 #
-select @@version;
---replace_column 1 #
-select @@global.version;
-
---echo End of 4.1 tests
-
-# Bug #6598: problem with cast(NULL as signed integer);
-#
-
-set @first_var= NULL;
-create table t1 select @first_var;
-show create table t1;
-drop table t1;
-set @first_var= cast(NULL as signed integer);
-create table t1 select @first_var;
-show create table t1;
-drop table t1;
-set @first_var= NULL;
-create table t1 select @first_var;
-show create table t1;
-drop table t1;
-set @first_var= concat(NULL);
-create table t1 select @first_var;
-show create table t1;
-drop table t1;
-set @first_var=1;
-set @first_var= cast(NULL as CHAR);
-create table t1 select @first_var;
-show create table t1;
-drop table t1;
-
-#
-# Bug #7498 User variable SET saves SIGNED BIGINT as UNSIGNED BIGINT
-#
-
-# First part, set user var to large number and select it
-set @a=18446744071710965857;
-select @a;
-
-# Second part, set user var from large number in table
-# then select it
-CREATE TABLE `bigfailure` (
- `afield` BIGINT UNSIGNED NOT NULL
-);
-INSERT INTO `bigfailure` VALUES (18446744071710965857);
-SELECT * FROM bigfailure;
-select * from (SELECT afield FROM bigfailure) as b;
-select * from bigfailure where afield = (SELECT afield FROM bigfailure);
-select * from bigfailure where afield = 18446744071710965857;
-# This is fixed in 5.0, to be uncommented there
-#select * from bigfailure where afield = '18446744071710965857';
-select * from bigfailure where afield = 18446744071710965856+1;
-
-SET @a := (SELECT afield FROM bigfailure);
-SELECT @a;
-SET @a := (select afield from (SELECT afield FROM bigfailure) as b);
-SELECT @a;
-SET @a := (select * from bigfailure where afield = (SELECT afield FROM bigfailure));
-SELECT @a;
-
-drop table bigfailure;
-
-#
-# Bug#16861: User defined variable can have a wrong value if a tmp table was
-# used.
-#
-create table t1(f1 int, f2 int);
-insert into t1 values (1,2),(2,3),(3,1);
-select @var:=f2 from t1 group by f1 order by f2 desc limit 1;
-select @var;
-create table t2 as select @var:=f2 from t1 group by f1 order by f2 desc limit 1;
-select * from t2;
-select @var;
-drop table t1,t2;
-
-#
-# Bug#19024 - SHOW COUNT(*) WARNINGS not return Errors
-#
---error 1064
-insert into city 'blah';
-SHOW COUNT(*) WARNINGS;
-SHOW COUNT(*) ERRORS;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/view_grant.test.THIS b/mysql-test/suite/pbxt/t/view_grant.test.THIS
deleted file mode 100644
index 525d9423bb1..00000000000
--- a/mysql-test/suite/pbxt/t/view_grant.test.THIS
+++ /dev/null
@@ -1,1228 +0,0 @@
-# Can't test with embedded server
--- source include/not_embedded.inc
-
---disable_warnings
-drop database if exists mysqltest;
-drop view if exists v1,v2,v3;
---enable_warnings
-
-
-# simple test of grants
-grant create view on test.* to test@localhost;
-show grants for test@localhost;
-revoke create view on test.* from test@localhost;
-show grants for test@localhost;
-# The grant above creates a new user test@localhost, delete it
-drop user test@localhost;
-
-# grant create view test
-#
-connect (root,localhost,root,,test);
-connection root;
---disable_warnings
-create database mysqltest;
---enable_warnings
-
-create table mysqltest.t1 (a int, b int);
-create table mysqltest.t2 (a int, b int);
-
-grant select on mysqltest.t1 to mysqltest_1@localhost;
-grant create view,select on test.* to mysqltest_1@localhost;
-
-connect (user1,localhost,mysqltest_1,,test);
-connection user1;
-
---error ER_SPECIFIC_ACCESS_DENIED_ERROR
-create definer=root@localhost view v1 as select * from mysqltest.t1;
-create view v1 as select * from mysqltest.t1;
-# try to modify view without DROP privilege on it
---error ER_TABLEACCESS_DENIED_ERROR
-alter view v1 as select * from mysqltest.t1;
---error ER_TABLEACCESS_DENIED_ERROR
-create or replace view v1 as select * from mysqltest.t1;
-# no CRETE VIEW privilege
---error ER_TABLEACCESS_DENIED_ERROR
-create view mysqltest.v2 as select * from mysqltest.t1;
-# no SELECT privilege
---error ER_TABLEACCESS_DENIED_ERROR
-create view v2 as select * from mysqltest.t2;
-
-connection root;
-# check view definer information
-show create view v1;
-
-grant create view,drop,select on test.* to mysqltest_1@localhost;
-
-connection user1;
-# following 'use' command is workaround of Bug#9582 and should be removed
-# when that bug will be fixed
-use test;
-alter view v1 as select * from mysqltest.t1;
-create or replace view v1 as select * from mysqltest.t1;
-
-connection root;
-revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
-revoke all privileges on test.* from mysqltest_1@localhost;
-
-drop database mysqltest;
-drop view test.v1;
-
-#
-# grants per columns
-#
-# MERGE algorithm
---disable_warnings
-create database mysqltest;
---enable_warnings
-
-create table mysqltest.t1 (a int, b int);
-create view mysqltest.v1 (c,d) as select a+1,b+1 from mysqltest.t1;
-grant select (c) on mysqltest.v1 to mysqltest_1@localhost;
-
-connection user1;
-select c from mysqltest.v1;
-# there are no privileges on column 'd'
---error ER_COLUMNACCESS_DENIED_ERROR
-select d from mysqltest.v1;
-
-connection root;
-revoke all privileges on mysqltest.v1 from mysqltest_1@localhost;
-delete from mysql.user where user='mysqltest_1';
-drop database mysqltest;
-
-# TEMPORARY TABLE algorithm
---disable_warnings
-create database mysqltest;
---enable_warnings
-
-create table mysqltest.t1 (a int, b int);
-create algorithm=temptable view mysqltest.v1 (c,d) as select a+1,b+1 from mysqltest.t1;
-grant select (c) on mysqltest.v1 to mysqltest_1@localhost;
-
-connection user1;
-select c from mysqltest.v1;
-# there are no privileges on column 'd'
---error ER_COLUMNACCESS_DENIED_ERROR
-select d from mysqltest.v1;
-
-connection root;
-revoke all privileges on mysqltest.v1 from mysqltest_1@localhost;
-delete from mysql.user where user='mysqltest_1';
-drop database mysqltest;
-
-#
-# EXPLAIN rights
-#
-connection root;
---disable_warnings
-create database mysqltest;
---enable_warnings
-# prepare views and tables
-create table mysqltest.t1 (a int, b int);
-create table mysqltest.t2 (a int, b int);
-create view mysqltest.v1 (c,d) as select a+1,b+1 from mysqltest.t1;
-create algorithm=temptable view mysqltest.v2 (c,d) as select a+1,b+1 from mysqltest.t1;
-create view mysqltest.v3 (c,d) as select a+1,b+1 from mysqltest.t2;
-create algorithm=temptable view mysqltest.v4 (c,d) as select a+1,b+1 from mysqltest.t2;
-grant select on mysqltest.v1 to mysqltest_1@localhost;
-grant select on mysqltest.v2 to mysqltest_1@localhost;
-grant select on mysqltest.v3 to mysqltest_1@localhost;
-grant select on mysqltest.v4 to mysqltest_1@localhost;
-
-connection user1;
-# all selects works
-select c from mysqltest.v1;
-select c from mysqltest.v2;
-select c from mysqltest.v3;
-select c from mysqltest.v4;
-# test of show coluns
-show columns from mysqltest.v1;
-show columns from mysqltest.v2;
-# but explain/show do not
---error ER_VIEW_NO_EXPLAIN
-explain select c from mysqltest.v1;
---error ER_TABLEACCESS_DENIED_ERROR
-show create view mysqltest.v1;
---error ER_VIEW_NO_EXPLAIN
-explain select c from mysqltest.v2;
---error ER_TABLEACCESS_DENIED_ERROR
-show create view mysqltest.v2;
---error ER_VIEW_NO_EXPLAIN
-explain select c from mysqltest.v3;
---error ER_TABLEACCESS_DENIED_ERROR
-show create view mysqltest.v3;
---error ER_VIEW_NO_EXPLAIN
-explain select c from mysqltest.v4;
---error ER_TABLEACCESS_DENIED_ERROR
-show create view mysqltest.v4;
-
-# allow to see one of underlying table
-connection root;
-grant select on mysqltest.t1 to mysqltest_1@localhost;
-connection user1;
-# EXPLAIN of view on above table works
-explain select c from mysqltest.v1;
---error ER_TABLEACCESS_DENIED_ERROR
-show create view mysqltest.v1;
-explain select c from mysqltest.v2;
---error ER_TABLEACCESS_DENIED_ERROR
-show create view mysqltest.v2;
-# but other EXPLAINs do not
---error ER_VIEW_NO_EXPLAIN
-explain select c from mysqltest.v3;
---error ER_TABLEACCESS_DENIED_ERROR
-show create view mysqltest.v3;
---error ER_VIEW_NO_EXPLAIN
-explain select c from mysqltest.v4;
---error ER_TABLEACCESS_DENIED_ERROR
-show create view mysqltest.v4;
-
-# allow to see any view in mysqltest database
-connection root;
-grant show view on mysqltest.* to mysqltest_1@localhost;
-connection user1;
-explain select c from mysqltest.v1;
-show create view mysqltest.v1;
-explain select c from mysqltest.v2;
-show create view mysqltest.v2;
-explain select c from mysqltest.v3;
-show create view mysqltest.v3;
-explain select c from mysqltest.v4;
-show create view mysqltest.v4;
-
-connection root;
-revoke all privileges on mysqltest.* from mysqltest_1@localhost;
-delete from mysql.user where user='mysqltest_1';
-drop database mysqltest;
-
-#
-# UPDATE privileges on VIEW columns and whole VIEW
-#
-connection root;
---disable_warnings
-create database mysqltest;
---enable_warnings
-
-create table mysqltest.t1 (a int, b int, primary key(a));
-insert into mysqltest.t1 values (10,2), (20,3), (30,4), (40,5), (50,10);
-create table mysqltest.t2 (x int);
-insert into mysqltest.t2 values (3), (4), (5), (6);
-create view mysqltest.v1 (a,c) as select a, b+1 from mysqltest.t1;
-create view mysqltest.v2 (a,c) as select a, b from mysqltest.t1;
-create view mysqltest.v3 (a,c) as select a, b+1 from mysqltest.t1;
-
-grant update (a) on mysqltest.v2 to mysqltest_1@localhost;
-grant update on mysqltest.v1 to mysqltest_1@localhost;
-grant select on mysqltest.* to mysqltest_1@localhost;
-
-connection user1;
-use mysqltest;
-# update with rights on VIEW column
-update t2,v1 set v1.a=v1.a+v1.c where t2.x=v1.c;
-select * from t1 order by a; # PBXT : required for order
-update v1 set a=a+c;
-select * from t1 order by a; # PBXT : required for order
-# update with rights on whole VIEW
-update t2,v2 set v2.a=v2.a+v2.c where t2.x=v2.c;
-select * from t1 order by a; # PBXT : required for order
-update v2 set a=a+c;
-select * from t1 order by a; # PBXT : required for order
-# no rights on column
---error ER_COLUMNACCESS_DENIED_ERROR
-update t2,v2 set v2.c=v2.a+v2.c where t2.x=v2.c;
---error ER_COLUMNACCESS_DENIED_ERROR
-update v2 set c=a+c;
-# no rights for view
---error ER_TABLEACCESS_DENIED_ERROR
-update t2,v3 set v3.a=v3.a+v3.c where t2.x=v3.c;
---error ER_TABLEACCESS_DENIED_ERROR
-update v3 set a=a+c;
-
-use test;
-connection root;
-REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
-drop database mysqltest;
-
-#
-# DELETE privileges on VIEW
-#
-connection root;
---disable_warnings
-create database mysqltest;
---enable_warnings
-
-create table mysqltest.t1 (a int, b int, primary key(a));
-insert into mysqltest.t1 values (1,2), (2,3), (3,4), (4,5), (5,10);
-create table mysqltest.t2 (x int);
-insert into mysqltest.t2 values (3), (4), (5), (6);
-create view mysqltest.v1 (a,c) as select a, b+1 from mysqltest.t1;
-create view mysqltest.v2 (a,c) as select a, b+1 from mysqltest.t1;
-
-grant delete on mysqltest.v1 to mysqltest_1@localhost;
-grant select on mysqltest.* to mysqltest_1@localhost;
-
-connection user1;
-use mysqltest;
-# update with rights on VIEW column
-delete from v1 where c < 4;
-select * from t1;
-delete v1 from t2,v1 where t2.x=v1.c;
-select * from t1;
-# no rights for view
---error ER_TABLEACCESS_DENIED_ERROR
-delete v2 from t2,v2 where t2.x=v2.c;
---error ER_TABLEACCESS_DENIED_ERROR
-delete from v2 where c < 4;
-
-use test;
-connection root;
-REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
-drop database mysqltest;
-
-#
-# insert privileges on VIEW
-#
-connection root;
---disable_warnings
-create database mysqltest;
---enable_warnings
-
-create table mysqltest.t1 (a int, b int, primary key(a));
-insert into mysqltest.t1 values (1,2), (2,3);
-create table mysqltest.t2 (x int, y int);
-insert into mysqltest.t2 values (3,4);
-create view mysqltest.v1 (a,c) as select a, b from mysqltest.t1;
-create view mysqltest.v2 (a,c) as select a, b from mysqltest.t1;
-
-grant insert on mysqltest.v1 to mysqltest_1@localhost;
-grant select on mysqltest.* to mysqltest_1@localhost;
-
-connection user1;
-use mysqltest;
-# update with rights on VIEW column
-insert into v1 values (5,6);
-select * from t1;
-insert into v1 select x,y from t2;
-select * from t1;
-# no rights for view
---error ER_TABLEACCESS_DENIED_ERROR
-insert into v2 values (5,6);
---error ER_TABLEACCESS_DENIED_ERROR
-insert into v2 select x,y from t2;
-
-use test;
-connection root;
-REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
-drop database mysqltest;
-
-#
-# test of CREATE VIEW privileges if we have limited privileges
-#
-connection root;
---disable_warnings
-create database mysqltest;
---enable_warnings
-
-create table mysqltest.t1 (a int, b int);
-create table mysqltest.t2 (a int, b int);
-
-grant update on mysqltest.t1 to mysqltest_1@localhost;
-grant update(b) on mysqltest.t2 to mysqltest_1@localhost;
-grant create view,update on test.* to mysqltest_1@localhost;
-
-connection user1;
-
-create view v1 as select * from mysqltest.t1;
-create view v2 as select b from mysqltest.t2;
-# There are not rights on mysqltest.v1
---error ER_TABLEACCESS_DENIED_ERROR
-create view mysqltest.v1 as select * from mysqltest.t1;
-# There are not any rights on mysqltest.t2.a
---error ER_COLUMNACCESS_DENIED_ERROR
-create view v3 as select a from mysqltest.t2;
-
-# give CREATE VIEW privileges (without any privileges for result column)
-connection root;
-create table mysqltest.v3 (b int);
-grant create view on mysqltest.v3 to mysqltest_1@localhost;
-drop table mysqltest.v3;
-connection user1;
-create view mysqltest.v3 as select b from mysqltest.t2;
-
-# give UPDATE privileges
-connection root;
-grant create view, update on mysqltest.v3 to mysqltest_1@localhost;
-drop view mysqltest.v3;
-connection user1;
-create view mysqltest.v3 as select b from mysqltest.t2;
-
-
-# Expression need select privileges
---error ER_COLUMNACCESS_DENIED_ERROR
-create view v4 as select b+1 from mysqltest.t2;
-
-connection root;
-grant create view,update,select on test.* to mysqltest_1@localhost;
-connection user1;
---error ER_COLUMNACCESS_DENIED_ERROR
-create view v4 as select b+1 from mysqltest.t2;
-
-connection root;
-grant update,select(b) on mysqltest.t2 to mysqltest_1@localhost;
-connection user1;
-create view v4 as select b+1 from mysqltest.t2;
-
-connection root;
-REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
-drop database mysqltest;
-drop view v1,v2,v4;
-
-#
-# user with global DB privileges
-#
-connection root;
---disable_warnings
-create database mysqltest;
---enable_warnings
-create table mysqltest.t1 (a int);
-grant all privileges on mysqltest.* to mysqltest_1@localhost;
-
-connection user1;
-use mysqltest;
-create view v1 as select * from t1;
-use test;
-
-connection root;
-revoke all privileges on mysqltest.* from mysqltest_1@localhost;
-drop database mysqltest;
-
-#
-# view definer grants revoking
-#
-connection root;
---disable_warnings
-create database mysqltest;
---enable_warnings
-
-create table mysqltest.t1 (a int, b int);
-
-grant select on mysqltest.t1 to mysqltest_1@localhost;
-grant create view,select on test.* to mysqltest_1@localhost;
-
-connection user1;
-
-create view v1 as select * from mysqltest.t1;
-
-connection root;
-# check view definer information
-show create view v1;
-revoke select on mysqltest.t1 from mysqltest_1@localhost;
---error ER_VIEW_INVALID
-select * from v1;
-grant select on mysqltest.t1 to mysqltest_1@localhost;
-select * from v1;
-REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
-drop view v1;
-drop database mysqltest;
-
-#
-# rights on execution of view underlying functiond (Bug#9505)
-#
-connection root;
---disable_warnings
-create database mysqltest;
---enable_warnings
-
-use mysqltest;
-create table t1 (a int);
-insert into t1 values (1);
-create table t2 (s1 int);
---disable_warnings
-drop function if exists f2;
---enable_warnings
-delimiter //;
-create function f2 () returns int begin declare v int; select s1 from t2
-into v; return v; end//
-delimiter ;//
-create algorithm=TEMPTABLE view v1 as select f2() from t1;
-create algorithm=MERGE view v2 as select f2() from t1;
-create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select f2() from t1;
-create algorithm=MERGE SQL SECURITY INVOKER view v4 as select f2() from t1;
-create SQL SECURITY INVOKER view v5 as select * from v4;
-grant select on v1 to mysqltest_1@localhost;
-grant select on v2 to mysqltest_1@localhost;
-grant select on v3 to mysqltest_1@localhost;
-grant select on v4 to mysqltest_1@localhost;
-grant select on v5 to mysqltest_1@localhost;
-
-connection user1;
-use mysqltest;
-select * from v1;
-select * from v2;
---error ER_VIEW_INVALID
-select * from v3;
---error ER_VIEW_INVALID
-select * from v4;
---error ER_VIEW_INVALID
-select * from v5;
-use test;
-
-connection root;
-drop view v1, v2, v3, v4, v5;
-drop function f2;
-drop table t1, t2;
-use test;
-REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
-drop database mysqltest;
-
-#
-# revertion of previous test, definer of view lost his/her rights to execute
-# function
-#
-
-connection root;
---disable_warnings
-create database mysqltest;
---enable_warnings
-
-use mysqltest;
-create table t1 (a int);
-insert into t1 values (1);
-create table t2 (s1 int);
---disable_warnings
-drop function if exists f2;
---enable_warnings
-delimiter //;
-create function f2 () returns int begin declare v int; select s1 from t2
-into v; return v; end//
-delimiter ;//
-grant select on t1 to mysqltest_1@localhost;
-grant execute on function f2 to mysqltest_1@localhost;
-grant create view on mysqltest.* to mysqltest_1@localhost;
-
-connection user1;
-use mysqltest;
-create algorithm=TEMPTABLE view v1 as select f2() from t1;
-create algorithm=MERGE view v2 as select f2() from t1;
-create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select f2() from t1;
-create algorithm=MERGE SQL SECURITY INVOKER view v4 as select f2() from t1;
-use test;
-
-connection root;
-create view v5 as select * from v1;
-revoke execute on function f2 from mysqltest_1@localhost;
---error ER_VIEW_INVALID
-select * from v1;
---error ER_VIEW_INVALID
-select * from v2;
-select * from v3;
-select * from v4;
---error ER_VIEW_INVALID
-select * from v5;
-
-drop view v1, v2, v3, v4, v5;
-drop function f2;
-drop table t1, t2;
-use test;
-REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
-drop database mysqltest;
-
-#
-# definer/invoker rights for columns
-#
-connection root;
---disable_warnings
-create database mysqltest;
---enable_warnings
-
-use mysqltest;
-create table t1 (a int);
-create table v1 (a int);
-insert into t1 values (1);
-grant select on t1 to mysqltest_1@localhost;
-grant select on v1 to mysqltest_1@localhost;
-grant create view on mysqltest.* to mysqltest_1@localhost;
-drop table v1;
-
-connection user1;
-use mysqltest;
-create algorithm=TEMPTABLE view v1 as select *, a as b from t1;
-create algorithm=MERGE view v2 as select *, a as b from t1;
-create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select *, a as b from t1;
-create algorithm=MERGE SQL SECURITY INVOKER view v4 as select *, a as b from t1;
-create view v5 as select * from v1;
-use test;
-
-connection root;
-revoke select on t1 from mysqltest_1@localhost;
---error ER_VIEW_INVALID
-select * from v1;
---error ER_VIEW_INVALID
-select * from v2;
-select * from v3;
-select * from v4;
---error ER_VIEW_INVALID
-select * from v5;
-
-#drop view v1, v2, v3, v4, v5;
-drop table t1;
-use test;
-REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
-drop database mysqltest;
-
-
-connection root;
---disable_warnings
-create database mysqltest;
---enable_warnings
-
-use mysqltest;
-create table t1 (a int);
-insert into t1 values (1);
-create algorithm=TEMPTABLE view v1 as select *, a as b from t1;
-create algorithm=MERGE view v2 as select *, a as b from t1;
-create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select *, a as b from t1;
-create algorithm=MERGE SQL SECURITY INVOKER view v4 as select *, a as b from t1;
-create SQL SECURITY INVOKER view v5 as select * from v4;
-grant select on v1 to mysqltest_1@localhost;
-grant select on v2 to mysqltest_1@localhost;
-grant select on v3 to mysqltest_1@localhost;
-grant select on v4 to mysqltest_1@localhost;
-grant select on v5 to mysqltest_1@localhost;
-
-connection user1;
-use mysqltest;
-select * from v1;
-select * from v2;
---error ER_VIEW_INVALID
-select * from v3;
---error ER_VIEW_INVALID
-select * from v4;
---error ER_VIEW_INVALID
-select * from v5;
-use test;
-
-connection root;
-drop view v1, v2, v3, v4, v5;
-drop table t1;
-use test;
-REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
-drop database mysqltest;
-
-#
-# Bug#14256 definer in view definition is not fully qualified
-#
---disable_warnings
-drop view if exists v1;
-drop table if exists t1;
---enable_warnings
-
-# Backup anonymous users and remove them. (They get in the way of
-# the one we test with here otherwise.)
-create table t1 as select * from mysql.user where user='';
-delete from mysql.user where user='';
-flush privileges;
-
-# Create the test user
-grant all on test.* to 'test14256'@'%';
-
-connect (test14256,localhost,test14256,,test);
-connection test14256;
-use test;
-
-create view v1 as select 42;
-show create view v1;
-
-select definer into @v1def1 from information_schema.views
- where table_schema = 'test' and table_name='v1';
-drop view v1;
-
-create definer=`test14256`@`%` view v1 as select 42;
-show create view v1;
-
-select definer into @v1def2 from information_schema.views
- where table_schema = 'test' and table_name='v1';
-drop view v1;
-
-select @v1def1, @v1def2, @v1def1=@v1def2;
-
-connection root;
-disconnect test14256;
-drop user test14256;
-
-# Restore the anonymous users.
-insert into mysql.user select * from t1;
-flush privileges;
-
-drop table t1;
-
-#
-# Bug#14726 freeing stack variable in case of an error of opening a view when
-# we have locked tables with LOCK TABLES statement.
-#
-connection root;
---disable_warnings
-create database mysqltest;
---enable_warnings
-
-use mysqltest;
-CREATE TABLE t1 (i INT);
-CREATE VIEW v1 AS SELECT * FROM t1;
-SHOW CREATE VIEW v1;
-GRANT SELECT, LOCK TABLES ON mysqltest.* TO mysqltest_1@localhost;
-
-connection user1;
-
-use mysqltest;
-LOCK TABLES v1 READ;
---error ER_TABLEACCESS_DENIED_ERROR
-SHOW CREATE TABLE v1;
-UNLOCK TABLES;
-use test;
-
-connection root;
-use test;
-drop user mysqltest_1@localhost;
-drop database mysqltest;
-
-#
-# switch to default connection
-#
-disconnect user1;
-disconnect root;
-connection default;
-
-#
-# DEFINER information check
-#
-create definer=some_user@`` sql security invoker view v1 as select 1;
-create definer=some_user@localhost sql security invoker view v2 as select 1;
-show create view v1;
-show create view v2;
-drop view v1;
-drop view v2;
-
-#
-# Bug#18681 View privileges are broken
-#
-CREATE DATABASE mysqltest1;
-CREATE USER readonly@localhost;
-CREATE TABLE mysqltest1.t1 (x INT);
-INSERT INTO mysqltest1.t1 VALUES (1), (2);
-CREATE SQL SECURITY INVOKER VIEW mysqltest1.v_t1 AS SELECT * FROM mysqltest1.t1;
-CREATE SQL SECURITY DEFINER VIEW mysqltest1.v_ts AS SELECT * FROM mysqltest1.t1;
-CREATE SQL SECURITY DEFINER VIEW mysqltest1.v_ti AS SELECT * FROM mysqltest1.t1;
-CREATE SQL SECURITY DEFINER VIEW mysqltest1.v_tu AS SELECT * FROM mysqltest1.t1;
-CREATE SQL SECURITY DEFINER VIEW mysqltest1.v_tus AS SELECT * FROM mysqltest1.t1;
-CREATE SQL SECURITY DEFINER VIEW mysqltest1.v_td AS SELECT * FROM mysqltest1.t1;
-CREATE SQL SECURITY DEFINER VIEW mysqltest1.v_tds AS SELECT * FROM mysqltest1.t1;
-GRANT SELECT, INSERT, UPDATE, DELETE ON mysqltest1.v_t1 TO readonly@localhost;
-GRANT SELECT ON mysqltest1.v_ts TO readonly@localhost;
-GRANT INSERT ON mysqltest1.v_ti TO readonly@localhost;
-GRANT UPDATE ON mysqltest1.v_tu TO readonly@localhost;
-GRANT UPDATE,SELECT ON mysqltest1.v_tus TO readonly@localhost;
-GRANT DELETE ON mysqltest1.v_td TO readonly@localhost;
-GRANT DELETE,SELECT ON mysqltest1.v_tds TO readonly@localhost;
-
-connect (n1,localhost,readonly,,);
-connection n1;
-
---error ER_VIEW_INVALID
-SELECT * FROM mysqltest1.v_t1;
---error ER_VIEW_INVALID
-INSERT INTO mysqltest1.v_t1 VALUES(4);
---error ER_VIEW_INVALID
-DELETE FROM mysqltest1.v_t1 WHERE x = 1;
---error ER_VIEW_INVALID
-UPDATE mysqltest1.v_t1 SET x = 3 WHERE x = 2;
---error ER_VIEW_INVALID
-UPDATE mysqltest1.v_t1 SET x = 3;
---error ER_VIEW_INVALID
-DELETE FROM mysqltest1.v_t1;
---error ER_VIEW_INVALID
-SELECT 1 FROM mysqltest1.v_t1;
---error ER_TABLEACCESS_DENIED_ERROR
-SELECT * FROM mysqltest1.t1;
-
-SELECT * FROM mysqltest1.v_ts;
---error ER_TABLEACCESS_DENIED_ERROR
-SELECT * FROM mysqltest1.v_ts, mysqltest1.t1 WHERE mysqltest1.t1.x = mysqltest1.v_ts.x;
---error ER_TABLEACCESS_DENIED_ERROR
-SELECT * FROM mysqltest1.v_ti;
-
---error ER_TABLEACCESS_DENIED_ERROR
-INSERT INTO mysqltest1.v_ts VALUES (100);
-INSERT INTO mysqltest1.v_ti VALUES (100);
-
---error ER_TABLEACCESS_DENIED_ERROR
-UPDATE mysqltest1.v_ts SET x= 200 WHERE x = 100;
---error ER_TABLEACCESS_DENIED_ERROR
-UPDATE mysqltest1.v_ts SET x= 200;
-UPDATE mysqltest1.v_tu SET x= 200 WHERE x = 100;
-UPDATE mysqltest1.v_tus SET x= 200 WHERE x = 100;
-UPDATE mysqltest1.v_tu SET x= 200;
-
---error ER_TABLEACCESS_DENIED_ERROR
-DELETE FROM mysqltest1.v_ts WHERE x= 200;
---error ER_TABLEACCESS_DENIED_ERROR
-DELETE FROM mysqltest1.v_ts;
---error ER_COLUMNACCESS_DENIED_ERROR
-DELETE FROM mysqltest1.v_td WHERE x= 200;
-DELETE FROM mysqltest1.v_tds WHERE x= 200;
-DELETE FROM mysqltest1.v_td;
-
-connection default;
-disconnect n1;
-DROP VIEW mysqltest1.v_tds;
-DROP VIEW mysqltest1.v_td;
-DROP VIEW mysqltest1.v_tus;
-DROP VIEW mysqltest1.v_tu;
-DROP VIEW mysqltest1.v_ti;
-DROP VIEW mysqltest1.v_ts;
-DROP VIEW mysqltest1.v_t1;
-DROP TABLE mysqltest1.t1;
-DROP USER readonly@localhost;
-DROP DATABASE mysqltest1;
-
-#
-# Bug#14875 Bad view DEFINER makes SHOW CREATE VIEW fail
-#
-CREATE TABLE t1 (a INT PRIMARY KEY);
-INSERT INTO t1 VALUES (1), (2), (3);
-CREATE DEFINER = 'no-such-user'@localhost VIEW v AS SELECT a from t1;
-#--warning ER_VIEW_OTHER_USER
-SHOW CREATE VIEW v;
---error ER_NO_SUCH_USER
-SELECT * FROM v;
-DROP VIEW v;
-DROP TABLE t1;
-USE test;
-
-#
-# Bug#20363 Create view on just created view is now denied
-#
-eval CREATE USER mysqltest_db1@localhost identified by 'PWD';
-eval GRANT ALL ON mysqltest_db1.* TO mysqltest_db1@localhost WITH GRANT OPTION;
-
-# The session with the non root user is needed.
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (session1,localhost,mysqltest_db1,PWD,test);
-
-CREATE SCHEMA mysqltest_db1 ;
-USE mysqltest_db1 ;
-
-CREATE TABLE t1 (f1 INTEGER);
-
-CREATE VIEW view1 AS
-SELECT * FROM t1;
-SHOW CREATE VIEW view1;
-
-CREATE VIEW view2 AS
-SELECT * FROM view1;
---echo # Here comes a suspicious warning
-SHOW CREATE VIEW view2;
---echo # But the view view2 is usable
-SELECT * FROM view2;
-
-CREATE VIEW view3 AS
-SELECT * FROM view2;
-
-SELECT * from view3;
-
-connection default;
-disconnect session1;
-DROP VIEW mysqltest_db1.view3;
-DROP VIEW mysqltest_db1.view2;
-DROP VIEW mysqltest_db1.view1;
-DROP TABLE mysqltest_db1.t1;
-DROP SCHEMA mysqltest_db1;
-DROP USER mysqltest_db1@localhost;
-#
-# Bug#20482 failure on Create join view with sources views/tables
-# in different schemas
-#
---disable_warnings
-CREATE DATABASE test1;
-CREATE DATABASE test2;
---enable_warnings
-
-CREATE TABLE test1.t0 (a VARCHAR(20)) engine=myisam; # PBXT can't mix databases;
-CREATE TABLE test2.t1 (a VARCHAR(20));
-CREATE VIEW test2.t3 AS SELECT * FROM test1.t0;
-CREATE OR REPLACE VIEW test.v1 AS
- SELECT ta.a AS col1, tb.a AS col2 FROM test2.t3 ta, test2.t1 tb;
-
-DROP VIEW test.v1;
-DROP VIEW test2.t3;
-DROP TABLE test2.t1, test1.t0;
-DROP DATABASE test2;
-DROP DATABASE test1;
-
-
-#
-# Bug#20570 CURRENT_USER() in a VIEW with SQL SECURITY DEFINER returns
-# invoker name
-#
---disable_warnings
-DROP VIEW IF EXISTS v1;
-DROP VIEW IF EXISTS v2;
-DROP VIEW IF EXISTS v3;
-DROP FUNCTION IF EXISTS f1;
-DROP FUNCTION IF EXISTS f2;
-DROP PROCEDURE IF EXISTS p1;
---enable_warnings
-
-CREATE SQL SECURITY DEFINER VIEW v1 AS SELECT CURRENT_USER() AS cu;
-
-CREATE FUNCTION f1() RETURNS VARCHAR(77) SQL SECURITY INVOKER
- RETURN CURRENT_USER();
-CREATE SQL SECURITY DEFINER VIEW v2 AS SELECT f1() AS cu;
-
-CREATE PROCEDURE p1(OUT cu VARCHAR(77)) SQL SECURITY INVOKER
- SET cu= CURRENT_USER();
-delimiter |;
-CREATE FUNCTION f2() RETURNS VARCHAR(77) SQL SECURITY INVOKER
-BEGIN
- DECLARE cu VARCHAR(77);
- CALL p1(cu);
- RETURN cu;
-END|
-delimiter ;|
-CREATE SQL SECURITY DEFINER VIEW v3 AS SELECT f2() AS cu;
-
-CREATE USER mysqltest_u1@localhost;
-GRANT ALL ON test.* TO mysqltest_u1@localhost;
-
-connect (conn1, localhost, mysqltest_u1,,);
-
---echo
---echo The following tests should all return 1.
---echo
-SELECT CURRENT_USER() = 'mysqltest_u1@localhost';
-SELECT f1() = 'mysqltest_u1@localhost';
-CALL p1(@cu);
-SELECT @cu = 'mysqltest_u1@localhost';
-SELECT f2() = 'mysqltest_u1@localhost';
-SELECT cu = 'root@localhost' FROM v1;
-SELECT cu = 'root@localhost' FROM v2;
-SELECT cu = 'root@localhost' FROM v3;
-
-disconnect conn1;
-connection default;
-
-DROP VIEW v3;
-DROP FUNCTION f2;
-DROP PROCEDURE p1;
-DROP FUNCTION f1;
-DROP VIEW v2;
-DROP VIEW v1;
-DROP USER mysqltest_u1@localhost;
-
-
-#
-# Bug#17254 Error for DEFINER security on VIEW provides too much info
-#
-connect (root,localhost,root,,);
-connection root;
-CREATE DATABASE db17254;
-USE db17254;
-CREATE TABLE t1 (f1 INT);
-INSERT INTO t1 VALUES (10),(20);
-CREATE USER def_17254@localhost;
-GRANT SELECT ON db17254.* TO def_17254@localhost;
-CREATE USER inv_17254@localhost;
-GRANT SELECT ON db17254.t1 TO inv_17254@localhost;
-GRANT CREATE VIEW ON db17254.* TO def_17254@localhost;
-
-connect (def,localhost,def_17254,,db17254);
-connection def;
-CREATE VIEW v1 AS SELECT * FROM t1;
-
-connection root;
-DROP USER def_17254@localhost;
-
-connect (inv,localhost,inv_17254,,db17254);
-connection inv;
---echo for a user
---error ER_TABLEACCESS_DENIED_ERROR
-SELECT * FROM v1;
-
-connection root;
---echo for a superuser
---error ER_NO_SUCH_USER
-SELECT * FROM v1;
-DROP USER inv_17254@localhost;
-DROP DATABASE db17254;
-disconnect def;
-disconnect inv;
-
-
-#
-# Bug#24404 strange bug with view+permission+prepared statement
-#
---disable_warnings
-DROP DATABASE IF EXISTS mysqltest_db1;
-DROP DATABASE IF EXISTS mysqltest_db2;
---enable_warnings
---error 0,ER_CANNOT_USER
-DROP USER mysqltest_u1;
---error 0,ER_CANNOT_USER
-DROP USER mysqltest_u2;
-
-CREATE USER mysqltest_u1@localhost;
-CREATE USER mysqltest_u2@localhost;
-
-CREATE DATABASE mysqltest_db1;
-CREATE DATABASE mysqltest_db2;
-
-GRANT ALL ON mysqltest_db1.* TO mysqltest_u1@localhost WITH GRANT OPTION;
-GRANT ALL ON mysqltest_db2.* TO mysqltest_u2@localhost;
-
-connect (conn1, localhost, mysqltest_u1, , mysqltest_db1);
-
-CREATE TABLE t1 (i INT);
-INSERT INTO t1 VALUES (1);
-
-# Use view with subquery for better coverage.
-CREATE VIEW v1 AS SELECT i FROM t1 WHERE 1 IN (SELECT * FROM t1);
-
-CREATE TABLE t2 (s CHAR(7));
-INSERT INTO t2 VALUES ('public');
-
-GRANT SELECT ON v1 TO mysqltest_u2@localhost;
-GRANT SELECT ON t2 TO mysqltest_u2@localhost;
-
-connect (conn2, localhost, mysqltest_u2, , mysqltest_db2);
-
-SELECT * FROM mysqltest_db1.v1, mysqltest_db1.t2;
-PREPARE stmt1 FROM "SELECT * FROM mysqltest_db1.t2";
-EXECUTE stmt1;
-PREPARE stmt2 FROM "SELECT * FROM mysqltest_db1.v1, mysqltest_db1.t2";
-EXECUTE stmt2;
-
-connection conn1;
-# Make table 't2' private.
-REVOKE SELECT ON t2 FROM mysqltest_u2@localhost;
-UPDATE t2 SET s = 'private' WHERE s = 'public';
-
-connection conn2;
---error ER_TABLEACCESS_DENIED_ERROR
-SELECT * FROM mysqltest_db1.v1, mysqltest_db1.t2;
---error ER_TABLEACCESS_DENIED_ERROR
-EXECUTE stmt1;
-# Original bug was here: the statement didn't fail.
---error ER_TABLEACCESS_DENIED_ERROR
-EXECUTE stmt2;
-
-# Cleanup.
-disconnect conn2;
-disconnect conn1;
-connection default;
-REVOKE ALL ON mysqltest_db1.* FROM mysqltest_u1@localhost;
-REVOKE ALL ON mysqltest_db2.* FROM mysqltest_u2@localhost;
-DROP DATABASE mysqltest_db1;
-DROP DATABASE mysqltest_db2;
-DROP USER mysqltest_u1@localhost;
-DROP USER mysqltest_u2@localhost;
-
-#
-# Bug#26813 The SUPER privilege is wrongly required to alter a view created
-# by another user.
-#
-connection root;
-CREATE DATABASE db26813;
-USE db26813;
-CREATE TABLE t1(f1 INT, f2 INT);
-CREATE VIEW v1 AS SELECT f1 FROM t1;
-CREATE VIEW v2 AS SELECT f1 FROM t1;
-CREATE VIEW v3 AS SELECT f1 FROM t1;
-CREATE USER u26813@localhost;
-GRANT DROP ON db26813.v1 TO u26813@localhost;
-GRANT CREATE VIEW ON db26813.v2 TO u26813@localhost;
-GRANT DROP, CREATE VIEW ON db26813.v3 TO u26813@localhost;
-GRANT SELECT ON db26813.t1 TO u26813@localhost;
-
-connect (u1,localhost,u26813,,db26813);
-connection u1;
---error ER_TABLEACCESS_DENIED_ERROR
-ALTER VIEW v1 AS SELECT f2 FROM t1;
---error ER_TABLEACCESS_DENIED_ERROR
-ALTER VIEW v2 AS SELECT f2 FROM t1;
---error ER_SPECIFIC_ACCESS_DENIED_ERROR
-ALTER VIEW v3 AS SELECT f2 FROM t1;
-
-connection root;
-SHOW CREATE VIEW v3;
-
-DROP USER u26813@localhost;
-DROP DATABASE db26813;
-disconnect u1;
-
---echo #
---echo # Bug#29908 A user can gain additional access through the ALTER VIEW.
---echo #
-connection root;
-CREATE DATABASE mysqltest_29908;
-USE mysqltest_29908;
-CREATE TABLE t1(f1 INT, f2 INT);
-CREATE USER u29908_1@localhost;
-CREATE DEFINER = u29908_1@localhost VIEW v1 AS SELECT f1 FROM t1;
-CREATE DEFINER = u29908_1@localhost SQL SECURITY INVOKER VIEW v2 AS
- SELECT f1 FROM t1;
-GRANT SELECT, DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v1 TO u29908_1@localhost;
-GRANT SELECT, DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_1@localhost;
-GRANT SELECT ON mysqltest_29908.t1 TO u29908_1@localhost;
-CREATE USER u29908_2@localhost;
-GRANT SELECT, DROP, CREATE VIEW ON mysqltest_29908.v1 TO u29908_2@localhost;
-GRANT SELECT, DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_2@localhost;
-GRANT SELECT ON mysqltest_29908.t1 TO u29908_2@localhost;
-
-connect (u2,localhost,u29908_2,,mysqltest_29908);
---error ER_SPECIFIC_ACCESS_DENIED_ERROR
-ALTER VIEW v1 AS SELECT f2 FROM t1;
---error ER_SPECIFIC_ACCESS_DENIED_ERROR
-ALTER VIEW v2 AS SELECT f2 FROM t1;
-SHOW CREATE VIEW v2;
-
-connect (u1,localhost,u29908_1,,mysqltest_29908);
-ALTER VIEW v1 AS SELECT f2 FROM t1;
-SHOW CREATE VIEW v1;
-ALTER VIEW v2 AS SELECT f2 FROM t1;
-SHOW CREATE VIEW v2;
-
-connection root;
-ALTER VIEW v1 AS SELECT f1 FROM t1;
-SHOW CREATE VIEW v1;
-ALTER VIEW v2 AS SELECT f1 FROM t1;
-SHOW CREATE VIEW v2;
-
-DROP USER u29908_1@localhost;
-DROP USER u29908_2@localhost;
-DROP DATABASE mysqltest_29908;
-disconnect u1;
-disconnect u2;
---echo #######################################################################
-
-#
-# Bug#24040 Create View don't succed with "all privileges" on a database.
-#
-
-# Prepare.
-
---disable_warnings
-DROP DATABASE IF EXISTS mysqltest1;
-DROP DATABASE IF EXISTS mysqltest2;
---enable_warnings
-
-CREATE DATABASE mysqltest1;
-CREATE DATABASE mysqltest2;
-
-# Test.
-
-CREATE TABLE mysqltest1.t1(c1 INT);
-CREATE TABLE mysqltest1.t2(c2 INT);
-CREATE TABLE mysqltest1.t3(c3 INT);
-CREATE TABLE mysqltest1.t4(c4 INT);
-
-INSERT INTO mysqltest1.t1 VALUES (11), (12), (13), (14);
-INSERT INTO mysqltest1.t2 VALUES (21), (22), (23), (24);
-INSERT INTO mysqltest1.t3 VALUES (31), (32), (33), (34);
-INSERT INTO mysqltest1.t4 VALUES (41), (42), (43), (44);
-
-GRANT SELECT ON mysqltest1.t1 TO mysqltest_u1@localhost;
-GRANT INSERT ON mysqltest1.t2 TO mysqltest_u1@localhost;
-GRANT SELECT, UPDATE ON mysqltest1.t3 TO mysqltest_u1@localhost;
-GRANT SELECT, DELETE ON mysqltest1.t4 TO mysqltest_u1@localhost;
-
-GRANT ALL PRIVILEGES ON mysqltest2.* TO mysqltest_u1@localhost;
-
---connect (bug24040_con,localhost,mysqltest_u1,,mysqltest2)
---echo
---echo ---> connection: bug24040_con
-
-SELECT * FROM mysqltest1.t1;
-INSERT INTO mysqltest1.t2 VALUES(25);
-UPDATE mysqltest1.t3 SET c3 = 331 WHERE c3 = 31;
-DELETE FROM mysqltest1.t4 WHERE c4 = 44;
-
-CREATE VIEW v1 AS SELECT * FROM mysqltest1.t1;
-CREATE VIEW v2 AS SELECT * FROM mysqltest1.t2;
-CREATE VIEW v3 AS SELECT * FROM mysqltest1.t3;
-CREATE VIEW v4 AS SELECT * FROM mysqltest1.t4;
-
-SELECT * FROM v1;
-INSERT INTO v2 VALUES(26);
-UPDATE v3 SET c3 = 332 WHERE c3 = 32;
-DELETE FROM v4 WHERE c4 = 43;
-
---error ER_COLUMNACCESS_DENIED_ERROR
-CREATE VIEW v12 AS SELECT c1, c2 FROM mysqltest1.t1, mysqltest1.t2;
-CREATE VIEW v13 AS SELECT c1, c3 FROM mysqltest1.t1, mysqltest1.t3;
-CREATE VIEW v14 AS SELECT c1, c4 FROM mysqltest1.t1, mysqltest1.t4;
-
---error ER_COLUMNACCESS_DENIED_ERROR
-CREATE VIEW v21 AS SELECT c2, c1 FROM mysqltest1.t2, mysqltest1.t1;
---error ER_COLUMNACCESS_DENIED_ERROR
-CREATE VIEW v23 AS SELECT c2, c3 FROM mysqltest1.t2, mysqltest1.t3;
---error ER_COLUMNACCESS_DENIED_ERROR
-CREATE VIEW v24 AS SELECT c2, c4 FROM mysqltest1.t2, mysqltest1.t4;
-
-CREATE VIEW v31 AS SELECT c3, c1 FROM mysqltest1.t3, mysqltest1.t1;
---error ER_COLUMNACCESS_DENIED_ERROR
-CREATE VIEW v32 AS SELECT c3, c2 FROM mysqltest1.t3, mysqltest1.t2;
-CREATE VIEW v34 AS SELECT c3, c4 FROM mysqltest1.t3, mysqltest1.t4;
-
-CREATE VIEW v41 AS SELECT c4, c1 FROM mysqltest1.t4, mysqltest1.t1;
---error ER_COLUMNACCESS_DENIED_ERROR
-CREATE VIEW v42 AS SELECT c4, c2 FROM mysqltest1.t4, mysqltest1.t2;
-CREATE VIEW v43 AS SELECT c4, c3 FROM mysqltest1.t4, mysqltest1.t3;
-
---connection default
---echo
---echo ---> connection: default
-
-SELECT * FROM mysqltest1.t1;
-SELECT * FROM mysqltest1.t2;
-SELECT * FROM mysqltest1.t3 order by c3; # PBXT: order required
-SELECT * FROM mysqltest1.t4;
-
-# Cleanup.
-
-disconnect bug24040_con;
-
-DROP DATABASE mysqltest1;
-DROP DATABASE mysqltest2;
-DROP USER mysqltest_u1@localhost;
-
---echo End of 5.0 tests.
-
-
-#
-# Test that ALTER VIEW accepts DEFINER and ALGORITHM, see bug#16425.
-#
-connection default;
---disable_warnings
-DROP VIEW IF EXISTS v1;
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-CREATE TABLE t1 (i INT);
-CREATE VIEW v1 AS SELECT * FROM t1;
-
-ALTER VIEW v1 AS SELECT * FROM t1;
-SHOW CREATE VIEW v1;
-ALTER DEFINER=no_such@user_1 VIEW v1 AS SELECT * FROM t1;
-SHOW CREATE VIEW v1;
-ALTER ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1;
-SHOW CREATE VIEW v1;
-ALTER ALGORITHM=TEMPTABLE DEFINER=no_such@user_2 VIEW v1 AS SELECT * FROM t1;
-SHOW CREATE VIEW v1;
-
-DROP VIEW v1;
-DROP TABLE t1;
-
-
---disable_query_log
-drop database pbxt;
---enable_query_log
---echo End of 5.1 tests.
diff --git a/mysql-test/suite/pbxt/t/view_query_cache.test b/mysql-test/suite/pbxt/t/view_query_cache.test
deleted file mode 100644
index ab276bb0aa9..00000000000
--- a/mysql-test/suite/pbxt/t/view_query_cache.test
+++ /dev/null
@@ -1,134 +0,0 @@
--- source include/have_query_cache.inc
-#
-# QUERY CACHE options for VIEWs
-#
---disable_warnings
-drop table if exists t1,t2,v1,v2,v3;
-drop view if exists t1,t2,v1,v2,v3;
---enable_warnings
-
-set GLOBAL query_cache_size=1355776;
-flush status;
-create table t1 (a int, b int);
-
-# queries with following views should not be in query cache
-create view v1 (c,d) as select sql_no_cache a,b from t1;
-create view v2 (c,d) as select a+rand(),b from t1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-select * from v1;
-select * from v2;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-select * from v1;
-select * from v2;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-drop view v1,v2;
-
-# SQL_CACHE option
-set query_cache_type=demand;
-flush status;
-# query with view will be cached, but direct acess to table will not
-create view v1 (c,d) as select sql_cache a,b from t1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-select * from v1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-select * from t1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-select * from v1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-select * from t1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-drop view v1;
-set query_cache_type=default;
-
-drop table t1;
-
-#
-# invalidation of view
-#
-create table t1 (a int);
-insert into t1 values (1), (2), (3);
-create view v1 as select a from t1 where a > 1;
-select * from v1;
-alter view v1 as select a from t1 where a > 2;
-select * from v1;
-drop view v1;
--- error 1146
-select * from v1;
-drop table t1;
-
-#
-# join view with QC
-#
-create table t1 (a int, primary key (a), b int);
-create table t2 (a int, primary key (a), b int);
-insert into t2 values (1000, 2000);
-create view v3 (a,b) as select t1.a as a, t2.a as b from t1, t2;
-select * from v3;
-drop view v3;
-drop table t1, t2;
-
-#
-# Bug #13424 locking view with query cache enabled crashes server
-#
-create table t1(f1 int);
-insert into t1 values(1),(2),(3);
-create view v1 as select * from t1;
-set query_cache_wlock_invalidate=1;
-lock tables v1 read /*!32311 local */;
-unlock tables;
-set query_cache_wlock_invalidate=default;
-drop view v1;
-drop table t1;
-
-#
-# BUG#15119: returning temptable view from the query cache.
-#
-flush status;
-create table t1 (a int, b int);
-create algorithm=temptable view v1 as select * from t1;
-select * from v1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-select * from v1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-insert into t1 values (1,1);
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-select * from v1;
-select * from v1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-drop view v1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-drop table t1;
-
-# Reset default environment.
-set GLOBAL query_cache_size=default;
-
---disable_query_log
-drop database pbxt;
---enable_query_log
diff --git a/mysql-test/suite/pbxt/t/xml.test b/mysql-test/suite/pbxt/t/xml.test
deleted file mode 100644
index ef94c7508c4..00000000000
--- a/mysql-test/suite/pbxt/t/xml.test
+++ /dev/null
@@ -1,408 +0,0 @@
-SET @xml='<a aa1="aa1" aa2="aa2">a1<b ba1="ba1">b1<c>c1</c>b2</b>a2</a>';
-SELECT extractValue(@xml,'/a');
-SELECT extractValue(@xml,'/a/b');
-SELECT extractValue(@xml,'/a/b/c');
-SELECT extractValue(@xml,'/a/@aa1');
-SELECT extractValue(@xml,'/a/@aa2');
-SELECT extractValue(@xml,'/a/@*');
-SELECT extractValue(@xml,'//@ba1');
-
-SELECT extractValue(@xml,'//a');
-SELECT extractValue(@xml,'//b');
-SELECT extractValue(@xml,'//c');
-SELECT extractValue(@xml,'/a//b');
-SELECT extractValue(@xml,'/a//c');
-SELECT extractValue(@xml,'//*');
-SELECT extractValue(@xml,'/a//*');
-SELECT extractValue(@xml,'/./a');
-SELECT extractValue(@xml,'/a/b/.');
-SELECT extractValue(@xml,'/a/b/..');
-SELECT extractValue(@xml,'/a/b/../@aa1');
-SELECT extractValue(@xml,'/*');
-SELECT extractValue(@xml,'/*/*');
-SELECT extractValue(@xml,'/*/*/*');
-
-SELECT extractValue(@xml,'/a/child::*');
-SELECT extractValue(@xml,'/a/self::*');
-SELECT extractValue(@xml,'/a/descendant::*');
-SELECT extractValue(@xml,'/a/descendant-or-self::*');
-SELECT extractValue(@xml,'/a/attribute::*');
-SELECT extractValue(@xml,'/a/b/c/parent::*');
-SELECT extractValue(@xml,'/a/b/c/ancestor::*');
-SELECT extractValue(@xml,'/a/b/c/ancestor-or-self::*');
-SELECT extractValue(@xml,'/descendant-or-self::*');
-
-SET @xml='<a>a11<b ba="ba11" ba="ba12">b11</b><b ba="ba21" ba="ba22">b21<c>c1</c>b22</b>a12</a>';
-SELECT extractValue(@xml,'/a/b/c/ancestor-or-self::*');
-SELECT extractValue(@xml,'//@ba');
-
-SET @xml='<a><b>b</b><c>c</c></a>';
-SELECT extractValue(@xml,'/a/b');
-SELECT extractValue(@xml,'/a/c');
-SELECT extractValue(@xml,'/a/child::b');
-SELECT extractValue(@xml,'/a/child::c');
-
-SET @xml='<a><b>b1</b><c>c1</c><b>b2</b><c>c2</c></a>';
-SELECT extractValue(@xml,'/a/b[1]');
-SELECT extractValue(@xml,'/a/b[2]');
-SELECT extractValue(@xml,'/a/c[1]');
-SELECT extractValue(@xml,'/a/c[2]');
-
-SET @xml='<a><b x="xb1" x="xb2"/><c x="xc1" x="xc2"/></a>';
-SELECT extractValue(@xml,'/a//@x');
-SELECT extractValue(@xml,'/a//@x[1]');
-SELECT extractValue(@xml,'/a//@x[2]');
-
-SET @xml='<a><b>b1</b><b>b2</b><c><b>c1b1</b><b>c1b2</b></c><c><b>c2b1</c></b></a>';
-SELECT extractValue(@xml,'//b[1]');
-SELECT extractValue(@xml,'/descendant::b[1]');
-
-SET @xml='<a><b>b1</b><b>b2</b></a>';
-SELECT extractValue(@xml,'/a/b[1+0]');
-SELECT extractValue(@xml,'/a/b[1*1]');
-SELECT extractValue(@xml,'/a/b[--1]');
-SELECT extractValue(@xml,'/a/b[2*1-1]');
-
-SELECT extractValue(@xml,'/a/b[1+1]');
-SELECT extractValue(@xml,'/a/b[1*2]');
-SELECT extractValue(@xml,'/a/b[--2]');
-SELECT extractValue(@xml,'/a/b[1*(3-1)]');
-
-SELECT extractValue(@xml,'//*[1=1]');
-SELECT extractValue(@xml,'//*[1!=1]');
-SELECT extractValue(@xml,'//*[1>1]');
-SELECT extractValue(@xml,'//*[2>1]');
-SELECT extractValue(@xml,'//*[1>2]');
-SELECT extractValue(@xml,'//*[1>=1]');
-SELECT extractValue(@xml,'//*[2>=1]');
-SELECT extractValue(@xml,'//*[1>=2]');
-SELECT extractValue(@xml,'//*[1<1]');
-SELECT extractValue(@xml,'//*[2<1]');
-SELECT extractValue(@xml,'//*[1<2]');
-SELECT extractValue(@xml,'//*[1<=1]');
-SELECT extractValue(@xml,'//*[2<=1]');
-SELECT extractValue(@xml,'//*[1<=2]');
-
-SET @xml='<a><b>b11<c>c11</c></b><b>b21<c>c21</c></b></a>';
-SELECT extractValue(@xml,'/a/b[c="c11"]');
-SELECT extractValue(@xml,'/a/b[c="c21"]');
-
-SET @xml='<a><b c="c11">b11</b><b c="c21">b21</b></a>';
-SELECT extractValue(@xml,'/a/b[@c="c11"]');
-SELECT extractValue(@xml,'/a/b[@c="c21"]');
-
-SET @xml='<a>a1<b c="c11">b11<d>d11</d></b><b c="c21">b21<d>d21</d></b></a>';
-SELECT extractValue(@xml, '/a/b[@c="c11"]/d');
-SELECT extractValue(@xml, '/a/b[@c="c21"]/d');
-SELECT extractValue(@xml, '/a/b[d="d11"]/@c');
-SELECT extractValue(@xml, '/a/b[d="d21"]/@c');
-SELECT extractValue(@xml, '/a[b="b11"]');
-SELECT extractValue(@xml, '/a[b/@c="c11"]');
-SELECT extractValue(@xml, '/a[b/d="d11"]');
-SELECT extractValue(@xml, '/a[/a/b="b11"]');
-SELECT extractValue(@xml, '/a[/a/b/@c="c11"]');
-SELECT extractValue(@xml, '/a[/a/b/d="d11"]');
-
-SELECT extractValue('<a>a</a>', '/a[false()]');
-SELECT extractValue('<a>a</a>', '/a[true()]');
-SELECT extractValue('<a>a</a>', '/a[not(false())]');
-SELECT extractValue('<a>a</a>', '/a[not(true())]');
-SELECT extractValue('<a>a</a>', '/a[true() and true()]');
-SELECT extractValue('<a>a</a>', '/a[true() and false()]');
-SELECT extractValue('<a>a</a>', '/a[false()and false()]');
-SELECT extractValue('<a>a</a>', '/a[false()and true()]');
-SELECT extractValue('<a>a</a>', '/a[true() or true()]');
-SELECT extractValue('<a>a</a>', '/a[true() or false()]');
-SELECT extractValue('<a>a</a>', '/a[false()or false()]');
-SELECT extractValue('<a>a</a>', '/a[false()or true()]');
-
-SET @xml='<a>ab<b c="c" c="e">b1</b><b c="d">b2</b><b c="f" c="e">b3</b></a>';
-select extractValue(@xml,'/a/b[@c="c"]');
-select extractValue(@xml,'/a/b[@c="d"]');
-select extractValue(@xml,'/a/b[@c="e"]');
-select extractValue(@xml,'/a/b[not(@c="e")]');
-select extractValue(@xml,'/a/b[@c!="e"]');
-select extractValue(@xml,'/a/b[@c="c" or @c="d"]');
-select extractValue(@xml,'/a/b[@c="c" and @c="e"]');
-
-SET @xml='<a><b c="c" d="d">b1</b><b d="d" e="e">b2</b></a>';
-select extractValue(@xml,'/a/b[@c]');
-select extractValue(@xml,'/a/b[@d]');
-select extractValue(@xml,'/a/b[@e]');
-select extractValue(@xml,'/a/b[not(@c)]');
-select extractValue(@xml,'/a/b[not(@d)]');
-select extractValue(@xml,'/a/b[not(@e)]');
-
-select extractValue(@xml, '/a/b[boolean(@c) or boolean(@d)]');
-select extractValue(@xml, '/a/b[boolean(@c) or boolean(@e)]');
-select extractValue(@xml, '/a/b[boolean(@d) or boolean(@e)]');
-select extractValue(@xml, '/a/b[boolean(@c) and boolean(@d)]');
-select extractValue(@xml, '/a/b[boolean(@c) and boolean(@e)]');
-select extractValue(@xml, '/a/b[boolean(@d) and boolean(@e)]');
-
-select extractValue(@xml, '/a/b[@c or @d]');
-select extractValue(@xml, '/a/b[@c or @e]');
-select extractValue(@xml, '/a/b[@d or @e]');
-select extractValue(@xml, '/a/b[@c and @d]');
-select extractValue(@xml, '/a/b[@c and @e]');
-select extractValue(@xml, '/a/b[@d and @e]');
-
-SET @xml='<a><b c="c">b1</b><b>b2</b></a>';
-SELECT extractValue(@xml,'/a/b[@*]');
-SELECT extractValue(@xml,'/a/b[not(@*)]');
-
-SELECT extractValue('<a>a</a>', '/a[ceiling(3.1)=4]');
-SELECT extractValue('<a>a</a>', '/a[floor(3.1)=3]');
-SELECT extractValue('<a>a</a>', '/a[round(3.1)=3]');
-SELECT extractValue('<a>a</a>', '/a[round(3.8)=4]');
-
-SELECT extractValue('<a><b>b</b><c>c</c></a>', '/a/b | /a/c');
-
-select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[position()=1]');
-select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[position()=2]');
-select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[position()=3]');
-select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[1=position()]');
-select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[2=position()]');
-select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[3=position()]');
-select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[2>=position()]');
-select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[2<=position()]');
-select extractValue('<a b="b1" b="b2" b="b3"/>','/a/@b[position()=3 or position()=2]');
-
-SELECT extractValue('<a>a<b>a1<c>c1</c></b><b>a2</b></a>','/a/b[count(c)=0]');
-SELECT extractValue('<a>a<b>a1<c>c1</c></b><b>a2</b></a>','/a/b[count(c)=1]');
-select extractValue('<a>a1<b ba="1" ba="2">b1</b><b>b2</b>4</a>','/a/b[sum(@ba)=3]');
-
-select extractValue('<a><b>b1</b><b>b2</b></a>','/a/b[1]');
-select extractValue('<a><b>b1</b><b>b2</b></a>','/a/b[boolean(1)]');
-select extractValue('<a><b>b1</b><b>b2</b></a>','/a/b[true()]');
-select extractValue('<a><b>b1</b><b>b2</b></a>','/a/b[number(true())]');
-
-select extractValue('<a>ab</a>','/a[contains("abc","b")]');
-select extractValue('<a>ab</a>','/a[contains(.,"a")]');
-select extractValue('<a>ab</a>','/a[contains(.,"b")]');
-select extractValue('<a>ab</a>','/a[contains(.,"c")]');
-
-select extractValue('<a b="1">ab</a>','/a[concat(@b,"2")="12"]');
-
-SET @xml='<a b="11" b="12" b="21" b="22">ab</a>';
-select extractValue(@xml, '/a/@b[substring(.,2)="1"]');
-select extractValue(@xml, '/a/@b[substring(.,2)="2"]');
-select extractValue(@xml, '/a/@b[substring(.,1,1)="1"]');
-select extractValue(@xml, '/a/@b[substring(.,1,1)="2"]');
-select extractValue(@xml, '/a/@b[substring(.,2,1)="1"]');
-select extractValue(@xml, '/a/@b[substring(.,2,1)="2"]');
-
-#
-# Bug#16319: XML: extractvalue() returns syntax errors for some functions
-#
-SET @xml='<a><b>b1</b><b>b2</b></a>';
-SELECT extractValue(@xml, '/a/b[string-length("x")=1]');
-SELECT extractValue(@xml, '/a/b[string-length("xx")=2]');
-SELECT extractValue(@xml, '/a/b[string-length("xxx")=2]');
-SELECT extractValue(@xml, '/a/b[string-length("x")]');
-SELECT extractValue(@xml, '/a/b[string-length("xx")]');
-SELECT extractValue(@xml, '/a/b[string-length()]');
---error 1105
-SELECT extractValue(@xml, 'string-length()');
-SELECT extractValue(@xml, 'string-length("x")');
-
-SET @xml='<a b="b11" b="b12" b="b21" b="22"/>';
-select extractValue(@xml,'/a/@b');
-select extractValue(@xml,'/a/@b[contains(.,"1")]');
-select extractValue(@xml,'/a/@b[contains(.,"1")][contains(.,"2")]');
-select extractValue(@xml,'/a/@b[contains(.,"1")][contains(.,"2")][2]');
-
-SET @xml='<a>a1<b>b1<c>c1</c>b2</b>a2</a>';
-select UpdateXML('<a>a1<b>b1<c>c1</c>b2</b>a2</a>','/a/b/c','+++++++++');
-select UpdateXML('<a>a1<b>b1<c>c1</c>b2</b>a2</a>','/a/b/c','<c1>+++++++++</c1>');
-select UpdateXML('<a>a1<b>b1<c>c1</c>b2</b>a2</a>','/a/b/c','<c1/>');
-
-SET @xml='<a><b>bb</b></a>';
-select UpdateXML(@xml, '/a/b', '<b>ccc</b>');
-
-SET @xml='<a aa1="aa1" aa2="aa2"><b bb1="bb1" bb2="bb2">bb</b></a>';
-select UpdateXML(@xml, '/a/b', '<b>ccc</b>');
-select UpdateXML(@xml, '/a/@aa1', '');
-select UpdateXML(@xml, '/a/@aa1', 'aa3="aa3"');
-select UpdateXML(@xml, '/a/@aa2', '');
-select UpdateXML(@xml, '/a/@aa2', 'aa3="aa3"');
-select UpdateXML(@xml, '/a/b/@bb1', '');
-select UpdateXML(@xml, '/a/b/@bb1', 'bb3="bb3"');
-select UpdateXML(@xml, '/a/b/@bb2', '');
-select UpdateXML(@xml, '/a/b/@bb2', 'bb3="bb3"');
-
-#
-# Bug#16234 XML: Crash if ExtractValue()
-#
-SET @xml= '<order><clerk>lesser wombat</clerk></order>';
-select extractvalue(@xml,'order/clerk');
-select extractvalue(@xml,'/order/clerk');
-
-#
-# Bug#16314 XML: extractvalue() crash if vertical bar
-#
-select extractvalue('<a><b>B</b></a>','/a|/b');
-select extractvalue('<a><b>B</b></a>','/a|b');
-select extractvalue('<a>a<b>B</b></a>','/a|/b');
-select extractvalue('<a>a<b>B</b></a>','/a|b');
-select extractvalue('<a>a<b>B</b></a>','a|/b');
-
-#
-# Bug#16312 XML: extractvalue() crash if angle brackets
-#
---error 1105
-select extractvalue('<a>A</a>','/<a>');
-
-#
-# Bug#16313 XML: extractvalue() ignores '!' in names
-#
---error 1105
-select extractvalue('<a><b>b</b><b!>b!</b!></a>','//b!');
-
-#
-# Bug #16315 XML: extractvalue() handles self badly
-#
-select extractvalue('<a>A<b>B<c>C</c></b></a>','/a/descendant::*');
-select extractvalue('<a>A<b>B<c>C</c></b></a>','/a/self::*');
-select extractvalue('<a>A<b>B<c>C</c></b></a>','/a/descendant-or-self::*');
-# Bug #16320 XML: extractvalue() won't accept names containing underscores
-#
-select extractvalue('<A_B>A</A_B>','/A_B');
-
-#
-# Bug#16318: XML: extractvalue() incorrectly returns last() = 1
-#
-select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[position()]');
-select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)=last()]');
-select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[last()]');
-select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[last()-1]');
-select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[last()=1]');
-select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[last()=2]');
-select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[last()=position()]');
-select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)]');
-select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)-1]');
-select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)=1]');
-select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)=2]');
-select extractvalue('<a>A<b>B1</b><b>B2</b></a>','/a/b[count(.)=position()]');
-#
-# Bug#16316: XML: extractvalue() is case-sensitive with contains()
-#
-select extractvalue('<a>Jack</a>','/a[contains(../a,"J")]');
-select extractvalue('<a>Jack</a>','/a[contains(../a,"j")]');
-select extractvalue('<a>Jack</a>','/a[contains(../a,"j")]' collate latin1_bin);
-select extractvalue('<a>Jack</a>' collate latin1_bin,'/a[contains(../a,"j")]');
-
-#
-# Bug#18285: ExtractValue not returning character
-# data within <![CDATA[]]> as expected
-#
-select ExtractValue('<tag1><![CDATA[test]]></tag1>','/tag1');
-
-#
-# Bug#18201: XML: ExtractValue works even if the xml fragment
-# is not well-formed xml
-#
-select extractValue('<a>a','/a');
-select extractValue('<a>a<','/a');
-select extractValue('<a>a</','/a');
-select extractValue('<a>a</a','/a');
-select extractValue('<a>a</a></b>','/a');
-select extractValue('<a b=>a</a>','/a');
-
-#
-# Bug #18171 XML: ExtractValue: the XPath position()
-# function crashes the server!
-#
---error 1105
-select extractValue('<e>1</e>','position()');
---error 1105
-select extractValue('<e>1</e>','last()');
-
-
-#
-# Bug #18172 XML: Extractvalue() accepts mallformed
-# XPath without a XPath syntax error
-#
---error 1105
-select extractValue('<e><a>1</a></e>','/e/');
-
-#
-# Bug#16233: XML: ExtractValue() fails with special characters
-#
-set names utf8;
-select extractValue('<Ñ><r>r</r></Ñ>','/Ñ/r');
-select extractValue('<r><Ñ>Ñ</Ñ></r>','/r/Ñ');
-select extractValue('<Ñ r="r"/>','/Ñ/@r');
-select extractValue('<r Ñ="Ñ"/>','/r/@Ñ');
---disable_warnings
-DROP PROCEDURE IF EXISTS p2;
---enable_warnings
-DELIMITER //;
-CREATE PROCEDURE p2 ()
-BEGIN
- DECLARE p LONGTEXT CHARACTER SET UTF8 DEFAULT '<Ñ><r>A</r></Ñ>';
- SELECT EXTRACTVALUE(p,'/Ñ/r');
-END//
-DELIMITER ;//
-CALL p2();
-DROP PROCEDURE p2;
-
-#
-# Bug#18170: XML: ExtractValue():
-# XPath expression can't use QNames (colon in names)
-#
-select extractValue('<ns:element xmlns:ns="myns"/>','count(ns:element)');
-select extractValue('<ns:element xmlns:ns="myns">a</ns:element>','/ns:element');
-select extractValue('<ns:element xmlns:ns="myns">a</ns:element>','/ns:element/@xmlns:ns');
-
-#
-# Bug#20795 extractvalue() won't accept names containing a dot (.)
-#
-select extractValue('<foo><foo.bar>Data</foo.bar><something>Otherdata</something></foo>','/foo/foo.bar');
-select extractValue('<foo><foo.bar>Data</foo.bar><something>Otherdata</something></foo>','/foo/something');
-
-#
-# Bug#20854 XML functions: wrong result in ExtractValue
-#
---error 1105
-select extractValue('<zot><tim0><01>10:39:15</01><02>140</02></tim0></zot>','/zot/tim0/02');
-select extractValue('<zot><tim0><01>10:39:15</01><02>140</02></tim0></zot>','//*');
-# dot and dash are bad identtifier start character
-select extractValue('<.>test</.>','//*');
-select extractValue('<->test</->','//*');
-# semicolon is good identifier start character
-select extractValue('<:>test</:>','//*');
-# underscore is good identifier start character
-select extractValue('<_>test</_>','//*');
-# dot, dash, underscore and semicolon are good identifier middle characters
-select extractValue('<x.-_:>test</x.-_:>','//*');
-
-#
-# Bug#22823 gt and lt operators appear to be
-# reversed in ExtractValue() command
-#
-set @xml= "<entry><id>pt10</id><pt>10</pt></entry><entry><id>pt50</id><pt>50</pt></entry>";
-select ExtractValue(@xml, "/entry[(pt=10)]/id");
-select ExtractValue(@xml, "/entry[(pt!=10)]/id");
-select ExtractValue(@xml, "/entry[(pt<10)]/id");
-select ExtractValue(@xml, "/entry[(pt<=10)]/id");
-select ExtractValue(@xml, "/entry[(pt>10)]/id");
-select ExtractValue(@xml, "/entry[(pt>=10)]/id");
-select ExtractValue(@xml, "/entry[(pt=50)]/id");
-select ExtractValue(@xml, "/entry[(pt!=50)]/id");
-select ExtractValue(@xml, "/entry[(pt<50)]/id");
-select ExtractValue(@xml, "/entry[(pt<=50)]/id");
-select ExtractValue(@xml, "/entry[(pt>50)]/id");
-select ExtractValue(@xml, "/entry[(pt>=50)]/id");
-select ExtractValue(@xml, "/entry[(10=pt)]/id");
-select ExtractValue(@xml, "/entry[(10!=pt)]/id");
-select ExtractValue(@xml, "/entry[(10>pt)]/id");
-select ExtractValue(@xml, "/entry[(10>=pt)]/id");
-select ExtractValue(@xml, "/entry[(10<pt)]/id");
-select ExtractValue(@xml, "/entry[(10<=pt)]/id");
-select ExtractValue(@xml, "/entry[(50=pt)]/id");
-select ExtractValue(@xml, "/entry[(50!=pt)]/id");
-select ExtractValue(@xml, "/entry[(50>pt)]/id");
-select ExtractValue(@xml, "/entry[(50>=pt)]/id");
-select ExtractValue(@xml, "/entry[(50<pt)]/id");
-select ExtractValue(@xml, "/entry[(50<=pt)]/id");