summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/my_base.h4
-rw-r--r--include/my_pthread.h3
-rw-r--r--mysql-test/include/mix1.inc35
-rw-r--r--mysql-test/r/binary.result38
-rw-r--r--mysql-test/r/create.result638
-rw-r--r--mysql-test/r/ctype_collate.result8
-rw-r--r--mysql-test/r/ctype_utf8.result37
-rw-r--r--mysql-test/r/errors.result14
-rw-r--r--mysql-test/r/events_bugs.result53
-rw-r--r--mysql-test/r/innodb_mysql.result15
-rw-r--r--mysql-test/r/rpl_partition.result195
-rw-r--r--mysql-test/r/rpl_switch_stm_row_mixed.result4
-rw-r--r--mysql-test/r/subselect.result33
-rw-r--r--mysql-test/r/type_enum.result39
-rw-r--r--mysql-test/t/binary.test38
-rw-r--r--mysql-test/t/create.test333
-rw-r--r--mysql-test/t/ctype_collate.test11
-rw-r--r--mysql-test/t/ctype_utf8.test25
-rw-r--r--mysql-test/t/errors.test13
-rw-r--r--mysql-test/t/events_bugs.test64
-rw-r--r--mysql-test/t/rpl_partition.test160
-rw-r--r--mysql-test/t/subselect.test42
-rw-r--r--mysql-test/t/type_enum.test37
-rw-r--r--sql-common/client.c1
-rw-r--r--sql/event_data_objects.cc18
-rw-r--r--sql/field_conv.cc17
-rw-r--r--sql/ha_partition.cc3
-rw-r--r--sql/handler.h11
-rw-r--r--sql/item.cc12
-rw-r--r--sql/item_subselect.cc3
-rw-r--r--sql/item_sum.cc4
-rw-r--r--sql/item_sum.h9
-rw-r--r--sql/log_event.cc6
-rw-r--r--sql/sp.cc5
-rw-r--r--sql/sql_acl.cc45
-rw-r--r--sql/sql_class.h1
-rw-r--r--sql/sql_insert.cc128
-rw-r--r--sql/sql_parse.cc9
-rw-r--r--sql/sql_select.cc54
-rw-r--r--sql/sql_select.h4
-rw-r--r--sql/sql_servers.cc6
-rw-r--r--sql/sql_update.cc23
-rw-r--r--sql/table.cc14
-rw-r--r--storage/myisam/mi_key.c12
-rw-r--r--storage/myisam/mi_open.c2
-rw-r--r--strings/ctype-simple.c2
46 files changed, 2074 insertions, 154 deletions
diff --git a/include/my_base.h b/include/my_base.h
index 503d858a41c..9a2b374a866 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -401,7 +401,9 @@ enum ha_base_keytype {
#define HA_ERR_AUTOINC_READ_FAILED 166 /* Failed to get next autoinc value */
#define HA_ERR_AUTOINC_ERANGE 167 /* Failed to set row autoinc value */
#define HA_ERR_GENERIC 168 /* Generic error */
-#define HA_ERR_LAST 168 /*Copy last error nr.*/
+#define HA_ERR_RECORD_IS_THE_SAME 169 /* row not actually updated :
+ new values same as the old values */
+#define HA_ERR_LAST 169 /*Copy last error nr.*/
/* Add error numbers before HA_ERR_LAST and change it accordingly. */
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)
diff --git a/include/my_pthread.h b/include/my_pthread.h
index e2cce40182d..27b621de925 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -181,8 +181,7 @@ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
#define my_pthread_setprio(A,B) SetThreadPriority(GetCurrentThread(), (B))
#define pthread_kill(A,B) pthread_dummy(0)
-#define pthread_join(A,B) \
- ((WaitForSingleObject((A), INFINITE) != WAIT_OBJECT_0) || !CloseHandle(A))
+#define pthread_join(A,B) (WaitForSingleObject((A), INFINITE) != WAIT_OBJECT_0)
/* Dummy defines for easier code */
#define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc
index cc2f0e0588e..2aca2ba3698 100644
--- a/mysql-test/include/mix1.inc
+++ b/mysql-test/include/mix1.inc
@@ -672,6 +672,41 @@ SELECT * FROM t3 WHERE a = 'uk';
DROP TABLE t1,t2,t3;
+
+#
+# Bug #29154: LOCK TABLES is not atomic when >1 InnoDB tables are locked
+#
+
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT) ENGINE=InnoDB;
+
+CONNECT (c1,localhost,root,,);
+CONNECT (c2,localhost,root,,);
+
+--echo switch to connection c1
+CONNECTION c1;
+SET AUTOCOMMIT=0;
+INSERT INTO t2 VALUES (1);
+
+--echo switch to connection c2
+CONNECTION c2;
+SET AUTOCOMMIT=0;
+--error ER_LOCK_WAIT_TIMEOUT
+LOCK TABLES t1 READ, t2 READ;
+
+--echo switch to connection c1
+CONNECTION c1;
+COMMIT;
+INSERT INTO t1 VALUES (1);
+
+--echo switch to connection default
+CONNECTION default;
+SET AUTOCOMMIT=default;
+DISCONNECT c1;
+DISCONNECT c2;
+DROP TABLE t1,t2;
+
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/r/binary.result b/mysql-test/r/binary.result
index ccafa43c7ab..be87c25e932 100644
--- a/mysql-test/r/binary.result
+++ b/mysql-test/r/binary.result
@@ -160,3 +160,41 @@ hex(col1)
62000000000000000000
62200000000000000000
drop table t1;
+CREATE TABLE t1 (
+a binary(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
+index idx(a)
+);
+INSERT INTO t1 SET a=unhex('1F9480179366F2BF567E1C4B964C1EF029087575');
+INSERT INTO t1 SET a=unhex('1F9480179366F2BF567E1C4B964C1EF029082020');
+INSERT INTO t1 SET a=unhex('1F9480179366F2BF567E1C4B964C1EF029080707');
+SELECT hex(a) FROM t1 order by a;
+hex(a)
+1F9480179366F2BF567E1C4B964C1EF029080707
+1F9480179366F2BF567E1C4B964C1EF029082020
+1F9480179366F2BF567E1C4B964C1EF029087575
+EXPLAIN SELECT hex(a) FROM t1 order by a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL idx 20 NULL 3 Using index
+SELECT hex(a) from t1 WHERE a=unhex('1F9480179366F2BF567E1C4B964C1EF029082020');
+hex(a)
+1F9480179366F2BF567E1C4B964C1EF029082020
+EXPLAIN
+SELECT hex(a) from t1 WHERE a=unhex('1F9480179366F2BF567E1C4B964C1EF029082020');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref idx idx 20 const 1 Using where; Using index
+SELECT hex(a) from t1 WHERE a=unhex('1F9480179366F2BF567E1C4B964C1EF02908');
+hex(a)
+DROP TABLE t1;
+CREATE TABLE t1 (
+id numeric(20) NOT NULL,
+lang varchar(8) NOT NULL,
+msg varchar(32) NOT NULL,
+PRIMARY KEY (id,lang)
+);
+INSERT INTO t1 VALUES (33, 'en', 'zzzzzzz');
+INSERT INTO t1 VALUES (31, 'en', 'xxxxxxx');
+INSERT INTO t1 VALUES (32, 'en', 'yyyyyyy');
+SELECT * FROM t1 WHERE id=32;
+id lang msg
+32 en yyyyyyy
+DROP TABLE t1;
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index e73b74ccac3..f2bff8275d8 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -878,6 +878,644 @@ unlock tables;
drop table t1, t2;
create table t1 (upgrade int);
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,
+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)
+);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` int(11) DEFAULT NULL,
+ `c4` int(11) DEFAULT NULL,
+ `c5` int(11) DEFAULT NULL,
+ `c6` int(11) DEFAULT NULL,
+ `c7` int(11) DEFAULT NULL,
+ `c8` int(11) DEFAULT NULL,
+ `c9` int(11) DEFAULT NULL,
+ `c10` int(11) DEFAULT NULL,
+ `c11` int(11) DEFAULT NULL,
+ `c12` int(11) DEFAULT NULL,
+ `c13` int(11) DEFAULT NULL,
+ `c14` int(11) DEFAULT NULL,
+ `c15` int(11) DEFAULT NULL,
+ `c16` int(11) DEFAULT NULL,
+ 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`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+flush tables;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` int(11) DEFAULT NULL,
+ `c4` int(11) DEFAULT NULL,
+ `c5` int(11) DEFAULT NULL,
+ `c6` int(11) DEFAULT NULL,
+ `c7` int(11) DEFAULT NULL,
+ `c8` int(11) DEFAULT NULL,
+ `c9` int(11) DEFAULT NULL,
+ `c10` int(11) DEFAULT NULL,
+ `c11` int(11) DEFAULT NULL,
+ `c12` int(11) DEFAULT NULL,
+ `c13` int(11) DEFAULT NULL,
+ `c14` int(11) DEFAULT NULL,
+ `c15` int(11) DEFAULT NULL,
+ `c16` int(11) DEFAULT NULL,
+ 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`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+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;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` int(11) DEFAULT NULL,
+ `c4` int(11) DEFAULT NULL,
+ `c5` int(11) DEFAULT NULL,
+ `c6` int(11) DEFAULT NULL,
+ `c7` int(11) DEFAULT NULL,
+ `c8` int(11) DEFAULT NULL,
+ `c9` int(11) DEFAULT NULL,
+ `c10` int(11) DEFAULT NULL,
+ `c11` int(11) DEFAULT NULL,
+ `c12` int(11) DEFAULT NULL,
+ `c13` int(11) DEFAULT NULL,
+ `c14` int(11) DEFAULT NULL,
+ `c15` int(11) DEFAULT NULL,
+ `c16` int(11) DEFAULT NULL,
+ 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`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+flush tables;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` int(11) DEFAULT NULL,
+ `c4` int(11) DEFAULT NULL,
+ `c5` int(11) DEFAULT NULL,
+ `c6` int(11) DEFAULT NULL,
+ `c7` int(11) DEFAULT NULL,
+ `c8` int(11) DEFAULT NULL,
+ `c9` int(11) DEFAULT NULL,
+ `c10` int(11) DEFAULT NULL,
+ `c11` int(11) DEFAULT NULL,
+ `c12` int(11) DEFAULT NULL,
+ `c13` int(11) DEFAULT NULL,
+ `c14` int(11) DEFAULT NULL,
+ `c15` int(11) DEFAULT NULL,
+ `c16` int(11) DEFAULT NULL,
+ 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`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+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);
+ERROR 42000: Too many keys specified; max 64 keys allowed
+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, c17 int);
+alter table t1 add key i1 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16, c17);
+ERROR 42000: Too many key parts specified; max 16 parts allowed
+alter table t1 add key
+a001_long_123456789_123456789_123456789_123456789_123456789_12345 (c1);
+ERROR 42000: Identifier name 'a001_long_123456789_123456789_123456789_123456789_123456789_12345' is too long
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` int(11) DEFAULT NULL,
+ `c4` int(11) DEFAULT NULL,
+ `c5` int(11) DEFAULT NULL,
+ `c6` int(11) DEFAULT NULL,
+ `c7` int(11) DEFAULT NULL,
+ `c8` int(11) DEFAULT NULL,
+ `c9` int(11) DEFAULT NULL,
+ `c10` int(11) DEFAULT NULL,
+ `c11` int(11) DEFAULT NULL,
+ `c12` int(11) DEFAULT NULL,
+ `c13` int(11) DEFAULT NULL,
+ `c14` int(11) DEFAULT NULL,
+ `c15` int(11) DEFAULT NULL,
+ `c16` int(11) DEFAULT NULL,
+ `c17` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
End of 5.0 tests
CREATE TABLE t1 (a int, b int);
insert into t1 values (1,1),(1,2);
diff --git a/mysql-test/r/ctype_collate.result b/mysql-test/r/ctype_collate.result
index c5d433cd080..5417c9da47e 100644
--- a/mysql-test/r/ctype_collate.result
+++ b/mysql-test/r/ctype_collate.result
@@ -595,3 +595,11 @@ EXPLAIN SELECT * FROM t1 WHERE s2 LIKE 'a' COLLATE latin1_german1_ci;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL s2 NULL NULL NULL 10 Using where
DROP TABLE t1;
+create table t1(f1 varchar(10) character set latin2 collate latin2_hungarian_ci, key(f1));
+insert into t1 set f1=0x3F3F9DC73F;
+insert into t1 set f1=0x3F3F1E563F;
+insert into t1 set f1=0x3F3F;
+check table t1 extended;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 8601e6890de..4778e9a6296 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -1657,3 +1657,40 @@ colA colB colA colB
1 foo 1 foo
2 foo bar 2 foo bar
DROP TABLE t1, t2;
+SELECT 'н1234567890' UNION SELECT _binary '1';
+н1234567890
+н1234567890
+1
+SELECT 'н1234567890' UNION SELECT 1;
+н1234567890
+н1234567890
+1
+SELECT '1' UNION SELECT 'н1234567890';
+1
+1
+н1234567890
+SELECT 1 UNION SELECT 'н1234567890';
+1
+1
+н1234567890
+CREATE TABLE t1 (c VARCHAR(11)) CHARACTER SET utf8;
+CREATE TABLE t2 (b CHAR(1) CHARACTER SET binary, i INT);
+INSERT INTO t1 (c) VALUES ('н1234567890');
+INSERT INTO t2 (b, i) VALUES ('1', 1);
+SELECT c FROM t1 UNION SELECT b FROM t2;
+c
+н1234567890
+1
+SELECT c FROM t1 UNION SELECT i FROM t2;
+c
+н1234567890
+1
+SELECT b FROM t2 UNION SELECT c FROM t1;
+b
+1
+н1234567890
+SELECT i FROM t2 UNION SELECT c FROM t1;
+i
+1
+н1234567890
+DROP TABLE t1, t2;
diff --git a/mysql-test/r/errors.result b/mysql-test/r/errors.result
index 94debb1785f..022a32d9c9b 100644
--- a/mysql-test/r/errors.result
+++ b/mysql-test/r/errors.result
@@ -41,3 +41,17 @@ SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
a
1
DROP TABLE t1;
+CREATE TABLE t1( a INT );
+SELECT b FROM t1;
+ERROR 42S22: Unknown column 'b' in 'field list'
+SHOW ERRORS;
+Level Code Message
+Error 1054 Unknown column 'b' in 'field list'
+CREATE TABLE t2 SELECT b FROM t1;
+ERROR 42S22: Unknown column 'b' in 'field list'
+SHOW ERRORS;
+Level Code Message
+Error 1054 Unknown column 'b' in 'field list'
+INSERT INTO t1 SELECT b FROM t1;
+ERROR 42S22: Unknown column 'b' in 'field list'
+DROP TABLE t1;
diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result
index 541502607c1..c20d1907bce 100644
--- a/mysql-test/r/events_bugs.result
+++ b/mysql-test/r/events_bugs.result
@@ -557,4 +557,57 @@ CREATE EVENT new_event ON SCHEDULE AT NOW() ENDS NOW() DO SELECT 1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ENDS NOW() DO SELECT 1' at line 1
CREATE EVENT new_event ON SCHEDULE AT NOW() STARTS NOW() ENDS NOW() DO SELECT 1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STARTS NOW() ENDS NOW() DO SELECT 1' at line 1
+USE test;
+SHOW GRANTS FOR CURRENT_USER;
+Grants for root@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+SET GLOBAL event_scheduler = ON;
+CREATE TABLE event_log (id int KEY AUTO_INCREMENT,
+ev_nm char(40), ev_cnt int,
+ev_tm timestamp) ENGINE=MyISAM;
+SET @ev_base_date = 20281224180000;
+SET autocommit=0;
+CREATE USER evtest1@localhost;
+SET PASSWORD FOR evtest1@localhost = password('ev1');
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM evtest1@localhost;
+GRANT create, insert, select, event ON events_test.* TO evtest1@localhost;
+GRANT select,insert ON test.* TO evtest1@localhost;
+SHOW GRANTS FOR evtest1@localhost;
+Grants for evtest1@localhost
+GRANT USAGE ON *.* TO 'evtest1'@'localhost' IDENTIFIED BY PASSWORD '*3170F3644E31580C25DE4A08F4C07CC9A2D40C32'
+GRANT SELECT, INSERT ON `test`.* TO 'evtest1'@'localhost'
+GRANT SELECT, INSERT, CREATE, EVENT ON `events_test`.* TO 'evtest1'@'localhost'
+connection e1;
+USE events_test;
+CREATE EVENT ev_sched_1823 ON SCHEDULE EVERY 2 SECOND
+DO BEGIN
+SET AUTOCOMMIT = 0;
+SET @evname = 'ev_sched_1823';
+SET @cnt = 0;
+SELECT COUNT(*) INTO @cnt FROM test.event_log WHERE ev_nm = @evname;
+IF @cnt < 6 THEN
+INSERT INTO test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp());
+COMMIT;
+END IF;
+SELECT COUNT(*) INTO @cnt FROM test.event_log WHERE ev_nm = @evname;
+IF @cnt < 6 THEN
+INSERT INTO test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp());
+ROLLBACK;
+END IF;
+END;|
+connection default;
+DROP EVENT ev_sched_1823;
+DROP USER evtest1@localhost;
+USE test;
+=====================================================================================
+select id,ev_nm,ev_cnt from event_log order by id;
+id ev_nm ev_cnt
+1 ev_sched_1823 1
+2 ev_sched_1823 2
+3 ev_sched_1823 3
+4 ev_sched_1823 4
+5 ev_sched_1823 5
+6 ev_sched_1823 6
+DROP TABLE event_log;
+SET GLOBAL event_scheduler = OFF;
DROP DATABASE events_test;
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index afecf30b94f..fb8139e2ce1 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -665,6 +665,21 @@ UPDATE t3 SET a = 'us' WHERE a = 'uk';
SELECT * FROM t3 WHERE a = 'uk';
a
DROP TABLE t1,t2,t3;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT) ENGINE=InnoDB;
+switch to connection c1
+SET AUTOCOMMIT=0;
+INSERT INTO t2 VALUES (1);
+switch to connection c2
+SET AUTOCOMMIT=0;
+LOCK TABLES t1 READ, t2 READ;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+switch to connection c1
+COMMIT;
+INSERT INTO t1 VALUES (1);
+switch to connection default
+SET AUTOCOMMIT=default;
+DROP TABLE t1,t2;
End of 5.0 tests
CREATE TABLE t1 (a int, b int);
insert into t1 values (1,1),(1,2);
diff --git a/mysql-test/r/rpl_partition.result b/mysql-test/r/rpl_partition.result
new file mode 100644
index 00000000000..cdd29919c48
--- /dev/null
+++ b/mysql-test/r/rpl_partition.result
@@ -0,0 +1,195 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+SET GLOBAL binlog_format = 'ROW';
+SET SESSION binlog_format = 'ROW';
+select @@global.binlog_format, @@session.binlog_format;
+@@global.binlog_format ROW
+@@session.binlog_format ROW
+DROP TABLE IF EXISTS t1, t2, t3;
+Warnings:
+Level Note
+Code 1051
+Message Unknown table 't1'
+Level Note
+Code 1051
+Message Unknown table 't2'
+Level Note
+Code 1051
+Message Unknown table 't3'
+DROP PROCEDURE IF EXISTS p1;
+Warnings:
+Level Note
+Code 1305
+Message PROCEDURE p1 does not exist
+DROP PROCEDURE IF EXISTS p2;
+Warnings:
+Level Note
+Code 1305
+Message PROCEDURE p2 does not exist
+DROP PROCEDURE IF EXISTS p3;
+Warnings:
+Level Note
+Code 1305
+Message PROCEDURE p3 does not exist
+CREATE TABLE t1(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+fkid MEDIUMINT, filler VARCHAR(255),
+PRIMARY KEY(id)) ENGINE='innodb';
+CREATE TABLE t2(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+fkid MEDIUMINT, filler VARCHAR(255),
+PRIMARY KEY(id)) ENGINE='innodb'
+PARTITION BY KEY(id) partitions 5;
+CREATE TABLE t3(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+fkid MEDIUMINT, filler VARCHAR(255),
+PRIMARY KEY(id)) ENGINE='innodb'
+PARTITION BY RANGE(id)
+SUBPARTITION BY hash(id) subpartitions 2
+(PARTITION pa1 values less than (10),
+PARTITION pa2 values less than (20),
+PARTITION pa3 values less than (30),
+PARTITION pa4 values less than (40),
+PARTITION pa5 values less than (50),
+PARTITION pa6 values less than (60),
+PARTITION pa7 values less than (70),
+PARTITION pa8 values less than (80),
+PARTITION pa9 values less than (90),
+PARTITION pa10 values less than (100),
+PARTITION pa11 values less than MAXVALUE);
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE ins_count INT DEFAULT 1000;
+DECLARE del_count INT;
+DECLARE cur_user VARCHAR(255);
+DECLARE local_uuid VARCHAR(255);
+DECLARE local_time TIMESTAMP;
+SET local_time= NOW();
+SET cur_user= CURRENT_USER();
+SET local_uuid= UUID();
+WHILE ins_count > 0 DO
+INSERT INTO t1 VALUES (NULL, NOW(), USER() , UUID(),
+ins_count,'Going to test MBR for MySQL');
+SET ins_count = ins_count - 1;
+END WHILE;
+SELECT MAX(id) FROM t1 INTO del_count;
+WHILE del_count > 0 DO
+DELETE FROM t1 WHERE id = del_count;
+SET del_count = del_count - 2;
+END WHILE;
+END|
+CREATE PROCEDURE p2()
+BEGIN
+DECLARE ins_count INT DEFAULT 1000;
+DECLARE del_count INT;
+DECLARE cur_user VARCHAR(255);
+DECLARE local_uuid VARCHAR(255);
+DECLARE local_time TIMESTAMP;
+SET local_time= NOW();
+SET cur_user= CURRENT_USER();
+SET local_uuid= UUID();
+WHILE ins_count > 0 DO
+INSERT INTO t2 VALUES (NULL, NOW(), USER() , UUID(),
+ins_count,'Going to test MBR for MySQL');
+SET ins_count = ins_count - 1;
+END WHILE;
+SELECT MAX(id) FROM t2 INTO del_count;
+WHILE del_count > 0 DO
+DELETE FROM t2 WHERE id = del_count;
+SET del_count = del_count - 2;
+END WHILE;
+END|
+CREATE PROCEDURE p3()
+BEGIN
+DECLARE ins_count INT DEFAULT 1000;
+DECLARE del_count INT;
+DECLARE cur_user VARCHAR(255);
+DECLARE local_uuid VARCHAR(255);
+DECLARE local_time TIMESTAMP;
+SET local_time= NOW();
+SET cur_user = CURRENT_USER();
+SET local_uuid=UUID();
+WHILE ins_count > 0 DO
+INSERT INTO t3 VALUES (NULL, NOW(), USER(), UUID(),
+ins_count,'Going to test MBR for MySQL');
+SET ins_count = ins_count - 1;
+END WHILE;
+SELECT MAX(id) FROM t3 INTO del_count;
+WHILE del_count > 0 DO
+DELETE FROM t3 WHERE id = del_count;
+SET del_count = del_count - 2;
+END WHILE;
+END|
+CALL p1();
+SELECT count(*) as "Master regular" FROM t1;
+Master regular 500
+CALL p2();
+SELECT count(*) as "Master bykey" FROM t2;
+Master bykey 500
+CALL p3();
+SELECT count(*) as "Master byrange" FROM t3;
+Master byrange 500
+show create table t3;
+Table t3
+Create Table CREATE TABLE `t3` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `user` char(255) DEFAULT NULL,
+ `uuidf` longblob,
+ `fkid` mediumint(9) DEFAULT NULL,
+ `filler` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION pa2 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION pa3 VALUES LESS THAN (30) ENGINE = MyISAM, PARTITION pa4 VALUES LESS THAN (40) ENGINE = MyISAM, PARTITION pa5 VALUES LESS THAN (50) ENGINE = MyISAM, PARTITION pa6 VALUES LESS THAN (60) ENGINE = MyISAM, PARTITION pa7 VALUES LESS THAN (70) ENGINE = MyISAM, PARTITION pa8 VALUES LESS THAN (80) ENGINE = MyISAM, PARTITION pa9 VALUES LESS THAN (90) ENGINE = MyISAM, PARTITION pa10 VALUES LESS THAN (100) ENGINE = MyISAM, PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+show slave status;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_MYPORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running Yes
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 0
+Last_Error
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+Master_SSL_Verify_Server_Cert No
+Last_IO_Errno #
+Last_IO_Error #
+Last_SQL_Errno 0
+Last_SQL_Error
+SELECT count(*) "Slave norm" FROM t1;
+Slave norm 500
+SELECT count(*) "Slave bykey" FROM t2;
+Slave bykey 500
+SELECT count(*) "Slave byrange" FROM t3;
+Slave byrange 500
+DROP TABLE t1, t2, t3;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+DROP PROCEDURE IF EXISTS p3;
diff --git a/mysql-test/r/rpl_switch_stm_row_mixed.result b/mysql-test/r/rpl_switch_stm_row_mixed.result
index 7c796bd5449..c3f0c07b92c 100644
--- a/mysql-test/r/rpl_switch_stm_row_mixed.result
+++ b/mysql-test/r/rpl_switch_stm_row_mixed.result
@@ -457,7 +457,7 @@ master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t2` (
master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t3` (
- `1` varbinary(36) NOT NULL DEFAULT ''
+ `1` varbinary(108) NOT NULL DEFAULT ''
)
master-bin.000001 # Table_map # # table_id: # (mysqltest1.t3)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
@@ -761,7 +761,7 @@ master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t2` (
master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t3` (
- `1` varbinary(36) NOT NULL DEFAULT ''
+ `1` varbinary(108) NOT NULL DEFAULT ''
)
master-bin.000001 # Table_map # # table_id: # (mysqltest1.t3)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 92cd58f2ba3..40b9e489577 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -4106,6 +4106,39 @@ d1
1
1
DROP TABLE t1,t2;
+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);
+SELECT a, COUNT(b), (SELECT COUNT(b) FROM t2) FROM t1 GROUP BY a;
+ERROR 21000: Subquery returns more than 1 row
+SELECT a, COUNT(b), (SELECT COUNT(b)+0 FROM t2) FROM t1 GROUP BY a;
+ERROR 21000: Subquery returns more than 1 row
+SELECT (SELECT SUM(t1.a)/AVG(t2.x) FROM t2) FROM t1;
+(SELECT SUM(t1.a)/AVG(t2.x) FROM t2)
+3.3333
+DROP TABLE t1,t2;
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (1, 2), (1,3), (1,4), (2,1), (2,2);
+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;
+a COUNT(*)
+1 3
+DROP TABLE t1;
+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;
+(SELECT SUM(t1.a) FROM t2 WHERE a=0)
+NULL
+SELECT (SELECT SUM(t1.a) FROM t2 WHERE a!=0) FROM t1;
+ERROR 21000: Subquery returns more than 1 row
+SELECT (SELECT SUM(t1.a) FROM t2 WHERE a=1) FROM t1;
+(SELECT SUM(t1.a) FROM t2 WHERE a=1)
+3
+DROP TABLE t1,t2;
End of 5.0 tests.
CREATE TABLE t1 (a int, b int);
INSERT INTO t1 VALUES (2,22),(1,11),(2,22);
diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result
index fe63ad6d69e..9535e6dd18a 100644
--- a/mysql-test/r/type_enum.result
+++ b/mysql-test/r/type_enum.result
@@ -1754,14 +1754,6 @@ t1 CREATE TABLE `t1` (
`f2` enum('') DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
-End of 4.1 tests
-create table t1(f1 set('a','b'), index(f1));
-insert into t1 values(''),(''),('a'),('b');
-select * from t1 where f1='';
-f1
-
-
-drop table t1;
create table t1(russian enum('E','F','EF','FE') NOT NULL DEFAULT'E');
show create table t1;
Table Create Table
@@ -1786,4 +1778,35 @@ drop table t1;
create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ','
 !"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\','zz'));
ERROR 42000: Field separator argument is not what is expected; check the manual
+CREATE TABLE t1 (
+id INT AUTO_INCREMENT PRIMARY KEY,
+c1 ENUM('a', '', 'b')
+);
+INSERT INTO t1 (c1) VALUES (0), ('a'), (''), ('b');
+Warnings:
+Warning 1265 Data truncated for column 'c1' at row 1
+SELECT id, c1 + 0, c1 FROM t1;
+id c1 + 0 c1
+1 0
+2 1 a
+3 2
+4 3 b
+ALTER TABLE t1 CHANGE c1 c1 ENUM('a', '') NOT NULL;
+Warnings:
+Warning 1265 Data truncated for column 'c1' at row 4
+SELECT id, c1 + 0, c1 FROM t1;
+id c1 + 0 c1
+1 0
+2 1 a
+3 2
+4 0
+DROP TABLE t1;
+End of 4.1 tests
+create table t1(f1 set('a','b'), index(f1));
+insert into t1 values(''),(''),('a'),('b');
+select * from t1 where f1='';
+f1
+
+
+drop table t1;
End of 5.1 tests
diff --git a/mysql-test/t/binary.test b/mysql-test/t/binary.test
index 4ab6ee9eaf1..1cc6ae07675 100644
--- a/mysql-test/t/binary.test
+++ b/mysql-test/t/binary.test
@@ -101,3 +101,41 @@ select hex(col1) from t1;
insert into t1 values ('b'),('b ');
select hex(col1) from t1;
drop table t1;
+
+#
+# Bug #29087: assertion abort for a search in a BINARY non-nullable index
+# by a key with trailing spaces
+#
+
+CREATE TABLE t1 (
+ a binary(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
+ index idx(a)
+);
+INSERT INTO t1 SET a=unhex('1F9480179366F2BF567E1C4B964C1EF029087575');
+INSERT INTO t1 SET a=unhex('1F9480179366F2BF567E1C4B964C1EF029082020');
+INSERT INTO t1 SET a=unhex('1F9480179366F2BF567E1C4B964C1EF029080707');
+
+SELECT hex(a) FROM t1 order by a;
+EXPLAIN SELECT hex(a) FROM t1 order by a;
+
+SELECT hex(a) from t1 WHERE a=unhex('1F9480179366F2BF567E1C4B964C1EF029082020');
+EXPLAIN
+SELECT hex(a) from t1 WHERE a=unhex('1F9480179366F2BF567E1C4B964C1EF029082020');
+
+SELECT hex(a) from t1 WHERE a=unhex('1F9480179366F2BF567E1C4B964C1EF02908');
+
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ id numeric(20) NOT NULL,
+ lang varchar(8) NOT NULL,
+ msg varchar(32) NOT NULL,
+ PRIMARY KEY (id,lang)
+);
+INSERT INTO t1 VALUES (33, 'en', 'zzzzzzz');
+INSERT INTO t1 VALUES (31, 'en', 'xxxxxxx');
+INSERT INTO t1 VALUES (32, 'en', 'yyyyyyy');
+SELECT * FROM t1 WHERE id=32;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index 149982e23c5..dd3037ce88d 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -790,6 +790,339 @@ drop table t1, t2;
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);
+
+# 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);
+
+# 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 End of 5.0 tests
#
diff --git a/mysql-test/t/ctype_collate.test b/mysql-test/t/ctype_collate.test
index aca240b46bc..4bbae42559a 100644
--- a/mysql-test/t/ctype_collate.test
+++ b/mysql-test/t/ctype_collate.test
@@ -207,3 +207,14 @@ EXPLAIN SELECT * FROM t1 WHERE s2 LIKE 'a' COLLATE latin1_german1_ci;
DROP TABLE t1;
# End of 4.1 tests
+
+#
+# Bug#29261: Sort order of the collation wasn't used when comparing trailing
+# spaces.
+#
+create table t1(f1 varchar(10) character set latin2 collate latin2_hungarian_ci, key(f1));
+insert into t1 set f1=0x3F3F9DC73F;
+insert into t1 set f1=0x3F3F1E563F;
+insert into t1 set f1=0x3F3F;
+check table t1 extended;
+drop table t1;
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 03b3df44c73..204d59589e4 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -1339,3 +1339,28 @@ INSERT INTO t2 (colA, colB) VALUES (1, 'foo'),(2, 'foo bar');
SELECT * FROM t1 JOIN t2 ON t1.colA=t2.colA AND t1.colB=t2.colB
WHERE t1.colA < 3;
DROP TABLE t1, t2;
+
+#
+# Bug#29205: truncation of UTF8 values when the UNION statement
+# forces collation to the binary charset
+#
+
+SELECT 'н1234567890' UNION SELECT _binary '1';
+SELECT 'н1234567890' UNION SELECT 1;
+
+SELECT '1' UNION SELECT 'н1234567890';
+SELECT 1 UNION SELECT 'н1234567890';
+
+CREATE TABLE t1 (c VARCHAR(11)) CHARACTER SET utf8;
+CREATE TABLE t2 (b CHAR(1) CHARACTER SET binary, i INT);
+
+INSERT INTO t1 (c) VALUES ('н1234567890');
+INSERT INTO t2 (b, i) VALUES ('1', 1);
+
+SELECT c FROM t1 UNION SELECT b FROM t2;
+SELECT c FROM t1 UNION SELECT i FROM t2;
+
+SELECT b FROM t2 UNION SELECT c FROM t1;
+SELECT i FROM t2 UNION SELECT c FROM t1;
+
+DROP TABLE t1, t2;
diff --git a/mysql-test/t/errors.test b/mysql-test/t/errors.test
index 4fbdcba635f..89579ec1739 100644
--- a/mysql-test/t/errors.test
+++ b/mysql-test/t/errors.test
@@ -53,4 +53,17 @@ INSERT INTO t1 VALUES(2),(3);
SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
DROP TABLE t1;
+#
+# Bug #28677: SELECT on missing column gives extra error
+#
+CREATE TABLE t1( a INT );
+--error ER_BAD_FIELD_ERROR
+SELECT b FROM t1;
+SHOW ERRORS;
+--error ER_BAD_FIELD_ERROR
+CREATE TABLE t2 SELECT b FROM t1;
+SHOW ERRORS;
+--error ER_BAD_FIELD_ERROR
+INSERT INTO t1 SELECT b FROM t1;
+DROP TABLE t1;
# End of 5.0 tests
diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test
index f369fbecd66..4186b4701fa 100644
--- a/mysql-test/t/events_bugs.test
+++ b/mysql-test/t/events_bugs.test
@@ -648,7 +648,69 @@ CREATE EVENT new_event ON SCHEDULE AT NOW() ENDS NOW() DO SELECT 1;
--error ER_PARSE_ERROR
CREATE EVENT new_event ON SCHEDULE AT NOW() STARTS NOW() ENDS NOW() DO SELECT 1;
-
+#
+# START - BUG#28924 If I drop the user who is the definer of an active event then server cores
+#
+let $engine=MyISAM;
+USE test;
+SHOW GRANTS FOR CURRENT_USER;
+SET GLOBAL event_scheduler = ON;
+eval CREATE TABLE event_log (id int KEY AUTO_INCREMENT,
+ ev_nm char(40), ev_cnt int,
+ ev_tm timestamp) ENGINE=$engine;
+SET @ev_base_date = 20281224180000;
+--disable_warnings
+SET autocommit=0;
+#DROP DATABASE IF EXISTS ev_db_1;
+#CREATE DATABASE ev_db_1;
+--enable_warnings
+CREATE USER evtest1@localhost;
+SET PASSWORD FOR evtest1@localhost = password('ev1');
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM evtest1@localhost;
+GRANT create, insert, select, event ON events_test.* TO evtest1@localhost;
+GRANT select,insert ON test.* TO evtest1@localhost;
+SHOW GRANTS FOR evtest1@localhost;
+
+--echo connection e1;
+--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
+connect (e1,localhost,evtest1,ev1,events_test,$MASTER_MYPORT,$MASTER_MYSOCK);
+USE events_test;
+
+DELIMITER |;
+CREATE EVENT ev_sched_1823 ON SCHEDULE EVERY 2 SECOND
+DO BEGIN
+ SET AUTOCOMMIT = 0;
+ SET @evname = 'ev_sched_1823';
+ SET @cnt = 0;
+ SELECT COUNT(*) INTO @cnt FROM test.event_log WHERE ev_nm = @evname;
+ IF @cnt < 6 THEN
+ INSERT INTO test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp());
+ COMMIT;
+ END IF;
+ SELECT COUNT(*) INTO @cnt FROM test.event_log WHERE ev_nm = @evname;
+ IF @cnt < 6 THEN
+ INSERT INTO test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp());
+ ROLLBACK;
+ END IF;
+END;|
+DELIMITER ;|
+
+--sleep 6
+--echo connection default;
+DROP EVENT ev_sched_1823;
+connection default;
+DROP USER evtest1@localhost;
+
+--sleep 6
+USE test;
+--echo =====================================================================================
+--sleep 5
+#--disable_result_log
+select id,ev_nm,ev_cnt from event_log order by id;
+#--enable_result_log
+DROP TABLE event_log;
+#DROP DATABASE ev_db_1;
+SET GLOBAL event_scheduler = OFF;
#
# End of tests
diff --git a/mysql-test/t/rpl_partition.test b/mysql-test/t/rpl_partition.test
new file mode 100644
index 00000000000..7f6e05db20e
--- /dev/null
+++ b/mysql-test/t/rpl_partition.test
@@ -0,0 +1,160 @@
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+--vertical_results
+
+let $engine_type= 'innodb';
+
+SET GLOBAL binlog_format = 'ROW';
+SET SESSION binlog_format = 'ROW';
+select @@global.binlog_format, @@session.binlog_format;
+
+--disable-warnings
+DROP TABLE IF EXISTS t1, t2, t3;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+DROP PROCEDURE IF EXISTS p3;
+--enable-warnings
+
+eval CREATE TABLE t1(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+ fkid MEDIUMINT, filler VARCHAR(255),
+ PRIMARY KEY(id)) ENGINE=$engine_type;
+
+eval CREATE TABLE t2(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+ fkid MEDIUMINT, filler VARCHAR(255),
+ PRIMARY KEY(id)) ENGINE=$engine_type
+ PARTITION BY KEY(id) partitions 5;
+
+eval CREATE TABLE t3(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+ fkid MEDIUMINT, filler VARCHAR(255),
+ PRIMARY KEY(id)) ENGINE=$engine_type
+ PARTITION BY RANGE(id)
+ SUBPARTITION BY hash(id) subpartitions 2
+ (PARTITION pa1 values less than (10),
+ PARTITION pa2 values less than (20),
+ PARTITION pa3 values less than (30),
+ PARTITION pa4 values less than (40),
+ PARTITION pa5 values less than (50),
+ PARTITION pa6 values less than (60),
+ PARTITION pa7 values less than (70),
+ PARTITION pa8 values less than (80),
+ PARTITION pa9 values less than (90),
+ PARTITION pa10 values less than (100),
+ PARTITION pa11 values less than MAXVALUE);
+
+######## Create SPs, Functions, Views and Triggers Section ##############
+
+delimiter |;
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE ins_count INT DEFAULT 1000;
+ DECLARE del_count INT;
+ DECLARE cur_user VARCHAR(255);
+ DECLARE local_uuid VARCHAR(255);
+ DECLARE local_time TIMESTAMP;
+
+ SET local_time= NOW();
+ SET cur_user= CURRENT_USER();
+ SET local_uuid= UUID();
+
+ WHILE ins_count > 0 DO
+ INSERT INTO t1 VALUES (NULL, NOW(), USER() , UUID(),
+ ins_count,'Going to test MBR for MySQL');
+ SET ins_count = ins_count - 1;
+ END WHILE;
+
+ SELECT MAX(id) FROM t1 INTO del_count;
+ WHILE del_count > 0 DO
+ DELETE FROM t1 WHERE id = del_count;
+ SET del_count = del_count - 2;
+ END WHILE;
+END|
+
+CREATE PROCEDURE p2()
+BEGIN
+ DECLARE ins_count INT DEFAULT 1000;
+ DECLARE del_count INT;
+ DECLARE cur_user VARCHAR(255);
+ DECLARE local_uuid VARCHAR(255);
+ DECLARE local_time TIMESTAMP;
+
+ SET local_time= NOW();
+ SET cur_user= CURRENT_USER();
+ SET local_uuid= UUID();
+
+ WHILE ins_count > 0 DO
+ INSERT INTO t2 VALUES (NULL, NOW(), USER() , UUID(),
+ ins_count,'Going to test MBR for MySQL');
+ SET ins_count = ins_count - 1;
+ END WHILE;
+
+ SELECT MAX(id) FROM t2 INTO del_count;
+ WHILE del_count > 0 DO
+ DELETE FROM t2 WHERE id = del_count;
+ SET del_count = del_count - 2;
+ END WHILE;
+END|
+
+CREATE PROCEDURE p3()
+BEGIN
+ DECLARE ins_count INT DEFAULT 1000;
+ DECLARE del_count INT;
+ DECLARE cur_user VARCHAR(255);
+ DECLARE local_uuid VARCHAR(255);
+ DECLARE local_time TIMESTAMP;
+
+ SET local_time= NOW();
+ SET cur_user = CURRENT_USER();
+ SET local_uuid=UUID();
+
+ WHILE ins_count > 0 DO
+ INSERT INTO t3 VALUES (NULL, NOW(), USER(), UUID(),
+ ins_count,'Going to test MBR for MySQL');
+ SET ins_count = ins_count - 1;
+ END WHILE;
+
+ SELECT MAX(id) FROM t3 INTO del_count;
+ WHILE del_count > 0 DO
+ DELETE FROM t3 WHERE id = del_count;
+ SET del_count = del_count - 2;
+ END WHILE;
+END|
+
+delimiter ;|
+
+############ Finish Setup Section ###################
+
+
+############ Test Section ###################
+
+CALL p1();
+SELECT count(*) as "Master regular" FROM t1;
+CALL p2();
+SELECT count(*) as "Master bykey" FROM t2;
+CALL p3();
+SELECT count(*) as "Master byrange" FROM t3;
+
+#--source include/master-slave-end.inc
+--sync_slave_with_master
+connection slave;
+show create table t3;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
+show slave status;
+SELECT count(*) "Slave norm" FROM t1;
+SELECT count(*) "Slave bykey" FROM t2;
+SELECT count(*) "Slave byrange" FROM t3;
+
+connection master;
+DROP TABLE t1, t2, t3;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+DROP PROCEDURE IF EXISTS p3;
+save_master_pos;
+connection slave;
+sync_with_master;
+
+# End of 5.1 tests
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index e88ded56914..4c046dfd3c6 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -2945,6 +2945,48 @@ 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;
+
--echo End of 5.0 tests.
#
diff --git a/mysql-test/t/type_enum.test b/mysql-test/t/type_enum.test
index 200fd063b99..1e5b53a2c6e 100644
--- a/mysql-test/t/type_enum.test
+++ b/mysql-test/t/type_enum.test
@@ -136,16 +136,6 @@ alter table t1 add f2 enum(0xFFFF);
show create table t1;
drop table t1;
---echo End of 4.1 tests
-
-#
-# Bug#28729: Field_enum wrongly reported an error while storing an empty string.
-#
-create table t1(f1 set('a','b'), index(f1));
-insert into t1 values(''),(''),('a'),('b');
-select * from t1 where f1='';
-drop table t1;
-
#
# Bug#24660 "enum" field type definition problem
#
@@ -166,4 +156,31 @@ drop table t1;
create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ','
 !"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\','zz'));
+#
+# Bug #29251: MySQL coerces special 0 enum values to normal '' value
+# when ALTERing the column
+#
+
+CREATE TABLE t1 (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ c1 ENUM('a', '', 'b')
+);
+INSERT INTO t1 (c1) VALUES (0), ('a'), (''), ('b');
+SELECT id, c1 + 0, c1 FROM t1;
+
+ALTER TABLE t1 CHANGE c1 c1 ENUM('a', '') NOT NULL;
+SELECT id, c1 + 0, c1 FROM t1;
+
+DROP TABLE t1;
+
+--echo End of 4.1 tests
+
+#
+# Bug#28729: Field_enum wrongly reported an error while storing an empty string.
+#
+create table t1(f1 set('a','b'), index(f1));
+insert into t1 values(''),(''),('a'),('b');
+select * from t1 where f1='';
+drop table t1;
+
--echo End of 5.1 tests
diff --git a/sql-common/client.c b/sql-common/client.c
index f6325d923ab..6d63c457390 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -2459,6 +2459,7 @@ my_bool mysql_reconnect(MYSQL *mysql)
}
mysql_init(&tmp_mysql);
tmp_mysql.options= mysql->options;
+ tmp_mysql.options.my_cnf_file= tmp_mysql.options.my_cnf_group= 0;
tmp_mysql.rpl_pivot= mysql->rpl_pivot;
if (!mysql_real_connect(&tmp_mysql,mysql->host,mysql->user,mysql->passwd,
diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc
index 77dc33e6265..5aca40d357a 100644
--- a/sql/event_data_objects.cc
+++ b/sql/event_data_objects.cc
@@ -1778,7 +1778,7 @@ Event_job_data::execute(THD *thd, bool drop)
"[%s].[%s.%s] execution failed, "
"failed to authenticate the user.",
definer.str, dbname.str, name.str);
- goto end;
+ goto end_no_lex_start;
}
#endif
@@ -1795,11 +1795,11 @@ Event_job_data::execute(THD *thd, bool drop)
"[%s].[%s.%s] execution failed, "
"user no longer has EVENT privilege.",
definer.str, dbname.str, name.str);
- goto end;
+ goto end_no_lex_start;
}
if (construct_sp_sql(thd, &sp_sql))
- goto end;
+ goto end_no_lex_start;
/*
Set up global thread attributes to reflect the properties of
@@ -1860,6 +1860,13 @@ Event_job_data::execute(THD *thd, bool drop)
}
end:
+ if (thd->lex->sphead) /* NULL only if a parse error */
+ {
+ delete thd->lex->sphead;
+ thd->lex->sphead= NULL;
+ }
+
+end_no_lex_start:
if (drop && !thd->is_fatal_error)
{
/*
@@ -1887,11 +1894,6 @@ end:
ret= 1;
}
}
- if (thd->lex->sphead) /* NULL only if a parse error */
- {
- delete thd->lex->sphead;
- thd->lex->sphead= NULL;
- }
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (save_sctx)
event_sctx.restore_security_context(thd, save_sctx);
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index 63810c8b113..44aea9acee0 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -307,6 +307,15 @@ static void do_field_string(Copy_field *copy)
}
+static void do_field_enum(Copy_field *copy)
+{
+ if (copy->from_field->val_int() == 0)
+ ((Field_enum *) copy->to_field)->store_type((ulonglong) 0);
+ else
+ do_field_string(copy);
+}
+
+
static void do_field_varbinary_pre50(Copy_field *copy)
{
char buff[MAX_FIELD_WIDTH];
@@ -667,7 +676,13 @@ void (*Copy_field::get_copy_func(Field *to,Field *from))(Copy_field*)
to->real_type() == MYSQL_TYPE_SET)
{
if (!to->eq_def(from))
- return do_field_string;
+ {
+ if (from->real_type() == MYSQL_TYPE_ENUM &&
+ to->real_type() == MYSQL_TYPE_ENUM)
+ return do_field_enum;
+ else
+ return do_field_string;
+ }
}
else if (to->charset() != from->charset())
return do_field_string;
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index b6a27c8df28..31f59c662d4 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -383,7 +383,8 @@ bool ha_partition::initialise_partition(MEM_ROOT *mem_root)
m_table_flags&= file->table_flags();
} while (*(++file_array));
m_table_flags&= ~(HA_CAN_GEOMETRY | HA_CAN_FULLTEXT | HA_DUPLICATE_POS |
- HA_CAN_SQL_HANDLER | HA_CAN_INSERT_DELAYED);
+ HA_CAN_SQL_HANDLER | HA_CAN_INSERT_DELAYED |
+ HA_PRIMARY_KEY_REQUIRED_FOR_POSITION);
m_table_flags|= HA_FILE_BASED | HA_REC_NOT_IN_SEQ;
DBUG_RETURN(0);
}
diff --git a/sql/handler.h b/sql/handler.h
index e80b62c1250..4095a2f4cb1 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -1130,10 +1130,12 @@ public:
int ha_index_init(uint idx, bool sorted)
{
+ int result;
DBUG_ENTER("ha_index_init");
DBUG_ASSERT(inited==NONE);
- inited=INDEX;
- DBUG_RETURN(index_init(idx, sorted));
+ if (!(result= index_init(idx, sorted)))
+ inited=INDEX;
+ DBUG_RETURN(result);
}
int ha_index_end()
{
@@ -1144,10 +1146,11 @@ public:
}
int ha_rnd_init(bool scan)
{
+ int result;
DBUG_ENTER("ha_rnd_init");
DBUG_ASSERT(inited==NONE || (inited==RND && scan));
- inited=RND;
- DBUG_RETURN(rnd_init(scan));
+ inited= (result= rnd_init(scan)) ? NONE: RND;
+ DBUG_RETURN(result);
}
int ha_rnd_end()
{
diff --git a/sql/item.cc b/sql/item.cc
index 4fa6a2a8517..d7743c491eb 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -6687,9 +6687,15 @@ bool Item_type_holder::join_types(THD *thd, Item *item)
expansion of the size of the values because of character set
conversions.
*/
- max_length= max(old_max_chars * collation.collation->mbmaxlen,
- display_length(item) / item->collation.collation->mbmaxlen *
- collation.collation->mbmaxlen);
+ if (collation.collation != &my_charset_bin)
+ {
+ max_length= max(old_max_chars * collation.collation->mbmaxlen,
+ display_length(item) /
+ item->collation.collation->mbmaxlen *
+ collation.collation->mbmaxlen);
+ }
+ else
+ set_if_bigger(max_length, display_length(item));
break;
}
case REAL_RESULT:
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 000abb313a0..1d042860d73 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -985,7 +985,8 @@ Item_in_subselect::single_value_transformer(JOIN *join,
DBUG_RETURN(RES_ERROR);
thd->lex->allow_sum_func= save_allow_sum_func;
/* we added aggregate function => we have to change statistic */
- count_field_types(&join->tmp_table_param, join->all_fields, 0);
+ count_field_types(select_lex, &join->tmp_table_param, join->all_fields,
+ 0);
subs= new Item_singlerow_subselect(select_lex);
}
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 10bd24dbb66..e2d4c02d986 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -2480,7 +2480,7 @@ bool Item_sum_count_distinct::setup(THD *thd)
}
if (always_null)
return FALSE;
- count_field_types(tmp_table_param,list,0);
+ count_field_types(select_lex, tmp_table_param, list, 0);
tmp_table_param->force_copy_fields= force_copy_fields;
DBUG_ASSERT(table == 0);
if (!(table= create_tmp_table(thd, tmp_table_param, list, (ORDER*) 0, 1,
@@ -3286,7 +3286,7 @@ bool Item_func_group_concat::setup(THD *thd)
setup_order(thd, args, context->table_list, list, all_fields, *order))
DBUG_RETURN(TRUE);
- count_field_types(tmp_table_param,all_fields,0);
+ count_field_types(select_lex, tmp_table_param, all_fields, 0);
tmp_table_param->force_copy_fields= force_copy_fields;
DBUG_ASSERT(table == 0);
/*
diff --git a/sql/item_sum.h b/sql/item_sum.h
index 84b425755d1..b3a382012f1 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -966,8 +966,15 @@ public:
bool fix_fields(THD *thd, Item **ref)
{
DBUG_ASSERT(fixed == 0);
+
+ if (init_sum_func_check(thd))
+ return TRUE;
+
fixed= 1;
- return udf.fix_fields(thd, this, this->arg_count, this->args);
+ if (udf.fix_fields(thd, this, this->arg_count, this->args))
+ return TRUE;
+
+ return check_sum_func(thd, ref);
}
enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; }
virtual bool have_field_update(void) const { return 0; }
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 1f5013a8ef6..02d3a949cb3 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -7171,8 +7171,10 @@ replace_record(THD *thd, TABLE *table,
{
error=table->file->ha_update_row(table->record[1],
table->record[0]);
- if (error)
+ if (error && error != HA_ERR_RECORD_IS_THE_SAME)
table->file->print_error(error, MYF(0));
+ else
+ error= 0;
DBUG_RETURN(error);
}
else
@@ -7856,6 +7858,8 @@ int Update_rows_log_event::do_exec_row(TABLE *table)
database into the after image delivered from the master.
*/
error= table->file->ha_update_row(table->record[1], table->record[0]);
+ if (error == HA_ERR_RECORD_IS_THE_SAME)
+ error= 0;
return error;
}
diff --git a/sql/sp.cc b/sql/sp.cc
index 6e890f638d0..75ea9172c90 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -715,8 +715,11 @@ sp_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics)
table->field[MYSQL_PROC_FIELD_COMMENT]->store(chistics->comment.str,
chistics->comment.length,
system_charset_info);
- if ((table->file->ha_update_row(table->record[1],table->record[0])))
+ if ((ret= table->file->ha_update_row(table->record[1],table->record[0])) &&
+ ret != HA_ERR_RECORD_IS_THE_SAME)
ret= SP_WRITE_ROW_FAILED;
+ else
+ ret= 0;
}
if (ret == SP_OK)
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 8f0af8af3ed..67fa380d313 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1825,7 +1825,8 @@ static bool update_user_table(THD *thd, TABLE *table,
}
store_record(table,record[1]);
table->field[2]->store(new_password, new_password_len, system_charset_info);
- if ((error=table->file->ha_update_row(table->record[1],table->record[0])))
+ if ((error=table->file->ha_update_row(table->record[1],table->record[0])) &&
+ error != HA_ERR_RECORD_IS_THE_SAME)
{
table->file->print_error(error,MYF(0)); /* purecov: deadcode */
DBUG_RETURN(1);
@@ -2041,12 +2042,18 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
We should NEVER delete from the user table, as a uses can still
use mysqld even if he doesn't have any privileges in the user table!
*/
- if (cmp_record(table,record[1]) &&
- (error=table->file->ha_update_row(table->record[1],table->record[0])))
- { // This should never happen
- table->file->print_error(error,MYF(0)); /* purecov: deadcode */
- error= -1; /* purecov: deadcode */
- goto end; /* purecov: deadcode */
+ if (cmp_record(table,record[1]))
+ {
+ if ((error=
+ table->file->ha_update_row(table->record[1],table->record[0])) &&
+ error != HA_ERR_RECORD_IS_THE_SAME)
+ { // This should never happen
+ table->file->print_error(error,MYF(0)); /* purecov: deadcode */
+ error= -1; /* purecov: deadcode */
+ goto end; /* purecov: deadcode */
+ }
+ else
+ error= 0;
}
}
else if ((error=table->file->ha_write_row(table->record[0]))) // insert
@@ -2161,7 +2168,8 @@ static int replace_db_table(TABLE *table, const char *db,
if (rights)
{
if ((error= table->file->ha_update_row(table->record[1],
- table->record[0])))
+ table->record[0])) &&
+ error != HA_ERR_RECORD_IS_THE_SAME)
goto table_error; /* purecov: deadcode */
}
else /* must have been a revoke of all privileges */
@@ -2543,12 +2551,14 @@ static int replace_column_table(GRANT_TABLE *g_t,
error=table->file->ha_update_row(table->record[1],table->record[0]);
else
error=table->file->ha_delete_row(table->record[1]);
- if (error)
+ if (error && error != HA_ERR_RECORD_IS_THE_SAME)
{
table->file->print_error(error,MYF(0)); /* purecov: inspected */
result= -1; /* purecov: inspected */
goto end; /* purecov: inspected */
}
+ else
+ error= 0;
grant_column= column_hash_search(g_t, column->column.ptr(),
column->column.length());
if (grant_column) // Should always be true
@@ -2608,7 +2618,8 @@ static int replace_column_table(GRANT_TABLE *g_t,
{
int tmp_error;
if ((tmp_error=table->file->ha_update_row(table->record[1],
- table->record[0])))
+ table->record[0])) &&
+ tmp_error != HA_ERR_RECORD_IS_THE_SAME)
{ /* purecov: deadcode */
table->file->print_error(tmp_error,MYF(0)); /* purecov: deadcode */
result= -1; /* purecov: deadcode */
@@ -2730,7 +2741,9 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
{
if (store_table_rights || store_col_rights)
{
- if ((error=table->file->ha_update_row(table->record[1],table->record[0])))
+ if ((error=table->file->ha_update_row(table->record[1],
+ table->record[0])) &&
+ error != HA_ERR_RECORD_IS_THE_SAME)
goto table_error; /* purecov: deadcode */
}
else if ((error = table->file->ha_delete_row(table->record[1])))
@@ -2848,7 +2861,9 @@ static int replace_routine_table(THD *thd, GRANT_NAME *grant_name,
{
if (store_proc_rights)
{
- if ((error=table->file->ha_update_row(table->record[1],table->record[0])))
+ if ((error=table->file->ha_update_row(table->record[1],
+ table->record[0])) &&
+ error != HA_ERR_RECORD_IS_THE_SAME)
goto table_error;
}
else if ((error= table->file->ha_delete_row(table->record[1])))
@@ -4914,8 +4929,12 @@ static int modify_grant_table(TABLE *table, Field *host_field,
system_charset_info);
user_field->store(user_to->user.str, user_to->user.length,
system_charset_info);
- if ((error= table->file->ha_update_row(table->record[1], table->record[0])))
+ if ((error= table->file->ha_update_row(table->record[1],
+ table->record[0])) &&
+ error != HA_ERR_RECORD_IS_THE_SAME)
table->file->print_error(error, MYF(0));
+ else
+ error= 0;
}
else
{
diff --git a/sql/sql_class.h b/sql/sql_class.h
index c46adc62c7c..abeb8f385f4 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1983,6 +1983,7 @@ class select_insert :public select_result_interceptor {
virtual bool can_rollback_data() { return 0; }
void send_error(uint errcode,const char *err);
bool send_eof();
+ void abort();
/* not implemented: select_insert is never re-used in prepared statements */
void cleanup();
};
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 72a381aeac2..11db88d8f5e 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1425,7 +1425,8 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
compare_record(table))
{
if ((error=table->file->ha_update_row(table->record[1],
- table->record[0])))
+ table->record[0])) &&
+ error != HA_ERR_RECORD_IS_THE_SAME)
{
if (info->ignore &&
!table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
@@ -1435,7 +1436,10 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
goto err;
}
- info->updated++;
+ if (error != HA_ERR_RECORD_IS_THE_SAME)
+ info->updated++;
+ else
+ error= 0;
/*
If ON DUP KEY UPDATE updates a row instead of inserting one, it's
like a regular UPDATE statement: it should not affect the value of a
@@ -1483,9 +1487,13 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
(!table->triggers || !table->triggers->has_delete_triggers()))
{
if ((error=table->file->ha_update_row(table->record[1],
- table->record[0])))
+ table->record[0])) &&
+ error != HA_ERR_RECORD_IS_THE_SAME)
goto err;
- info->deleted++;
+ if (error != HA_ERR_RECORD_IS_THE_SAME)
+ info->deleted++;
+ else
+ error= 0;
thd->record_first_successful_insert_id_in_cur_stmt(table->file->insert_id_for_cur_row);
/*
Since we pretend that we have done insert we should call
@@ -3026,57 +3034,8 @@ void select_insert::send_error(uint errcode,const char *err)
{
DBUG_ENTER("select_insert::send_error");
- /* Avoid an extra 'unknown error' message if we already reported an error */
- if (errcode != ER_UNKNOWN_ERROR && !thd->net.report_error)
- my_message(errcode, err, MYF(0));
-
- /*
- If the creation of the table failed (due to a syntax error, for
- example), no table will have been opened and therefore 'table'
- will be NULL. In that case, we still need to execute the rollback
- and the end of the function.
- */
- if (table)
- {
- /*
- If we are not in prelocked mode, we end the bulk insert started
- before.
- */
- if (!thd->prelocked_mode)
- table->file->ha_end_bulk_insert();
-
- /*
- If at least one row has been inserted/modified and will stay in
- the table (the table doesn't have transactions) we must write to
- the binlog (and the error code will make the slave stop).
-
- For many errors (example: we got a duplicate key error while
- inserting into a MyISAM table), no row will be added to the table,
- so passing the error to the slave will not help since there will
- be an error code mismatch (the inserts will succeed on the slave
- with no error).
-
- If table creation failed, the number of rows modified will also be
- zero, so no check for that is made.
- */
- if (info.copied || info.deleted || info.updated)
- {
- DBUG_ASSERT(table != NULL);
- if (!table->file->has_transactions())
- {
- if (mysql_bin_log.is_open())
- thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query, thd->query_length,
- table->file->has_transactions(), FALSE);
- if (!thd->current_stmt_binlog_row_based && !table->s->tmp_table &&
- !can_rollback_data())
- thd->no_trans_update.all= TRUE;
- query_cache_invalidate3(thd, table, 1);
- }
- }
- table->file->ha_release_auto_increment();
- }
+ my_message(errcode, err, MYF(0));
- ha_rollback_stmt(thd);
DBUG_VOID_RETURN;
}
@@ -3166,6 +3125,59 @@ bool select_insert::send_eof()
DBUG_RETURN(0);
}
+void select_insert::abort() {
+
+ DBUG_ENTER("select_insert::abort");
+ /*
+ If the creation of the table failed (due to a syntax error, for
+ example), no table will have been opened and therefore 'table'
+ will be NULL. In that case, we still need to execute the rollback
+ and the end of the function.
+ */
+ if (table)
+ {
+ /*
+ If we are not in prelocked mode, we end the bulk insert started
+ before.
+ */
+ if (!thd->prelocked_mode)
+ table->file->ha_end_bulk_insert();
+
+ /*
+ If at least one row has been inserted/modified and will stay in
+ the table (the table doesn't have transactions) we must write to
+ the binlog (and the error code will make the slave stop).
+
+ For many errors (example: we got a duplicate key error while
+ inserting into a MyISAM table), no row will be added to the table,
+ so passing the error to the slave will not help since there will
+ be an error code mismatch (the inserts will succeed on the slave
+ with no error).
+
+ If table creation failed, the number of rows modified will also be
+ zero, so no check for that is made.
+ */
+ if (info.copied || info.deleted || info.updated)
+ {
+ DBUG_ASSERT(table != NULL);
+ if (!table->file->has_transactions())
+ {
+ if (mysql_bin_log.is_open())
+ thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query, thd->query_length,
+ table->file->has_transactions(), FALSE);
+ if (!thd->current_stmt_binlog_row_based && !table->s->tmp_table &&
+ !can_rollback_data())
+ thd->no_trans_update.all= TRUE;
+ query_cache_invalidate3(thd, table, 1);
+ }
+ }
+ table->file->ha_release_auto_increment();
+ }
+
+ ha_rollback_stmt(thd);
+ DBUG_VOID_RETURN;
+}
+
/***************************************************************************
CREATE TABLE (SELECT) ...
@@ -3605,6 +3617,14 @@ void select_create::abort()
DBUG_ENTER("select_create::abort");
/*
+ Disable binlog, because we "roll back" partial inserts in ::abort
+ by removing the table, even for non-transactional tables.
+ */
+ tmp_disable_binlog(thd);
+ select_insert::abort();
+ reenable_binlog(thd);
+
+ /*
We roll back the statement, including truncating the transaction
cache of the binary log, if the statement failed.
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index a8dbebe012d..bf07bae379d 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -3012,6 +3012,7 @@ end_with_restore_list:
break;
case SQLCOM_LOCK_TABLES:
unlock_locked_tables(thd);
+ /* we must end the trasaction first, regardless of anything */
if (end_active_trans(thd))
goto error;
if (check_table_access(thd, LOCK_TABLES_ACL | SELECT_ACL, all_tables, 0))
@@ -3030,7 +3031,15 @@ end_with_restore_list:
send_ok(thd);
}
else
+ {
+ /*
+ Need to end the current transaction, so the storage engine (InnoDB)
+ can free its locks if LOCK TABLES locked some tables before finding
+ that it can't lock a table in its list
+ */
+ end_active_trans(thd);
thd->options&= ~(ulong) (OPTION_TABLE_LOCK);
+ }
thd->in_lock_tables=0;
break;
case SQLCOM_CREATE_DB:
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 067e334f73d..3cda4029161 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -261,11 +261,8 @@ bool handle_select(THD *thd, LEX *lex, select_result *result,
thd->net.report_error));
res|= thd->net.report_error;
if (unlikely(res))
- {
- /* If we had a another error reported earlier then this will be ignored */
- result->send_error(ER_UNKNOWN_ERROR, ER(ER_UNKNOWN_ERROR));
result->abort();
- }
+
DBUG_RETURN(res);
}
@@ -609,7 +606,7 @@ JOIN::prepare(Item ***rref_pointer_array,
goto err; /* purecov: inspected */
/* Init join struct */
- count_field_types(&tmp_table_param, all_fields, 0);
+ count_field_types(select_lex, &tmp_table_param, all_fields, 0);
ref_pointer_array_size= all_fields.elements*sizeof(Item*);
this->group= group_list != 0;
unit= unit_arg;
@@ -1784,7 +1781,7 @@ JOIN::exec()
if (make_simple_join(curr_join, curr_tmp_table))
DBUG_VOID_RETURN;
calc_group_buffer(curr_join, group_list);
- count_field_types(&curr_join->tmp_table_param,
+ count_field_types(select_lex, &curr_join->tmp_table_param,
curr_join->tmp_all_fields1,
curr_join->select_distinct && !curr_join->group_list);
curr_join->tmp_table_param.hidden_field_count=
@@ -1907,11 +1904,13 @@ JOIN::exec()
if (make_simple_join(curr_join, curr_tmp_table))
DBUG_VOID_RETURN;
calc_group_buffer(curr_join, curr_join->group_list);
- count_field_types(&curr_join->tmp_table_param, *curr_all_fields, 0);
+ count_field_types(select_lex, &curr_join->tmp_table_param,
+ *curr_all_fields, 0);
}
if (procedure)
- count_field_types(&curr_join->tmp_table_param, *curr_all_fields, 0);
+ count_field_types(select_lex, &curr_join->tmp_table_param,
+ *curr_all_fields, 0);
if (curr_join->group || curr_join->tmp_table_param.sum_func_count ||
(procedure && (procedure->flags & PROC_GROUP)))
@@ -13979,8 +13978,8 @@ next_item:
*****************************************************************************/
void
-count_field_types(TMP_TABLE_PARAM *param, List<Item> &fields,
- bool reset_with_sum_func)
+count_field_types(SELECT_LEX *select_lex, TMP_TABLE_PARAM *param,
+ List<Item> &fields, bool reset_with_sum_func)
{
List_iterator<Item> li(fields);
Item *field;
@@ -13998,18 +13997,22 @@ count_field_types(TMP_TABLE_PARAM *param, List<Item> &fields,
if (! field->const_item())
{
Item_sum *sum_item=(Item_sum*) field->real_item();
- if (!sum_item->quick_group)
- param->quick_group=0; // UDF SUM function
- param->sum_func_count++;
- param->func_count++;
+ if (!sum_item->depended_from() ||
+ sum_item->depended_from() == select_lex)
+ {
+ if (!sum_item->quick_group)
+ param->quick_group=0; // UDF SUM function
+ param->sum_func_count++;
- for (uint i=0 ; i < sum_item->arg_count ; i++)
- {
- if (sum_item->args[0]->real_item()->type() == Item::FIELD_ITEM)
- param->field_count++;
- else
- param->func_count++;
- }
+ for (uint i=0 ; i < sum_item->arg_count ; i++)
+ {
+ if (sum_item->args[0]->real_item()->type() == Item::FIELD_ITEM)
+ param->field_count++;
+ else
+ param->func_count++;
+ }
+ }
+ param->func_count++;
}
}
else
@@ -14470,7 +14473,9 @@ bool JOIN::make_sum_func_list(List<Item> &field_list, List<Item> &send_fields,
func= sum_funcs;
while ((item=it++))
{
- if (item->type() == Item::SUM_FUNC_ITEM && !item->const_item())
+ if (item->type() == Item::SUM_FUNC_ITEM && !item->const_item() &&
+ (!((Item_sum*) item)->depended_from() ||
+ ((Item_sum *)item)->depended_from() == select_lex))
*func++= (Item_sum*) item;
}
if (before_group_by && rollup.state == ROLLUP::STATE_INITED)
@@ -15052,7 +15057,10 @@ bool JOIN::rollup_make_fields(List<Item> &fields_arg, List<Item> &sel_fields,
ref_array= ref_array_start;
}
- if (item->type() == Item::SUM_FUNC_ITEM && !item->const_item())
+ if (item->type() == Item::SUM_FUNC_ITEM && !item->const_item() &&
+ (!((Item_sum*) item)->depended_from() ||
+ ((Item_sum *)item)->depended_from() == select_lex))
+
{
/*
This is a top level summary function that must be replaced with
diff --git a/sql/sql_select.h b/sql/sql_select.h
index 290a0f5d992..98f2a7829dd 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -509,8 +509,8 @@ TABLE *create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
ulonglong select_options, ha_rows rows_limit,
char* alias);
void free_tmp_table(THD *thd, TABLE *entry);
-void count_field_types(TMP_TABLE_PARAM *param, List<Item> &fields,
- bool reset_with_sum_func);
+void count_field_types(SELECT_LEX *select_lex, TMP_TABLE_PARAM *param,
+ List<Item> &fields, bool reset_with_sum_func);
bool setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param,
Item **ref_pointer_array,
List<Item> &new_list1, List<Item> &new_list2,
diff --git a/sql/sql_servers.cc b/sql/sql_servers.cc
index 195e6743a72..ac5ea6f4ac4 100644
--- a/sql/sql_servers.cc
+++ b/sql/sql_servers.cc
@@ -872,11 +872,15 @@ update_server_record(TABLE *table, FOREIGN_SERVER *server)
/* ok, so we can update since the record exists in the table */
store_record(table,record[1]);
store_server_fields(table, server);
- if ((error=table->file->ha_update_row(table->record[1],table->record[0])))
+ if ((error=table->file->ha_update_row(table->record[1],
+ table->record[0])) &&
+ error != HA_ERR_RECORD_IS_THE_SAME)
{
DBUG_PRINT("info",("problems with ha_update_row %d", error));
goto end;
}
+ else
+ error= 0;
}
end:
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 693ba779e5d..ef1f46bfdd2 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -548,9 +548,12 @@ int mysql_update(THD *thd,
error= table->file->ha_update_row(table->record[1],
table->record[0]);
}
- if (!error)
+ if (!error || error == HA_ERR_RECORD_IS_THE_SAME)
{
- updated++;
+ if (error != HA_ERR_RECORD_IS_THE_SAME)
+ updated++;
+ else
+ error= 0;
thd->no_trans_update.stmt= !transactional_table;
if (table->triggers &&
@@ -1524,7 +1527,8 @@ bool multi_update::send_data(List<Item> &not_used_values)
main_table->file->extra(HA_EXTRA_PREPARE_FOR_UPDATE);
}
if ((error=table->file->ha_update_row(table->record[1],
- table->record[0])))
+ table->record[0])) &&
+ error != HA_ERR_RECORD_IS_THE_SAME)
{
updated--;
if (!ignore ||
@@ -1542,6 +1546,11 @@ bool multi_update::send_data(List<Item> &not_used_values)
}
else
{
+ if (error == HA_ERR_RECORD_IS_THE_SAME)
+ {
+ error= 0;
+ updated--;
+ }
/* non-transactional or transactional table got modified */
/* either multi_update class' flag is raised in its branch */
if (table->file->has_transactions())
@@ -1768,13 +1777,17 @@ int multi_update::do_updates(bool from_send_error)
goto err;
}
if ((local_error=table->file->ha_update_row(table->record[1],
- table->record[0])))
+ table->record[0])) &&
+ local_error != HA_ERR_RECORD_IS_THE_SAME)
{
if (!ignore ||
table->file->is_fatal_error(local_error, HA_CHECK_DUP_KEY))
goto err;
}
- updated++;
+ if (local_error != HA_ERR_RECORD_IS_THE_SAME)
+ updated++;
+ else
+ local_error= 0;
if (table->triggers &&
table->triggers->process_triggers(thd, TRG_EVENT_UPDATE,
diff --git a/sql/table.cc b/sql/table.cc
index 45ca17afce4..68964e420da 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -2221,7 +2221,19 @@ File create_frm(THD *thd, const char *name, const char *db,
ha_checktype(thd,ha_legacy_type(create_info->db_type),0,0));
fileinfo[4]=1;
int2store(fileinfo+6,IO_SIZE); /* Next block starts here */
- key_length=keys*(7+NAME_LEN+MAX_REF_PARTS*9)+16;
+ /*
+ Keep in sync with pack_keys() in unireg.cc
+ For each key:
+ 8 bytes for the key header
+ 9 bytes for each key-part (MAX_REF_PARTS)
+ NAME_LEN bytes for the name
+ 1 byte for the NAMES_SEP_CHAR (before the name)
+ For all keys:
+ 6 bytes for the header
+ 1 byte for the NAMES_SEP_CHAR (after the last name)
+ 9 extra bytes (padding for safety? alignment?)
+ */
+ key_length= keys * (8 + MAX_REF_PARTS * 9 + NAME_LEN + 1) + 16;
length= next_io_size((ulong) (IO_SIZE+key_length+reclength+
create_info->extra_size));
int4store(fileinfo+10,length);
diff --git a/storage/myisam/mi_key.c b/storage/myisam/mi_key.c
index 230ebac3bb0..5b3662c4f28 100644
--- a/storage/myisam/mi_key.c
+++ b/storage/myisam/mi_key.c
@@ -254,16 +254,16 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old,
if (keyseg->flag & HA_SPACE_PACK)
{
uchar *end=pos+length;
- if (type != HA_KEYTYPE_NUM)
- {
- while (end > pos && end[-1] == ' ')
- end--;
- }
- else
+ if (type == HA_KEYTYPE_NUM)
{
while (pos < end && pos[0] == ' ')
pos++;
}
+ else if (type != HA_KEYTYPE_BINARY)
+ {
+ while (end > pos && end[-1] == ' ')
+ end--;
+ }
length=(uint) (end-pos);
FIX_LENGTH(cs, pos, length, char_length);
store_key_length_inc(key,char_length);
diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c
index 9ff8ecdb14d..405dca641d1 100644
--- a/storage/myisam/mi_open.c
+++ b/storage/myisam/mi_open.c
@@ -236,7 +236,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
key_parts+=fulltext_keys*FT_SEGS;
if (share->base.max_key_length > MI_MAX_KEY_BUFF || keys > MI_MAX_KEY ||
- key_parts >= MI_MAX_KEY * MI_MAX_KEY_SEG)
+ key_parts > MI_MAX_KEY * MI_MAX_KEY_SEG)
{
DBUG_PRINT("error",("Wrong key info: Max_key_length: %d keys: %d key_parts: %d", share->base.max_key_length, keys, key_parts));
my_errno=HA_ERR_UNSUPPORTED;
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index 99e41611eaa..9a80b932d20 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -186,7 +186,7 @@ int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, size_t a_length,
for (end= a + a_length-length; a < end ; a++)
{
if (*a != ' ')
- return (*a < ' ') ? -swap : swap;
+ return (map[*a] < ' ') ? -swap : swap;
}
}
return res;